Specify exactly one buyer order reference identifier

Error FX-SCH-A-000029 Factur-X

Element 'ram:IssuerAssignedID' must occur exactly 1 times.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

Within ram:BuyerOrderReferencedDocument, ram:IssuerAssignedID does not occur exactly once. The element is missing or appears more than once.

What the rule means

The identifier assigned by the issuer identifies the referenced buyer order. Exactly one identifier element is required in this document context.

Please include exactly one identifier for the buyer order

ram:IssuerAssignedID is missing from the buyer order reference document, or the element appears more than once. Exactly one entry identifies the reference unambiguously.

What to do
  1. Find ram:IssuerAssignedID in ram:BuyerOrderReferencedDocument.
  2. Add the element if it is missing, or remove duplicates so that it occurs exactly once.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:BuyerOrderReferencedDocument/>
✓ Correct
<ram:BuyerOrderReferencedDocument>
  <ram:IssuerAssignedID/>
</ram:BuyerOrderReferencedDocument>
Technical details

The XPath test counts the direct child elements ram:IssuerAssignedID and requires the count to be 1.

Where the rule applies

The rule applies within ram:BuyerOrderReferencedDocument in the trade agreement.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ ram:BuyerOrderReferencedDocument
Test expression (assert/@test)
count(ram:IssuerAssignedID)=1