generate Auto Number seq while import in Data entity

 Today we have a requirement to generate the number seq automatically while import


To acieve this requirement follow the below steps

1) make the nonmadatory on data entity as well staging table filed which you want to auto-generate 


2) Write a piece of code on the data entity 


 public void initValue()

    {

        if (!this.skipNumberSequenceCheck())

        {

            NumberSeqRecordFieldHandler::enableNumberSequenceControlForField(

                this, fieldNum(IHSEntAssetMaintenanceWorkOrderTableEntity, WorkOrderID), EntAssetParameters::numRefWorkOrderId());

        }

        

        super();

    }


===============================================================


Please note If the standard entity have the mandatory  true we cannot change it but we can make the duplicate of it and achieve the scenario 

Comments

Popular posts from this blog

Customization on Sales invoice Report in D365 F&O

75) COC - Create a coc of the table modified method

46) D365 FO: SHAREPOINT FILE UPLOAD USING X++