To show the VAT element of the outstanding balance
This will only be correct if the full amount is outstanding
SLPostedCustomerTrans.OutstandingValue - ((SLPostedCustomerTrans.OutstandingValue * SLPostedCustomerTrans.BaseNetValue) / SLPostedCustomerTrans.BaseGrossValue)
To show agents commission based on the net amount
In this example the commission is calculated at 10%.
SLPostedCustomerTrans.BaseNetValue* 0.10
To show the first name and surname of a contact name as separate fields
To show the first name from the Customer contact name:
Substring(SLCustomerAccounts.ContactName,0,IndexOf(SLCustomerAccounts.ContactName," "))
To show the surname from the Customer contact name:
Substring(SLCustomerAccounts.ContactName,IndexOf(SLCustomerAccounts.ContactName," "),
(Length(SLCustomerAccounts.ContactName)-IndexOf(SLCustomerAccounts.ContactName," ")))
To show the first name from the Customer contact name and add a comma:
Concat(Substring(SLCustomerAccounts.ContactName,0,IndexOf(SLCustomerAccounts.ContactName," ")) ,",")
The Concat( ) function is used to combine the first name of the contact name with a comma. The Substring( ) function is used to extract the first name from the SLCustomerAccounts.ContactName. The IndexOf( ) function is used to make the Substring function return all information before the first space in the contact name.
TIP:
For Supplier contact names, replace SLCustomerAccounts.ContactName with PLSupplierAccounts.ContactName.
To change the case used for the Customer contact name
To change the Customer contact name to initial capitals, regardless of whether it was entered in all capitals or all lower case:
NOTE:
This expression only works correctly with a first name and surname in the contact name box. It does not work if the contact name includes a middle name, or if it has only one name.
ToUpper(Substring(SLCustomerAccounts.ContactName, 0,1)) + ToLower(Substring(SLCustomerAccounts.ContactName, 1, (IndexOf(SLCustomerAccounts.ContactName, " ")))) + ToUpper(Substring(SLCustomerAccounts.ContactName, (IndexOf(SLCustomerAccounts.ContactName," " )+1),1)) + ToLower(Substring(SLCustomerAccounts.ContactName, (IndexOf(SLCustomerAccounts.ContactName, " ")+2)))
To show only the end of a value, for example, the last 3 characters
Substring(SLCustomerAccounts.AnalysisCode1,Length(SLCustomerAccounts.AnalysisCode1) - 3)
This calculates the length of the string, in this example the analysis 1 value, and then instructs the substring to start 3 digits from the end, that is, the length minus 3.