G
Godfrey Sorita
Guest
Hi Jason, You can use log() API to trace the value of your variables when running a trigger. The code below is a slightly modified version of your code. It will still execute the same actions but it logs the values of your variables DURING trigger run-time. rbv_api.setFieldValue("USER", {!id}, "subordinate_sales_agents", ''); {!#LOOP_BEGIN.ORG_CHART} var AcctID = rbv_api.selectQuery("SELECT sales_agent_id#value FROM agility_user_data WHERE agility_login = ?", 1, '{!ORG_CHART#C.loginName}'); if (AcctID.length == 1) { var SA1 = rbv_api.getFieldValue("USER", {!id}, "subordinate_sales_agents"); rbv_api.log("debug", "SA1:"+SA1); var SA2; if (SA1 != '') { var SA2 = SA1 + '|' + AcctID[0][0]; } else { var SA2 = AcctID[0][0]; } rbv_api.setFieldValue("USER", {!id}, "subordinate_sales_agents", SA2); rbv_api.log("debug", "SA2:"+SA2); } {!#LOOP_END.ORG_CHART} var text = rbv_api.getFieldValue("USER", {!id}, "subordinate_sales_agents"); rbv_api.println(text); rbv_api.log("debug", "text:"+text); After running the trigger, kindly check the results by clicking the log button(See screenshot below). Regards, Godfrey
Continue reading...
Continue reading...