Category Archives: Tips & Tricks

Upload & Read JSON File from Local Folder

Breaking Changes in ArduinoJson 6.0 - Wia Community

Requirement:

Customer has saved some JSON files in local folder of laptop or server or drive. Customer wants upload the JSON files from local drive to microsoft Dynamics 365 finance and operations for further business process. A dialog will open in Microsoft D365 fin & ops, customer will select JSON files and import.

Continue reading Upload & Read JSON File from Local Folder

D365 FO:Catch exceptions & Inner exceptions thrown from CLR objects Using ClrInterop & X++

Exception Handling in Java | Java Exceptions - javatpoint

In Microsoft Dynamics 365 for finance and operations, when you use .Net assemblies or classes it is important that you code should handle & capture & catch all the .Net inner exceptions.

Validation for numeric values in String using X++ & strKeep() in D365 FO

Requirement

VALIDATION FOR NUMERIC VALUES IN STRING USING X++ & STRKEEP FUNCTION IN Microsoft Dynamics 365 finance & operations.

Missing module(s):The selected package is missing the following modules that are currently deployed on your environment

Error- During the package deployment or applying VSTS/DevOps build package in UAT or Production , below error is coming in LCS (Life cycle services

The selected package is missing the following modules that are currently deployed on your environment.
You must create an all in-one deployable package that contains all your code customisations & ISV solutions.More information can be found at the following link:https://go.microsoft.com/fwlink/?linkid=2118104.Missing module(s) [AcxDocumentReports]

D365 FO: Data Entity “onMappingEntityToDataSource” event

Requirement

In Microsoft Dynamics 365 finance and operations, client has an data entity for importing list of customer account into a table.During the time of importing of customer accounts using Data entity, client also want to capture & save values of few fields.

Continue reading D365 FO: Data Entity “onMappingEntityToDataSource” event

THE SUPPLIED SNAPSHOTPOINT IS ON AN INCORRECT SNAPSHOT [SOLVED] – D365 FO/Visual Studio Error/Visual Studio Crash

Issue

“THE SUPPLIED SNAPSHOTPOINT IS ON AN INCORRECT SNAPSHOT” error is coming. Visual studio is also crashing during the time of code editing and development of Microsoft Dynamics 365 finance and operations

Continue reading THE SUPPLIED SNAPSHOTPOINT IS ON AN INCORRECT SNAPSHOT [SOLVED] – D365 FO/Visual Studio Error/Visual Studio Crash

Power Apps ForAll:Copy & Insert Records from One Datasource To Another Datasource

Requirement

Copying & Inserting Records from One Datasource To Another Datasource in Microsoft Power Apps using ForALL & PATCH

Scenario

We have 2 datasources or tables. First datasource “List” is excel & second datasource is a CDS entity “Contacts”. We want to insert or copy records from “List” to CDS entity “Contacts”

Continue reading Power Apps ForAll:Copy & Insert Records from One Datasource To Another Datasource

D365 FO:JSON Creation & SERIALIZATION Using FormJsonSerializer & X++

Requirement

SON CREATION & SERIALIZATION USING FORMJSONSERIALIZER & X++ in Microsoft Dynamics 365 for finance and operations.

Format Of Output JSON String & Message

{"itemCategory":123456,"itemClassification":"A","itemCode":"ItemXYZ","itemGroup":"ItemGroup","itemname":"ItemXYZ Name","onDate":"/Date(1597363200000)/","Optimized":"Yes","site":"SiteCode"}
Continue reading D365 FO:JSON Creation & SERIALIZATION Using FormJsonSerializer & X++

Execute Actions in ODATA Entities & CALLING IN MICROSOFT Flow/Power Automate/Logic Apps

Requirement –

  1. Developing & adding actions on OData entities of Microsoft Dynamics 365 finance and operations
  2. Consuming and calling Data entity action in Microsoft Flow or Logic Apps Or Microsoft Power Automate

Development-

  • Create or develop a custom data entity. Read More:
  • Add a new method in your custom data entity by using Attribute -SysODataActionAttribute & SysODataCollectionAttribute
[SysODataActionAttribute("demoExecuteActionListParm", true),
        SysODataCollectionAttribute("InventSiteIdList", Types::String),
     SysODataCollectionAttribute("return", Types::String)]
    public str demoExecuteActionListParm(List InventSiteIdList)
    {
				str	siteCommaSeperated;
				List list = new List(Types::String);
				ListEnumerator  ListEnumerator;
				ListEnumerator = InventSiteIdList.getEnumerator();
				while (ListEnumerator.moveNext())
				{
          siteCommaSeperated += strFmt('%1, ', ListEnumerator.current()) ;
				}

				return '200 OK:Testing Of Odata Entity ExecuteAction has been completed!! Values = ' + siteCommaSeperated;
    }
  • Build and synchronize your project
  • Test your flow and get response successfully.

‘RunAs’ function & method in Dynamics 365 Finance & Operations

Introduction:

There are some scenarios in Microsoft Dynamics 365 finance and operations where we need to run X++ program or code or business operation on the behalf of different userId other than current userId.

In my case, my X++ program of D365 finance and operations should always run under the userId- ADMIN . I can use ‘RunAs’ function & method in Dynamics 365 Finance & Operations.

Sample Code:

class AcxSharepointIntegeration
{
    public static container download(container _parms)
    {
        RunAsPermission perm;
        perm = new RunAsPermission("Admin");
        perm.assert();
        Container returncontainer = runAs("Admin", classnum(AcxSharepointIntegeration), "get", _parms);
        CodeAccessPermission::revertAssert();
        return returncontainer;
    }

    public static container get(container _parms)
    {
        container con;
        // Your business Logic
        return   con; 
    }

class AcxSharepointIntegeration
{
public static container download(container _parms)
{
RunAsPermission perm;
perm = new RunAsPermission(“Admin”);
perm.assert();
Container returncontainer = runAs(“Admin”, classnum(AcxSharepointIntegeration), “get”, _parms);
CodeAccessPermission::revertAssert();
return returncontainer;
}

public static container get(container _parms)
{
container con;
// Your business Logic
return con;
}