Provide the transport mode exactly once

Error FX-SCH-A-000322 Factur-X

Element 'ram:ModeCode' 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

ram:ModeCode does not occur exactly once in ram:SpecifiedLogisticsTransportMovement. The element is either missing or occurs more than once.

What the rule means

The code specifies the transport mode for the stated transport movement. Exactly one occurrence ensures that this information is present unambiguously.

Please provide the transport mode code exactly once

ram:ModeCode is missing from the transport section or occurs more than once. Providing exactly one occurrence will resolve the issue.

What to do
  1. Locate ram:SpecifiedLogisticsTransportMovement in the consignment information.
  2. Check that it contains exactly one ram:ModeCode.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedLogisticsTransportMovement/>
✓ Correct
<ram:SpecifiedLogisticsTransportMovement>
  <ram:ModeCode/>
</ram:SpecifiedLogisticsTransportMovement>
Technical details

The Schematron condition checks whether exactly one direct ram:ModeCode element occurs in the context.

Where the rule applies

The rule applies to the transport movement ram:SpecifiedLogisticsTransportMovement within the consignment information.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeDelivery/ ram:RelatedSupplyChainConsignment/ram:SpecifiedLogisticsTransportMovement
Test expression (assert/@test)
count(ram:ModeCode)=1