Monday, April 18, 2022

Supressing/comment infolog in Dynamics 365 FinOps(D365FO)

 [ExtensionOf(classStr(ProjStatusType_ReportedFinished))]

final class ProjStatusType_ReportedFinished_Extension

{

    public boolean journalCheckStatus()

    {

        boolean ret;

        SysInfologLevel sysInfologLevel;


        sysInfologLevel = infolog.infologLevel();

        infolog.setInfoLogLevel(SysInfologLevel::None);


        ret = next journalCheckStatus();


        if(!ret)

        {

            infolog.setInfoLogLevel(sysInfologLevel);

        }

        return checkFailed(strfmt("<MyNewlabel>", projTable.ProjId, projTable.Stage()));

    }


}

Tuesday, February 11, 2020

Microsoft.Dynamics.AX.Xpp.ErrorException was thrown


I was getting the above error while invoicing the sales order. The customer wanted to send the sales invoice as an email on print management. Below is print management setup of sales invoice.


Solution:

The issue was the setup on customer default setup on Accounts receivable/Common/Customers/All customers/Setup tab/print management and Accounts receivable/setup/form setup/print management were same. This was triggering the error. It seems report was getting sent to the customer twice.

Tuesday, June 11, 2019

Testing custom services with POSTMAN

Create a POST type entry and enter below in the search bar.

{{resource}}/api/services/<Service Group>/<Service>/<ServiceMethod>

Testing Custom entities in D365FO using POSTMAN scripts

There is a really good article from Microsoft to configure the POSTMAN to test the custom services in D365FO. However there are some small changes here and there that could help you configure the POSTMAN to work better with D365FO.

Few more links below to understand how POSTMAN scripts can be manipulated to fetch the correct results.

vishwad365fo.blogspot.com/2018/05/custom-service-to-create-sales-order.html

axtoday.blogspot.com/2017/08/accessing-dynamics-365-for-operations_17.html


For me even after following the article from Microsoft I was getting error so I did below changes.

After we have generated the Bearer Token and it is added to your environment. Just go to the Authorization tab and select Bearer Token on the Type field. Also copy and paste the Bearer token to the token field.


On the header tab write below values

Authorization:Bearer{{bearerToken}}
Content-Type:application/json



Body tab must select Raw and select JSON from the drop down.



On the Tests Tab put the following JSON script.

var json = JSON.parse(responseBody);
tests["Get  info"] = !json.error && responseBody !== '' && responseBody !== '{}';