I am trying to add a business context model XQuery between the PO Header and the Document Type - AP_Trade_Invoice. The PO Header has the standard object ID's. The AP Invoice has attributes of Company # and Purchase order number. The AP invoice does not separate the Purchase Order and the suffix into 2 objects. It is stores at a string (e.g. 12345-00) What I would like to do is match this string on the AP Invoice to a concatenation of the purchase order and suffix on the PO. The XQuery I have to do this is as follows:
/AP_Trade_Invoice[@Company _Number = "{id1}" AND @PO _Number = concat("{id2}", "-", (if (number({id3}) < 10) then concat("0", string({id3})) else string({id3})))]
The id values correspond to the purchase order header and the attribute names correspond to the AP Trade Invoice. I can not get the document to show in the related information where these values match. Is such concatenation possible?