Catalog item field to be populated in the Interaction Email


Hi Experts,

We are trying to configure the cart item decscription field into interactions from svccartitem table , after trying the below script it still taking random value during the first email trigger , however the other emails after interaction is raised has perfect value in cart.item only the intiial email trigger has issue , when checking RAD debugger after interaction is created the value for cart.item has right value for which the request is created for  , the issue is only with first email sent out.

 

sl-function newparamadd(number){
var myCartItem = new SCFile("svcCartItem");
if (myCartItem.doSelect("cartId=\"" number "\"")==RC_SUCCESS){
return myCartItem.item_description;
} else return "No Item";
}

 

trigger : before update

record.cart_item = lib.Catalogadd.newparamadd(record.cartId);