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.
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.
|
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.
|
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() { }
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, WimVan: 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.
You received this notification because you subscribed to the forum. To unsubscribe from only this thread, go here.
Flag this post as spam/abuse.
You received this notification because you subscribed to the forum. To unsubscribe from only this thread, go here.
Flag this post as spam/abuse.
|
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