Friday, September 23, 2016

Refresh form A from Form B or by button through X++

Requirement :- Some time we need to switch from a form to another form and have to update delete or create data which will effect the main form also. But the issue we mostly face that the calling form couldn't refresh the data without refresh. Write the below line with your logic can achieve the same.


void clicked()
{
    FormRun                         formRun;
    #task
    super();
    formRun = element.args().caller(); // will hold the calling form buffer

   /* write your Logic here  to execute  in Form B or Form A */


//Write the below code for refresh your calling form A
    if(formRun)
    {
        formRun.task(#taskF5);
    }
}

Thursday, September 1, 2016

Execute Stored Procedure from X++ code

To execute a stored procedure from X++ use the Server method, the Client method does not have permissions. Following is the screen shot of the code from Server method. you don't require any special privileges or permissions to execute a stored procedure. if used other then Server method, a message should appear like this 'Request for the permission of type 'SqlStatementExecutePermission' failed.'


create a job and write the above code as shown in the image.
When creating a table from AOT in Dynamics AX, developers often forget to right click and save the table, specially the developers habituated to SQL Server. There could be column names conflict if not saved in AOT and eventually the changes might be lost and cause other problems.
Note : If creating a table from AOT in Dynamics AX then there will be couple of default columns added to your table like RECIDRECVERSIONDATAAREAID and etc. Make sure to include and insert values into those fields.

Conversion of Disposition code, code was not specified - Error in D365 F&O for inter company purchase order return

 We crated the return order for inter company purchase order  and created a Item Arrival Journal through Arrival Overview in corresponding c...