I try to use REPLACE_PATTERN function with some attributes, but if one attribute is empty->the result of the function is empty attribute also.
For example:
Orders.CustomerFirstName = Jane
Orders.CustomerLastName = Doe
Creating another BO based on Orders.BO with these rules => the result is ok.
Rule 1:
Code: Select all
If Messages.HTML CONTAINS '{CustomerFirstName}' Then
Messages.HTML=REPLACE_PATTERN(Messages.HTML,'\{CustomerFirstName\}',Messages.Owner.Customer_FirstName)
Code: Select all
If Messages.HTML CONTAINS '{CustomerLastName}' Then
Messages.HTML=REPLACE_PATTERN(Messages.HTML,'\{CustomerLastName\}',Messages.Owner.Customer_LastName)
Orders.CustomerFirstName = 'Jane'
Orders.CustomerLastName = ''
https://streamable.com/3g3yf
Here is a sample BSV:
1. Create one Order (complete Customer First Name, Customer Last name)
2. Create a message template with both 2 tokens {CustomerFirstName} {CustomerLastName}
2. In Orders list query -> click "Create Message" button
==> inspect the result in "Messages" query (you should see the message with entered info in Orders attributes)
3. Edit the Order and empty one field
4. In Orders list query -> click "Create Message" button -->inspect the created message ->the result will be an empty field.