Run triggers on FILTERED or SELECTED objects funcionality

Posted by Wim on 21-Feb-2016 02:57

Hello,

Of course the run triggers function is available on ALL objects.

But: Is there a way to run specific triggers on SELECTED or FILTERED objects?

Kindly answer please.

All Replies

Posted by Santosh Patel on 21-Feb-2016 04:49

I'm away from my system so can't give you actual code and steps, but this is what you can try.

- Define an object script trigger

- Use rbv_api.getSelectedIds(objName) serverside api method to get selected ids by an object (documentation.progress.com/.../index.html

- Iterate over the Ids and call rbv_api.runTrigger() method on each trigger you want to invoke for each record (documentation.progress.com/.../index.html

Lastly, put in a custom button on your page that invokes the rbf_runTrigger() on the object script trigger you created above, that users will execute after selecting records. Note that runTrigger takes in an object ID to run the trigger against, however as the content of your object script trigger is record agnostic, you can pass in any valid record id for that object type.

Posted by Wim on 21-Feb-2016 05:00

Dear Santosh,
 
Thanks for your reaction, should be possible to implement; i will let you know the result.
Regards,
Wim Hassink
 
 
Van: Santosh Patel [mailto:bounce-sapatel@community.progress.com]
Verzonden: zondag 21 februari 2016 11:50
Aan: TU.Rollbase@community.progress.com
Onderwerp: RE: [Technical Users - Rollbase] Run triggers on FILTERED or SELECTED objects funcionality
 
Update from Progress Community
 

I'm away from my system so can't give you actual code and steps, but this is what you can try.

- Define an object script trigger

- Use rbv_api.getSelectedIds(objName) serverside api method to get selected ids by an object (documentation.progress.com/.../index.html

- Iterate over the Ids and call rbv_api.runTrigger() method on each trigger you want to invoke for each record (documentation.progress.com/.../index.html

Lastly, put in a custom button on your page that invokes the rbf_runTrigger() on the object script trigger you created above, that users will execute after selecting records. Note that runTrigger takes in an object ID to run the trigger against, however as the content of your object script trigger is record agnostic, you can pass in any valid record id for that object type.

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

Afbeelding verwijderd door afzender.
 

Posted by Wim on 21-Feb-2016 06:48

Hello Santosh:
 
You write:

Lastly, put in a custom button on your page that invokes the rbf_runTrigger() on the object script trigger you created above, that users will execute after selecting records. Note that runTrigger takes in an object ID to run the trigger against, however as the content of your object script trigger is record agnostic, you can pass in any valid record id for that object type.

But is don’t understand the ‘callback’ script i need to write, when i use rbf_runTrigger .
Please help when it is possible for you if you are on the system again.
I think i would need the code from you.
 
Regards, Wim
 
Van: Santosh Patel [mailto:bounce-sapatel@community.progress.com]
Verzonden: zondag 21 februari 2016 11:50
Aan: TU.Rollbase@community.progress.com
Onderwerp: RE: [Technical Users - Rollbase] Run triggers on FILTERED or SELECTED objects funcionality
 
Update from Progress Community
 

I'm away from my system so can't give you actual code and steps, but this is what you can try.

- Define an object script trigger

- Use rbv_api.getSelectedIds(objName) serverside api method to get selected ids by an object (documentation.progress.com/.../index.html

- Iterate over the Ids and call rbv_api.runTrigger() method on each trigger you want to invoke for each record (documentation.progress.com/.../index.html

Lastly, put in a custom button on your page that invokes the rbf_runTrigger() on the object script trigger you created above, that users will execute after selecting records. Note that runTrigger takes in an object ID to run the trigger against, however as the content of your object script trigger is record agnostic, you can pass in any valid record id for that object type.

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

Afbeelding verwijderd door afzender.
 

Posted by Santosh Patel on 21-Feb-2016 07:24

It is simply a JavaScript function that will be called when the trigger execution finishes (with a success or a failure).

Pass in this as the callback and you should be fine.

function() { }

On Sun, Feb 21, 2016 at 6:19 PM, Wim <bounce-Wim@community.progress.com> wrote:

Update from Progress Community
Wim

Hello Santosh:
 
You write:

Lastly, put in a custom button on your page that invokes the rbf_runTrigger() on the object script trigger you created above, that users will execute after selecting records. Note that runTrigger takes in an object ID to run the trigger against, however as the content of your object script trigger is record agnostic, you can pass in any valid record id for that object type.

But is don’t understand the ‘callback’ script i need to write, when i use rbf_runTrigger .
Please help when it is possible for you if you are on the system again.
I think i would need the code from you.
 
Regards, Wim
 
Van: Santosh Patel [mailto:bounce-sapatel@community.progress.com]
Verzonden: zondag 21 februari 2016 11:50
Aan: TU.Rollbase@community.progress.com
Onderwerp: RE: [Technical Users - Rollbase] Run triggers on FILTERED or SELECTED objects funcionality
 
Update from Progress Community
 

I'm away from my system so can't give you actual code and steps, but this is what you can try.

- Define an object script trigger

- Use rbv_api.getSelectedIds(objName) serverside api method to get selected ids by an object (documentation.progress.com/.../index.html

- Iterate over the Ids and call rbv_api.runTrigger() method on each trigger you want to invoke for each record (documentation.progress.com/.../index.html

Lastly, put in a custom button on your page that invokes the rbf_runTrigger() on the object script trigger you created above, that users will execute after selecting records. Note that runTrigger takes in an object ID to run the trigger against, however as the content of your object script trigger is record agnostic, you can pass in any valid record id for that object type.

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

 

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

Posted by Wim on 21-Feb-2016 10:10

Hello Santosh,
The javascript callback function is fine, however the rbv_api.getSelectedIds seems not to work at all.
 
This is the code:
 
var v_select = rbv_api.getSelectedIds("tyre1");
 
var buff = '';
 
rbv_api.printArr(v_select);
 
if(v_select!=null)
{
               for(var i=0; i<v_select.length; i++)            
 
  var v_tyreid = v_select[i];
 
  rbv_api.runTrigger("tyre1", v_tyreid, 2461047, "false");
 
}            
 
The system keeps on calling that v_select only return null.
 
So i don’t know what is wrong with that function, i selected 3 records!
 
Is there a clue?
 
Regards, Wim Hassink
 
Van: Santosh Patel [mailto:bounce-sapatel@community.progress.com]
Verzonden: zondag 21 februari 2016 14:26
Aan: TU.Rollbase@community.progress.com
Onderwerp: RE: [Technical Users - Rollbase] Run triggers on FILTERED or SELECTED objects funcionality
 
Update from Progress Community
 

It is simply a JavaScript function that will be called when the trigger execution finishes (with a success or a failure).

Pass in this as the callback and you should be fine.

function() { }

On Sun, Feb 21, 2016 at 6:19 PM, Wim <bounce-Wim@community.progress.com> wrote:
 
Update from Progress Community
Afbeelding verwijderd door afzender.
 
Hello Santosh:
 
You write:

Lastly, put in a custom button on your page that invokes the rbf_runTrigger() on the object script trigger you created above, that users will execute after selecting records. Note that runTrigger takes in an object ID to run the trigger against, however as the content of your object script trigger is record agnostic, you can pass in any valid record id for that object type.

But is don’t understand the ‘callback’ script i need to write, when i use rbf_runTrigger .
Please help when it is possible for you if you are on the system again.
I think i would need the code from you.
 
Regards, Wim
 
Van: Santosh Patel [mailto:bounce-sapatel@community.progress.com]
Verzonden: zondag 21 februari 2016 11:50
Aan: TU.Rollbase@community.progress.com
Onderwerp: RE: [Technical Users - Rollbase] Run triggers on FILTERED or SELECTED objects funcionality
 
Update from Progress Community
 

I'm away from my system so can't give you actual code and steps, but this is what you can try.

- Define an object script trigger

- Use rbv_api.getSelectedIds(objName) serverside api method to get selected ids by an object (documentation.progress.com/.../index.html

- Iterate over the Ids and call rbv_api.runTrigger() method on each trigger you want to invoke for each record (documentation.progress.com/.../index.html

Lastly, put in a custom button on your page that invokes the rbf_runTrigger() on the object script trigger you created above, that users will execute after selecting records. Note that runTrigger takes in an object ID to run the trigger against, however as the content of your object script trigger is record agnostic, you can pass in any valid record id for that object type.

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

 

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

Afbeelding verwijderd door afzender.

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

Afbeelding verwijderd door afzender.
 

Posted by Santosh Patel on 23-Feb-2016 10:10

I tried out the getSelectedIds function and it seems to give me the selected ids list. Are you on public cloud? If so, can you enable support access in your tenant so that I can get in and verify the problem?

This is what I tried.

On employee object, create an object script trigger with this content

rbv_api.setFieldValue('employee5', 125979957, 'updateselectcount', rbv_api.getSelectedIds('employee5').length);

updateselectcount is integration name for the field that i'm updating the count of selected ids with. 125979957 is id for a particular employee where i'm updating the count field (just for checking the value).

And then in UI after selecting 3 values, this is what I invoked.

rbf_runTrigger('employee5',125979957,223254729,false, function(data) {console.log(data);});

223254729 - the object script trigger's id

on a successful run the console prints "true" and if you refresh the grid data, employee id 125979957 record's updateselectcount field shows the value 3

This thread is closed