Advanced Texts

How records are identified? In the table “EOS009 Doc. Adv. Text Header” there are three fields that will identify the record to which the AdvTexts are attached:

  1. “Source Table ID”: This is the record id e.g. 36 (Sales Header)
  2. “Source Option Type”: This is the option type and it will be used for tables like Sales Header or Purchase Header
  3. “Source GUID”: This is the System ID of the record. see MS Docs

How to get the Avanced Texts from a record

	procedure GetAdvancedText(fromRec: Variant)
    var
        DocAdvTextHeader: Record "EOS009 Doc. Adv. Text Header";
        RecordIdentBuffer: Record "EOS Record Ident. Buffer" temporary;
        RecRef: RecordRef;
    begin
        RecRef.GetTable(fromRec);

        RecordIdentBuffer.DecodeRecord(fromRec);

        DocAdvTextHeader.SetCurrentKey("Source GUID", "Source Option Type", "Source Table ID");
        DocAdvTextHeader.SetRange("Source Table ID", RecordIdentBuffer."Source Type");
        DocAdvTextHeader.SetRange("Source Option Type", RecordIdentBuffer."Source Subtype");
        DocAdvTextHeader.SetRange("Source GUID", RecRef.Field(RecRef.SystemIdNo()).Value());
		
		// here's my DocAdvTextHeader filtered and ready to use
    end;

How to get the source record from an Advanced Text

    local procedure MyProcedure(DocAdvTextHeader: Record "EOS009 Doc. Adv. Text Header")
    var
        RecRef: RecordRef;
    begin
        RecRef.Open(DocAdvTextHeader."Source Table ID");
        RecRef.GetBySystemId(DocAdvTextHeader."Source GUID");
    end;

EOS Labs -