Monday, August 26, 2024

Business events

 Scenario:-In this blog I will show you how to share json data from d365fo to mail by using business events

Step1:-First of open logic app and add a trigger point fin & ops then choose when a bussinesseventOccurs trigger

Note:-Save the trigger.

Step2:-Whenever we save the trigger in azure a new endpoint will be added in business event catalog in d365fo

Step3:-Go to Purchase order confirmed business events and download payload for future references

Step4:-Use parse json in logic apps as json data which ever we received can't be use directly

Step5:-Now use fin & ops connector and choose list items present in table connector 

Note:- we use this connector because we can't get entire data in business events because firing time and load may effects. This is why we use list items present in table connector .its a OData query again

Step6:-Take foreach loop and choose line data now by passing enough filters and cross query true

Step7:-now use data operations and choose select for map tabular data

Step8:-Compose output and send to mail

Step9:-Now open d365fo create a purchase order and confirm the purchase order

Step10:-Open mail and check for new message



Keep Daxing!!

Friday, August 23, 2024

Byod integration with d365fo to make powerbi dashboards

 Scenario:- I need to use Byod and send dataset to powerbi and make dashboard for analyzing of data

Step1:-Go to Azure and search for azuresql 

Step2:-Click on azuresql yow will navigate to page shown as below

Step3:-Click on create and fill all necessary details by choosing sql databases then resource group, subscription

and server name ,passwords as shown in image below

Step4:-Once deployment finishes go to resources then in overview page set firewall and allow selected networks



Step5:-Under settings>connections strings copy sql ado.net connector connection string

Step6:-Go to d365fo and open Datamangement choose configure entity export to database

Step7:-create new by giving a new unique name and give connection here and validate .On successful validation you will get a confirmation message

Step8:-click on Publish then you need to choose entity and after publish you will get a confirmation message in notifications as shown in below

Step9:-Enable change tracking for entity you choose for future reference in case you want to do incremental push

Step10:-create a export project and choose your recently published name and add.

Step10:-Export the data project

Step11:-After exporting go to azure sql in azure and open query editor and use a select statement and see data whether exported or not

Step12:-Under Power platform section  choose powerbi and click on login

Step13:-Click on the file it will navigate to powerbi desktop application sign in with credentials

Step14:-Click on connect then dataset will be loaded as shown in below

Step15:-create beautiful dashboards for analyzing data 

Step16:-And I have done a best dashboard previously Titanic disaster as shown in below


Note:-In this way you can convert d365fo tabular data into pictorial representation of data by Powerbi.


Keep Daxing!!


Thursday, August 22, 2024

Export Package Api through postman

 Scenario:-Export data package through postman

Step1:-Create a data export in d365fo 

Step2:-Open postman generate bearer token by giving all credentials

Get :-https://login.microsoftonline.com/tenantid/oauth2/token 

 

Body:- formdata 

 

a) tenant_id  

b) client_id –  

c) client_secret –  
d) grant_type – client_credentials 
e) resource – enter D365FO environment URL (note it should not end with /) 

 

Output:- 

