We have a customer who needs a charge on the SO Invoice to read as a specific phrase. The logic is this: If the InvoiceAccount is 000300 and the Description is “Insurance Upcharge”, then put “Documentation Fee”.
I have attempted this with many variations using a nested iif() statement on the OILMarkupTotalsTmp/@Description Field tag, and also using and AND within the condition object of a single iif() statement. I am not able to achieve the desired result. I am able to change the text if I leave out the condition of the InvoiceAccount. I am using the Data Context for a Group tag on the OILMarkupTotalsTmp node. Below is a sample of my attempt.
Thank you Amir. I had actually tried that statement before posting and it did not work. I tried it again with a copy/paste of your statement for thoroughness, but without success. I have always reached out to support via email and you all are very responsive. I decided to begin using the forum so others can benefit from the help I receive. I will update this post after support email resolution.
We encourage our users to use our forum for the exact reasons you mentioned. By sharing your case, other users can benefit as well. Remember, sharing is caring.
I didn’t notice your email in our support inbox. Could you confirm if you’ve sent it?
I will post the answer I have already sent to you via the support ticket that you’ve opened. This way we can share the solution with the whole community.
The logic you have implemented is correct, there is just one small thing you have missed. Since the List tagging element is binded to a OILMarkupTotalsTmp lines this makes the @Description field its child element, but this is not the case for @InvoiceAccount field.
That is why, you need to reference the whole path of the @InvoiceAccount field. This field is located in the SalesInvoiceHeaderFooterTmp lines. To reach this record, cursor must go into parent element, which is ReportData and then into the SalesInvoiceHeaderFooterTmp lines, where the @InvoiceAmount is located.
You can go into the parent element by using the following operator:
…/
The expression has therefore been missing just the path to the @InvoiceAmount field, so that it would look like this:
iif(../SalesInvoiceHeaderFooterTmp/@InvoiceAccount = '000300' and @Description = 'Insurance Upcharge','Documentation Fee',@Description)