venerdì 22 dicembre 2017

D365FFO: Importing customers using data entity does not init value from customer group

Importing customers using dataentity does not init data from customer group, for example Payment Terms does not automatically inizialized from group.

This extension on CustCustomerEntity data entity will fix that problem

[ExtensionOf(dataentityviewstr(CustCustomerEntity))]
final class CustCustomerEntity_Extension
{
    [DataEventHandler(tableStr(CustCustomerEntity), DataEventType::MappedEntityToDataSource)]
    public static void CustCustomerEntity_onMappedEntityToDataSource(Common _sender, DataEventArgs _eventArgs)
    {
        CustCustomerEntity custCustomerEntity = _sender;
        DataEntityContextEventArgs dataEntityContextEventArgs = _eventArgs;

        DataEntityDataSourceRuntimeContext _dataSourceCtx = dataEntityContextEventArgs.parmEntityDataSourceContext();
        if (_dataSourceCtx.name() == dataEntityDataSourceStr(CustCustomerEntity, CustTable))
        {
            CustTable custTable = _dataSourceCtx.getBuffer();
            custTable.initFromCustGroup(CustGroup::find(custTable.CustGroup));
        }
    }
}

Apply to D365FFO Platform Update 11 Spring 2017

Nessun commento:

Posta un commento

AX 2012: The request was aborted: Could not create SSL/TLS secure channel

The error you're encountering, "The request was aborted: Could not create SSL/TLS secure channel," can occur due to various re...