In this article we will share some of the most used expressions. If you have one - which is not on the list - please reach out and so we can add it.
TABLE OF CONTENTS
- How to combine text with D365 fields in ExpressionsThis example is in D365 LAC Report structure
- How to Show only some text in the string/If field
- How to replace some text/thing in the string
- Calculate multiply, subtraction, dividing
- Create expression with multiple conditions
This example is in D365 LAC Report structure
How to Show only some text in the string/If field
1. Hide line field - if line field is the same as header field
Example on sales confirmation; we have delivery date on line level and on header level.
On line level - we only want to show those dates which are different form the header date.
A. Find line field.
B. On condition Column - Choose code
C. Choose Expression
D. Paste in the following Expression: If SalesTable.DeliveryDate=SalesConfirmDetailsTmp.DlvDate Then 0 Else 1
E. Click OK
Or build it from Scratch
Now No line field - when line field is the same as header field
(If SalesTable.ShippingDateRequested=SalesLine.ShippingDateRequested Then 0 Else 1)
2. Show only a bit of the substring
How to replace some text/thing in the string
1. Replace a word with another word
Example, Some companies uses the Proforma invoice or sales confirmation as Export Invoice - therefor they want the title "Export invoice" to replace the title.
Paste or build expression:
strReplace ( SalesConfirmHeaderTmp.LACOriginalReport_DocumentTitle() , "Confirmation" , "Export Invoice" )
Calculate multiply, subtraction, dividing
Example - LineAmount divided by qty can show the "unit price after discount"
A. Create a new element
B. Paste in the following Expression:
or build it using the "Select value"
Create expression with multiple conditions
See separate article