Admin Manual / Appendix A – Witly Script / Sample Script
Sample Script

  1. To get value of the specified field. 

${Object.Amount}

  1. To get value of the specified field in a related module. 

${Object.Owner.Fullname}

  1. Multiply the field value with 100. 

${Object.Amount * 100}

  1. To calculate value from two fields. 

${Object.Amount / Object.Qty}

  1. To calculate value from two fields and multiply with a literal value.

${Object.Amount / Object.Qty * 100}

  1. To calculate value from multiple fields. 

${Object.Amount * Object.Qty - Object.Discount}

  1. To calculate value using aggregate function.

${Count(Object.Product[\"ProductID\"])}

  1. To calculate value from multiple fields and count the total number using aggregate function. 

${Object.Price * Count(Object.Product[\"Amount\"])}

  1. To get the list of value using For (Loop Control Command). 

${For i=Object.Product.Count} ${Object.Product [i].Name}, ${EndFor}

  1. To count number of child records.

${Count(Object.Parent.Contact[\"Name\"])}

  1. To get year and month from current date. 

${yyMM:Date.Now}

  1. To create 4-digit running number. 

${0000:RunningNo.Next}

  1. To create 4-digit running number and reset it monthly. 

${0000:RunningNo.Month.Next}

  1. To get the next running number. 

${RunningNo.Total.Next}

  1. To generate a unique value with running number and literal value, e.g., A-1710-01 .

A-${yyMM:Date.Now}-${00:RunningNo.Total.Next}

Last modified on Jan 23, 2018