COC for data entity methods

 

EcoResReleasedProductV2Entity entity Methods : insert, update,validatewrite

[ExtensionOf(tableStr(EcoResReleasedProductV2Entity))]

final class CST_EcoResReleasedProductV2_Extension

{

    public void update()

    {

        InventTable         inventTable;

        CST_ItemSubMaster   cST_ItemSubMaster;   


        next update();

        if(this.CST_ParentItemId != this.ItemNumber)

        {

            cST_ItemSubMaster.ParentItem = this.CST_ParentItemId;

            cST_ItemSubMaster.ChildItem  = this.ItemNumber;

            cST_ItemSubMaster.insert();

        }

    }


    public void insert()

    {

        InventTable         inventTable;

        CST_ItemSubMaster   cST_ItemSubMaster;


        next insert();

        if(this.CST_ParentItemId != this.ItemNumber)

        {

            cST_ItemSubMaster.ParentItem = this.CST_ParentItemId;

            cST_ItemSubMaster.ChildItem  = this.ItemNumber;

            cST_ItemSubMaster.insert();

        }

    }


    public boolean validateWrite()

    {

        InventTable         inventTable;

        CST_ItemSubMaster   cST_ItemSubMaster;

        boolean ret = next validateWrite();

        EcoResReleasedProductV2Entity ecoResReleasedProductV2Entity = this;

 

        if(this.ItemNumber == this.CST_ParentItemId )

        {

            ret = checkFailed("@Costco:ParentChildItemError");

        }

        return ret;

    }


}

Comments

Popular posts from this blog

how to post trade agreement journals automatically using x++ code

How to Create a wizard in x++ d365

x++ code to submit and approve and reject the invent movement workflow in d365 F&O