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 (dialog.run())
    {
        logisticsAddressFormatId = dlgLogisticsAddressFormatId.value();
        if (LogisticsAddressFormatHeading::exist(logisticsAddressFormatId))
        {
            ttsBegin;
            delete_from logisticsAddressFormatLines
                where logisticsAddressFormatLines.AddrFormat == logisticsAddressFormatId
                ;
            ttsCommit;
            info(strFmt('Data for %1 was update, pleae run sync again', logisticsAddressFormatId));
        }
        else
        {
            warning(strFmt('Value %1 not found in Address format', logisticsAddressFormatId));
        }
    }
    info('done');
}

Run This job and selectaddressFormatId from error above.



Rerun synchronization.



 

Search

About

DaxOnline.org 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