Finance and operations

X++ “Cross reference” for extended data types

I wrote a job to check which fields uses a specific enum. This week I needed something similar for an extended data type and I modified it to work with EDTs instead.

The cross reference on the environment I am currently working on is not up to date. I used this job to find all the table fields that use this extended data type, similar to what the standard cross reference function does.

Simply change the extended data type in line 5 to the EDT you want to investigate, and the job makes a list of table fields that uses the EDT. You can also change the layer depending on what you are looking for.

For example, for InterCompanyCompanyId, searching through all the fields in the SYS layer:

//Tina van der Vyver
static void edtCrossReference(Args _args)
    str                 edtName = extendedTypeStr(InterCompanyCompanyId);
    ExtendedTypeId      edtId = extendedTypeName2Id(edtName);
    UtilIdElements      utilfield;     
    DictField           dictField;       
    setPrefix(strFmt("EDT: %1", edtName));
    while select parentId, utilLevel, Name, id from utilfield
        where utilfield.recordType == UtilElementType::TableField        
        && utilfield.utilLevel  == UtilEntryLevel::sys
        dictField = new DictField(utilfield.parentId, utilfield.Id);
        if (dictField.typeId() == edtId)
            info(strFmt("%1: %2 - %3", utilfield.utilLevel, tableId2name(utilfield.parentId),;

IntercompanyCompanyId crossreferance

1 thought on “X++ “Cross reference” for extended data types”

Leave a Reply

Your email address will not be published. Required fields are marked *