rbf_runTrigger Error

Posted by Rollbase User on 01-Mar-2013 03:12

I'm encountering a problem on running Object Script Trigger on View of a Record using rbf_runTrigger("upload1", parseInt("{!id}"), "^createpayment"); . Scenario : On view of a record a trigger will Run object script that will map records from External Table going to RB table; Question : What are the things need to consider to Run object script with query inside that will get information from external table and copy the record Via Datamap on the RB table? When I force Run the Trigger on Object Definition>Triggers>Run Triggers>^createpayment The trigger is running and I'm getting the expected output as well as on BatchJob but when I use the rbf_runTrigger on View Page it's seems not working. Can someone help me?Thanks.

All Replies

Posted by Admin on 01-Mar-2013 11:29

What was exception message? Also trace from events.log file would be useful.

Posted by Admin on 03-Mar-2013 21:05

Hi Pavel, Actually there's no Exception Message because there's no error on the script, I'll ask the administrator for the events.log,



If there's no Exception Message what else might be the cause of not Running of the trigger?



FYW Query Permission is already checked even the View and Create permission for the objects, Thanks Sir.

Posted by Admin on 03-Mar-2013 21:56

I recommend you invoke client-side API while Triggers debug window is on. Please let me know what do you see.

Posted by Admin on 03-Mar-2013 22:10

Debug Window :







Validate Formula:





As You can see there's no Error in the code and I tried to Print the expected Value.

Thanks,

Posted by Admin on 03-Mar-2013 23:10

So everything is running as expected? Since you have debug output you can figure out what's going on.

Posted by Admin on 04-Mar-2013 01:06

Hi Pavel, There's no Problem with the code inside the object script it Run as expected on the batch job, The Problem is that, The object script didn't Run using the rbf_runTrigger and I don't know why. I want this Trigger to also run onload of view of a record, meaning when I click the link going to the view page of a specific record, This object script will Run the query that will get All related records from an External Table and Map it on another Table. Thanks,

Posted by Admin on 04-Mar-2013 12:05

I did a simple test:

1. Created 2 Currency fields "money1" and "money2"

2. Created Object Script trigger "CPY":



var x = rbv_api.getFieldValue("item4", {!id}, "money1");

rbv_api.setFieldValue("item4", {!id}, "money2", x);

var y = rbv_api.getFieldValue("item4", {!id}, "money2");

rbv_api.println("money1="+x+" money2="+y);



3. Created Button which runs the following client-side script:



rbf_runTrigger("item4", {!id}, "CPY");





Everything runs as expected: value from "money1" field is copied to "money2" field when button is pressed (note: pressing button will not refresh the page).

This thread is closed