'Set Default Value on SalesOrderForm in Microsoft Dynamics using COC

I have added field in salesTable and on the salesTable form. I want to put the default values like created when the sales order is created and Updated when sales order is updated. All I have to do is using chain of command.



Solution 1:[1]

You create a new class,extension of SalesTable, with something like this:

[ExtensionOf(tablestr(SalesTable))]
final class SalesTable_MyExt_Extension
{
    void initValue(SalesType _salesType)
    {
        next initValue();
        
        this.myField = "foo";
    }

    public void update()
    {
        this.myField = "bar";
    
        next update();
    }
        
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mrsalonen