Reference identifier for document type 50 is missing or duplicated

Error FX-SCH-A-000560 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

The additional referenced document does not contain exactly one ram:IssuerAssignedID. The element is either missing or occurs more than once.

What the rule means

ram:IssuerAssignedID contains the identifier assigned to the referenced document by its issuer. Exactly one value ensures that the identifier is specified unambiguously for this document.

Please provide the reference identifier for the document of type `50` exactly once

The additional referenced document with ram:TypeCode 50 is missing ram:IssuerAssignedID, or the element occurs more than once. You can adjust the document so that the element occurs exactly once.

What to do
  1. Locate the additional referenced document with ram:TypeCode 50.
  2. Check that it contains exactly one ram:IssuerAssignedID.
  3. Add the element if it is missing, or remove any extra occurrences.
  4. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:AdditionalReferencedDocument>
  <ram:TypeCode>50</ram:TypeCode>
</ram:AdditionalReferencedDocument>
✓ Correct
<ram:AdditionalReferencedDocument>
  <ram:TypeCode>50</ram:TypeCode>
  <ram:IssuerAssignedID>REF-123</ram:IssuerAssignedID>
</ram:AdditionalReferencedDocument>
Technical details

The assertion counts the direct ram:IssuerAssignedID elements in the current ram:AdditionalReferencedDocument with ram:TypeCode 50 and requires exactly one.

Where the rule applies

The rule applies to each additional referenced document with ram:TypeCode 50 within the document-level agreement.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ ram:AdditionalReferencedDocument[ram:TypeCode="50"]
Test expression (assert/@test)
count(ram:IssuerAssignedID)=1