{ 

    "token_type""Bearer", 

    "expires_in""3599", 

    "ext_expires_in""3599", 

    "expires_on""1723463000", 

    "not_before""1723459100", 

    "access_token""eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IktRMnRBY3JFN2xCYVZWR0JtYzVGb2JnZEpvNCIsImtpZCI6IktRMnRBY3JFN2xCYVZWR0JtYzVGb2JnZEpvNCJ9.eyJhdWQiOiJodHRwczovL3RyaWFsLXpwZ3l2ay50cmlhbC5vcGVyYXRpb25zLmR5bmFtaWNzLmNvbS8iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC9jYTA2YTExMC1mYzMwLTQ3ZTUtOWRkNC03MThkNWQ0YzQyNDQvIiwiaWF0IjoxNzIzNDU5MTAwLCJuYmYiOjE3MjM0NTkxMDAsImV4cCI6MTcyMzQ2MzAwMCwiYWlvIjoiRTJkZ1lEaW5WelN6T2o1LzZaSHN2Y212UHA0eEFnQT0iLCJhcHBpZCI6IjQ5ZjAxNWI5LWQ1MzMtNDdlNi1iYTI2LTc3MGZlMTU3Y2NjMyIsImFwcGlkYWNyIjoiMSIsImlkcCI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0L2NhMDZhMTEwLWZjMzAtNDdlNS05ZGQ0LTcxOGQ1ZDRjNDI0NC8iLCJpZHR5cCI6ImFwcCIsIm9pZCI6IjYyNGE1MDBiLTk3ODItNDk1ZC1hMWQ1LTc4YTNkYTg2MTg2OSIsInJoIjoiMC5BU29BRUtFR3lqRDg1VWVkMUhHTlhVeENSQlVBQUFBQUFBQUF3QUFBQUFBQUFBQXFBQUEuIiwic3ViIjoiNjI0YTUwMGItOTc4Mi00OTVkLWExZDUtNzhhM2RhODYxODY5IiwidGlkIjoiY2EwNmExMTAtZmMzMC00N2U1LTlkZDQtNzE4ZDVkNGM0MjQ0IiwidXRpIjoiZXdQWWU3S2hoVXllS0dURGgtS1VBQSIsInZlciI6IjEuMCIsInhtc19pZHJlbCI6IjcgMiJ9.kNDAndZRZgwN-78gPl3aSHW-A7am5hSALHrqDJpwJBITgXePf2BtbqkyMYV6H_T_vlCp2nCymEFrSbJJFihGQ1f5xiuth9vjLasSm1sH5mK2Gr8t7Y78YEdjYnABI0NIIrHBug__aEGdB-eAd7zBmI_rZ9f1ca4UBHxlrjskZCB6hoEjO44v0_eisWTwU5o6no6GI8ZrpAbDiNkqpiZMwwfh6JJfm9SQwq1k_rTFhyGQ8lg19zofxy4l29IMw4-kwTqQYN5_JeEiZCxVbsJ2WjUJpLzKNpabyDe859Vr9HQe1MwSAZHfgvvPF3020po9hrhznewHkOGmKKOGZyzrNQ" 

} 

Step3:-Use import from package and export package and in authorization choose bearer token and give token which generated in previous step

Post:-https://trial-cgxwlr.trial.operations.dynamics.com/data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.ExportToPackage

Body:-

{
    "definitionGroupId":"DaxExport",
    "packageName":"myfile.zip",
    "executionId":"",
    "reExecute":true,
    "legalEntityId":"usmf"
}

Step4:-Now use exportpackageurl Api to get datapackageurl and in authorization choose bearer token and give token which generated in previous step 

Note:-Pass exeution id in body from the previous response

Post:-https://trial-cgxwlr.trial.operations.dynamics.com/data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.GetExportedPackageUrl

Body:-

{

"executionId":"ExportPackage-8/22/2024 12:29:13 pm"

}

Step5:-Paste  the URL which is generated in previous step response in browser and enter a file will be downloaded

Step6:-You can see  downloaded zip Data Package in local desktop

Step7:-Open file a see the data

Keep Daxing!!





Package import api through postman

 Scenario:-Importing a data package through postman

Step1:-Create a import project in d365fo 

Note:- Add a Sample file in add file section

Step2:-Go to postman generate bearer token 

Get :-https://login.microsoftonline.com/tenantid/oauth2/token 

 

Body:- formdata 

 

a) tenant_id  

b) client_id –  

c) client_secret –  
d) grant_type – client_credentials 
e) resource – enter D365FO environment URL (note it should not end with /) 

 

Output:- 

