Specify the transport mode for the transport movement

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 is missing from ram:SpecifiedLogisticsTransportMovement or occurs more than once. It must occur exactly once.

What the rule means

ram:ModeCode specifies the transport mode for the stated transport movement.

Please specify the transport mode exactly once

The transport mode is missing from the transport movement information or is entered more than once. You can adjust the XML so it occurs exactly once.

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

The XPath counts the direct ram:ModeCode elements in ram:SpecifiedLogisticsTransportMovement; the count must equal 1.

Where the rule applies

The rule applies to the transport movement information in the delivery details.

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