Posts

Showing posts from July, 2018
Image
X++ Copying a Record Hi guys. This post is written base on the sample code from well-known recipe 'Copying a record' in Microsoft Dynamics AX 2012 Development Cookbook. However I also show some scenarios we might apply this useful technique. Simple copying by .data() and buf2Buf() First, I have table 'SourceA' which looks like as follows: number fieldA fieldB fieldC DLS-1001 syam bbb ccc I copy the above record by this code. static void syamCopy(Args _args) {     Syam syam1, destination;                            syam1 =  Syam  ::find(' DLS-1001 ');          ttsBegin;         destination.data(source);              destination.number = ' DLS-1002 ';         if (!destination.validateWrite())             throw Exception::Error; ...
Image
Double_Clicked on Form Level Record  Will open New Form with Details Of that Line ex: Bank contain account ,accc contains no of transactions 1)Create 2 Tables as show in fig .below 2)Apply Relations 3)  create 2 Forms as per table  4) In Parent Form Write Code in Button Clicked method and Gride MouseDbClicked method should write 5)write code in click method VOID CLICKED() {     ARGS ARGS;     FORMRUN FORMRUN;     SUPER();// KEEP THIS TO CALL SUPER() WHEN OVERRIDING THE CLICKED METHOD     ARGS = NEW ARGS();     //TO LUCH THE FORM     ARGS.NAME("DLSTRANSACTIONDETAILS");     ARGS.RECORD(DLSACCOUNTDETAILS);     FORMRUN = CLASSFACTORY.FORMRUNCLASS(ARGS);     FORMRUN.INIT();     FORMRUN.RUN();     FORMRUN.WAIT(); } Note:set propertie of clicked method Auto Declaration : Yes 6)MouseDbClick Method public int m...
Image
Display Method In Forms create Table Write Code in Table Display EmployeeID getAccountmethod() {     return this.EmployeeID; } Create Form Related TO Table **In Design Node Which field u want to apply display method ..open properties for that field and add this method  getAccountmethod to Data Method Property
Image
Create Student Marks Sheet In AX 012 create Table With Req Fields. 2)and write code in table Level modifiedField Method public void modifiedField(FieldId _fieldId) {     if(this.Techincal1 >=35 && this.Technical2 >=35 && this.ApptitudeTest >=35)     {         this.DLSStatus =DLSStatus::Pass;     }     else     {         this.DLSStatus = DLSStatus::Fail;     }     this.Total = (this.ApptitudeTest+this.Techincal1+this.Technical2);     this.Percentage =((this.Total/300)*100);     if(this.Percentage <=60)     {         this.DLSGrade = DLSGrade::D;     }     else if(this.Percentage >=60 && this.Percentage <=70)     {         this.DLSGrade =DLSGrade::C;     }    ...
Image
Multi Select Records In form Will stored in New Table in clicked method void clicked() {    DLSMultiSelect dLSMultiSelect1;    DLSMultiSelect2 dls1;//New Table     dLSMultiSelect1 =DLSMultiSelect_ds.getFirst(1);     while(dLSMultiSelect1)     {         dls1.Sno = dLSMultiSelect1.Sno;         dls1.Name =dLSMultiSelect1.Name;         dls1.Address =dLSMultiSelect1.Address;         dls1.Salary = dLSMultiSelect1.Salary;         dls1.insert();     }         dLSMultiSelect1 = DLSMultiSelect_ds.getNext();     info("record is inserted"); }