Wednesday, 13 October 2021

AX365 Data Entities

Put some logic upon importing from data entity here below first copy event handler as below 



 and but the logic as below

 DataEntityContextEventArgs entityContextEventArgs = _eventArgs as DataEntityContextEventArgs;
        DataEntityRuntimeContext entityCtx = entityContextEventArgs.parmEntityContext();
        DataEntityDataSourceRuntimeContext dataSourceCtx = entityContextEventArgs.parmEntityDataSourceContext();

        if (dataSourceCtx.name() == dataEntityDataSourceStr(PbmIntegrationJournalLinesEntity, PbmIntegrationJournalLines))
        {
            PbmIntegrationJournalLinesEntity SalesOrderLineV2Entity = _sender as PbmIntegrationJournalLinesEntity;
            PbmIntegrationJournalLines _SalesLine = dataSourceCtx.getBuffer();
          

        if (SalesOrderLineV2Entity.BiPbmWBSLineTypes == BiPbmWBSLineTypes::Trans)
        {
            _SalesLine.lineType = PbmWBSLineTypes::Trans;
}

            if (SalesOrderLineV2Entity.BiPbmWBSLineTypes == BiPbmWBSLineTypes::Activity)
            {
                _SalesLine.lineType = PbmWBSLineTypes::Activity;
            }
            if (SalesOrderLineV2Entity.BiPbmWBSLineTypes == BiPbmWBSLineTypes::Summary)
            {
                _SalesLine.lineType = PbmWBSLineTypes::Activity;
            }

            if (SalesOrderLineV2Entity.BiPbmWBSLineTypes == BiPbmWBSLineTypes::Detail)
            {
                _SalesLine.lineType = PbmWBSLineTypes::Activity;
            }

        }

No comments:

Post a Comment