Saturday, 4 May 2019

chain of command in d 365

create a class 

[ExtensionOf(classStr(SalesLineType))]
final class SalesLineType_Extension
{
    
    
    public void inserting()
    {
       
        CustTable   custTable;
        
        //get customer for evalation of credit rating
        custTable = CustTable::find(salesLine.CustAccount);
 
        if(!custTable.CreditRating)
        {
            info("Customer on sales line has no credit rating!");
        }
 
        // must call next when using Chain of Command pattern
        next inserting();

       
    }

}

first 2 lines are important as it tells it is an extension of which class and suffix should end with _extension

now add sales table form in the project and add as a start up object  and run  the visual studio and once browser is open navigate to new button and create a  new sales order  and save  then the message will pop up  in the screen , you can debug the process also .
by loading the symbols it will take some time to load all the symbols.




No comments:

Post a Comment

intercompany PO multiple product receipt by x++

public void processStampICPO(PackingSlipId _deliveryNote,                             Transdate _deliverydate,                             ...