Jeff Hartman Posted September 23 Share Posted September 23 Our client has credit card transactions coming in from Ramp which omit the customer ID on each line, but the project id is provided. Client is looking to have the customer ID updated based upon the project ID tagged on the credit card entry line. If possible, the planned solution is to have a smart event fire and read the customer ID from the project on the line and inject it in the update. I was able to update one transaction line with a smart event using the syntax below injecting discrete values: <update_cctransaction key="3171"> <updateccpayitems> <updateccpayitem line_num ="1"> <customerid>11048</customerid> </updateccpayitem> </updateccpayitems> </update_cctransaction> But ideally we would like to have the smart event fire on the entry line since there may be more than one line. I did not find any documentation to support that and testing with this did not work. One alternative is to have a trigger on each line write its record data to a custom object, including the customerid and then do updates through a trigger on those created records, but the round trip just seems like an unnecessary step if a line level smart event can do the update. We are using a smart event because we need to resolve to the customerid from the project on the line. We haven't been able to resolve to the customerid yet. We tried injecting as follows: <customerid>{!CCTRANSACTIONENTRY.PROJECT.CUSTOMERID!}</customerid> But that is not resolving to anything. So there are two questions: 1) is there a line level API we could use? 2) advice on syntax to return the customer ID based upon the project on the line. Any advice would be appreciated. Link to comment Share on other sites More sharing options...
Jeff Hartman Posted September 24 Author Share Posted September 24 After much trial and error, we got a line level smart event to work. We added a condition to prevent looping: {!CCTRANSACTIONENTRY.CUSTOMERID!} == '' && {!CCTRANSACTIONENTRY.PROJECTID!} != '' And here is the API argument that did the update: <update_cctransaction key="{!CCTRANSACTIONENTRY.CCTRANSACTION.RECORDNO!}"> <updateccpayitems> <updateccpayitem line_num ="{!CCTRANSACTIONENTRY.LINE_NO!}"> <customerid>{!CCTRANSACTIONENTRY.PROJECT.CUSTOMERID!}</customerid> </updateccpayitem> </updateccpayitems> </update_cctransaction> The issue was getting the correct key for the entry level record. 1 Link to comment Share on other sites More sharing options...
Recommended Posts