Jump to content

Trigger Issue updating User Defined Dimension


 Share

Recommended Posts

I'm trying to update a User Defined Dimension on the AP Bill Detail based on the value of the account number used.

Trigger: Before Create, Before Update
On field Change: Any update
Record: AP bill detail
Field to change: Restriction

Change Formula:

let [accountNum,nothing] = "{!APBILLITEM.ACCOUNTNO!}".split("-");
if(accountNum >= 50000){
  return 10002;
}

I've verified it's running, and the formula works as it will successfully update the Memo field. However, when I try to update the dimension, it doesn't update. I tried the update via Postman using 10002 for the value of the User Defined Dimension, and it updates correctly.

Is this a limitation of triggers?

Link to comment
Share on other sites

Posted (edited)

I tried to do that, but I think I started a recursive loop. The API called caused the trigger to fire and since the trigger is on the APBILLITEM which is what the API is updating, it caused the API to trigger again. Here the API call:

<update>
        <APBILL>
          <RECORDNO>{!APBILLITEM.RECORDKEY!}</RECORDNO>
          <APBILLITEMS>
            <APBILLITEM>
                <RECORDNO>{!APBILLITEM.RECORDNO!}</RECORDNO>
                <AMOUNT>{!APBILLITEM.TRX_AMOUNT#value!}</AMOUNT>
                <ACCOUNTNO>{!APBILLITEM.ACCOUNTNO!}</ACCOUNTNO>
                <LOCATIONID>{!APBILLITEM.LOCATIONID!}</LOCATIONID>
                <VENDORID>{!APBILLITEM.VENDORID!}</VENDORID>
                <PROJECTID>{!APBILLITEM.PROJECTID!}</PROJECTID>
                <GLDIMRestriction>10002</GLDIMRestriction>
            </APBILLITEM>
          </APBILLITEMS>
        </APBILL>
</update>

What I'm attempting now is a "Update Field Value" trigger. Here is a screenshot: image.thumb.png.60d55975c0af14a8a70dc90484f98f70.png

Edited by Josh Kenzer
Link to comment
Share on other sites

 Share

×
×
  • Create New...