COC of Customer form for inserting, updating and deleting the data

 This code is insert, update and delete data in custom table if a new customer is created/updated/deleted

Code :-

[ExtensionOf(tableStr(CustTable))]

final class BAS_CustTable_Extension

{

    void insert(DirPartyType _partyType , Name _name ,boolean _updateCRM)

    {

        next insert();

        BAS_CustTable custlog;

        ttsbegin;

        custlog.AccountNum = this.AccountNum;

        custlog.CustGroup = this.CustGroup;

        custlog.BAS_Name = this.nameAlias();

        custlog.insert();

        ttscommit;

    }


    public void update(boolean _updateSmmBusRelTable, boolean _updateParty)

    {

        BAS_CustTable Cust;

        ttsbegin ;

        select forupdate Cust

            where Cust.AccountNum == this.AccountNum;

           

        Cust.AccountNum = this.AccountNum;

        Cust.CustGroup =  this.CustGroup;

        Cust.update();

        ttscommit;

        next update();

    }


    public void delete()

    {

        BAS_CustTable cust;

        ttsbegin;

        select forupdate cust

            where cust.AccountNum == this.AccountNum;

        cust.delete();

        ttscommit;

        next delete();

    }


}


Comments

Popular posts from this blog

How to Create a wizard in x++ d365

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

X++ code to CREATE AND POST A TRADE AGREEMENT IN MICROSOFT DYNAMICS 365 in D365 F & O