Not sure where to place this question.
I am trying to create a crmscript trigger (before save sale) that will update the sale amount based on custom calculations,
e.i sum of userdefined fields.
I am able to retrieve all the values from the userdefined fields,
sample code:
EventData ed = getEventData();
String av1 = ed.getInputValue("SaleEntity.UserDefinedFields.SuperOffice:2").after("F:").until("]");
String av2 = ed.getInputValue("SaleEntity.UserDefinedFields.SuperOffice:6").after("F:").until("]");
String av3 = ed.getInputValue("SaleEntity.UserDefinedFields.SuperOffice:7").after("F:").until("]");
Float totalAmount = av1.toFloat() + av2.toFloat() + av3.toFloat();
ed.SetOutputVale("SaleEntity.Amount", totalAmount.toString(2));
Unfortunately, this didn't work and I am getting this error:
"Property .Amount was not found in data object"
Any suggestions?
Thanks.