How to Write Display Method in d365

 Important:


*****

The Limitation of  display Method is that the value cannot be edited. 



Display method is used to concatenate the same data types like integers,strings etc



1.create a EDT type (could be string or integer based on the concatenation type (integer,string))


2. click on the table where you want to write the display method


3.right click on the table methods and click on new method


4. copy the following code


 public display TotalMatches sports()

    {

        TotalMatches Tot;



        Tot=str2Int(this.Lost)+str2Int(this.Won);


        return Tot;


    }

   

             

                or



copy the following code:



public display VenProgramId vendorProgramId(){

return ProgramVendorDealerNameTable::find(this.ProgramDealerName, this.ProgramVendorName).VendProgramId;

}



5. after this go to form where you want to use this method


6. right click on form grid and create a field based on the EDT type


7. after creating the field go to field properties


8. give 1. datasource name and 2. data method


In this way we can add display method to a form in d365.


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