Cannot create a record in Address format lines (LogisticsAddressFormatLines). Address format: 0005, State or province.

By Vitaliy Glushchenko:

Job to fix the issue:
//Cannot create a record in Address format lines
static void fixCannotCreateRecordInLogisticAddrFmt(Args _args)
    LogisticsAddressFormatLines logisticsAddressFormatLines;
    LogisticsAddressFormatId    logisticsAddressFormatId = '0005'; //defaul value. This id more ofter meet
    Dialog                      dialog = new Dialog('We will delete lines from LogisticsAddressFormatLines for selected format. Are you sure?');
    DialogField                 dlgLogisticsAddressFormatId;

    dlgLogisticsAddressFormatId = dialog.addFieldValue(extendedTypeStr(LogisticsAddressFormatId), logisticsAddressFormatId);
    if (
        logisticsAddressFormatId = dlgLogisticsAddressFormatId.value();
        if (LogisticsAddressFormatHeading::exist(logisticsAddressFormatId))
            delete_from logisticsAddressFormatLines
                where logisticsAddressFormatLines.AddrFormat == logisticsAddressFormatId
            info(strFmt('Data for %1 was update, pleae run sync again', logisticsAddressFormatId));
            warning(strFmt('Value %1 not found in Address format', logisticsAddressFormatId));

Run This job and selectaddressFormatId from error above.

Rerun synchronization.



About is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.

Authors are allowed to set their own AdSense units.
Join us.

Blog Tags