# BR-FREXT-11

Source: https://xmlvalid.com/rules/BR-FREXT-11

> Num Fact : … , Num line : … , ParentID : … - [BR-FREXT-11]-Each "Identifier of parent line" (EXT-FR-FE-162) must refer to an existing "Invoice line Identifier" (BT-126) of another invoice line (BG-25).

- Level: error
- Rule sets: EXTENDED-CTC-FR rules (UBL) 1.4.0.04
- Context: `(cac:InvoiceLine|cac:CreditNoteLine)`
- Test: `($isParentID and exists((../cac:InvoiceLine|../cac:CreditNoteLine)[cbc:ID = $parentID][cbc:ID != $lineID])) or not($isParentID)`

> Num line : … , ParentID : … - [BR-FREXT-11]-Each "Identifier of parent line" (EXT-FR-FE-162) must refer to an existing "Invoice line Identifier" (BT-126) of another invoice line (BG-25).

- Level: error
- Rule sets: EXTENDED-CTC-FR rules (CII) 1.4.0.04
- Context: `//ram:IncludedSupplyChainTradeLineItem`
- Test: `($parentID != '' and exists(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem[ram:AssociatedDocumentLineDocument/ram:LineID = $parentID and ram:AssociatedDocumentLineDocument/ram:LineID != $lineID])) or $parentID = ''`

Validate a document against these rules: https://xmlvalid.com/validate
