cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Receiver Determination condition

0 Kudos

Hello Experts,

Issue:  Structure is :

           Invoices -- > InvoiceDetail --> InvoiceType

There can be multiple Invoice details.

I need to get the last value of InvoiceType and compare it with an constant.

IF its true mapping ABC will be used, if its false, mapping xyz will be used.

The trick is to find the last or latest value of InvoiceType as this is an incremental xml.

I tried the folowing:

If I give a constant value to the position function for comparison it works, but here i need to find the last value which can have any position

(/tXML/Message/Order/Invoices/InvoiceDetail/InvoiceType[position() = 3] NE Adjustment) – it works

(/tXML/Message/Order/Invoices/InvoiceDetail/InvoiceType[max(position())] NE Adjustment) – it fails

(/tXML/Message/Order/Invoices/InvoiceDetail/InvoiceType[last()] NE Adjustment) – it fails

/tXML/Message/Order/Invoices/InvoiceDetail\[position() = max(position())\]/InvoiceType - it fails

Please help!!

Thanks

Shikha

Accepted Solutions (1)

Accepted Solutions (1)

Snavi
Active Participant
0 Kudos

Hi Shikha,

try with the below condition

(/tXML/Message/Order/Invoices/InvoiceDetail/InvoiceType)[last()]



Answers (1)

Answers (1)

0 Kudos

Thank You Navdeep.