{ 

    "token_type""Bearer", 

    "expires_in""3599", 

    "ext_expires_in""3599", 

    "expires_on""1723463000", 

    "not_before""1723459100", 

    "access_token""eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IktRMnRBY3JFN2xCYVZWR0JtYzVGb2JnZEpvNCIsImtpZCI6IktRMnRBY3JFN2xCYVZWR0JtYzVGb2JnZEpvNCJ9.eyJhdWQiOiJodHRwczovL3RyaWFsLXpwZ3l2ay50cmlhbC5vcGVyYXRpb25zLmR5bmFtaWNzLmNvbS8iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC9jYTA2YTExMC1mYzMwLTQ3ZTUtOWRkNC03MThkNWQ0YzQyNDQvIiwiaWF0IjoxNzIzNDU5MTAwLCJuYmYiOjE3MjM0NTkxMDAsImV4cCI6MTcyMzQ2MzAwMCwiYWlvIjoiRTJkZ1lEaW5WelN6T2o1LzZaSHN2Y212UHA0eEFnQT0iLCJhcHBpZCI6IjQ5ZjAxNWI5LWQ1MzMtNDdlNi1iYTI2LTc3MGZlMTU3Y2NjMyIsImFwcGlkYWNyIjoiMSIsImlkcCI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0L2NhMDZhMTEwLWZjMzAtNDdlNS05ZGQ0LTcxOGQ1ZDRjNDI0NC8iLCJpZHR5cCI6ImFwcCIsIm9pZCI6IjYyNGE1MDBiLTk3ODItNDk1ZC1hMWQ1LTc4YTNkYTg2MTg2OSIsInJoIjoiMC5BU29BRUtFR3lqRDg1VWVkMUhHTlhVeENSQlVBQUFBQUFBQUF3QUFBQUFBQUFBQXFBQUEuIiwic3ViIjoiNjI0YTUwMGItOTc4Mi00OTVkLWExZDUtNzhhM2RhODYxODY5IiwidGlkIjoiY2EwNmExMTAtZmMzMC00N2U1LTlkZDQtNzE4ZDVkNGM0MjQ0IiwidXRpIjoiZXdQWWU3S2hoVXllS0dURGgtS1VBQSIsInZlciI6IjEuMCIsInhtc19pZHJlbCI6IjcgMiJ9.kNDAndZRZgwN-78gPl3aSHW-A7am5hSALHrqDJpwJBITgXePf2BtbqkyMYV6H_T_vlCp2nCymEFrSbJJFihGQ1f5xiuth9vjLasSm1sH5mK2Gr8t7Y78YEdjYnABI0NIIrHBug__aEGdB-eAd7zBmI_rZ9f1ca4UBHxlrjskZCB6hoEjO44v0_eisWTwU5o6no6GI8ZrpAbDiNkqpiZMwwfh6JJfm9SQwq1k_rTFhyGQ8lg19zofxy4l29IMw4-kwTqQYN5_JeEiZCxVbsJ2WjUJpLzKNpabyDe859Vr9HQe1MwSAZHfgvvPF3020po9hrhznewHkOGmKKOGZyzrNQ" 

} 

Step3:-Now use getazurewriteurl Api to get a URL path to store file

Post :-https://trial-zpgyvk.trial.operations.dynamics.com/data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.GetAzureWriteUrl

Body:-

{
    "uniqueFileName":"mani"
}
In authorization choose bearer token and give bearer token which is generated in previous step

Step4:-In response you will get a URL link generated paste this URL in next request

Put:-https://trlzpgyvkzjh1xw76.blob.core.windows.net/dmf/mani?sv=2018-03-28&sr=b&sig=A060QGzIDoohhx0zpe50yJp%2FXBtbyMcjPWgFZGi63wQ%3D&st=2024-08-22T06%3A57%3A00Z&se=2024-08-22T07%3A32%3A00Z&sp=rw

Note:- In headers add x-ms-blob-type -BlockBlob

In body in binary upload file

after send request you will just created message with no content

Step5:-Now use import from package URL

Post:-https://trial-zpgyvk.trial.operations.dynamics.com/data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.ImportFromPackage

Body:-

{
    "packageUrl":"https://trlzpgyvkzjh1xw76.blob.core.windows.net/dmf/mani?sv=2018-03-28&sr=b&sig=A060QGzIDoohhx0zpe50yJp%2FXBtbyMcjPWgFZGi63wQ%3D&st=2024-08-22T06%3A57%3A00Z&se=2024-08-22T07%3A32%3A00Z&sp=rw",
    "definitionGroupId":"thursdayimportproject",
    "executionId":"",
    "execute":true,
    "overwrite":true,
    "legalEntityId":"USMF"
}
Note :- In authorization choose bearer token and paste bearer token and In headers add
1)x-ms-blob-type -BlockBlob
2)Authorization -long generated bearertoken

Once you send request go to d365fo and see new records inserted or not

Step6:-Open d365fo and go to customer groups

Keep Daxing!!





Upload File from local system in a form

 Actions to be done at 3 stages  1) Create Fileupload item by right clicking on design as shown in image below 2)Change Properties especiall...