Posts

Create D365 Post entity record

  var record = {}; record["regardingobjectid_contact@odata.bind"] = "/contacts(ff072662-ef61-e511-93fc-000d3ab14dd2)";   //record["regardingobjectid_new_customerregistration@odata.bind"] = "/bupa_customerregistrations(910e6373-0c2f-eb11-a813-000d3a219518)";  //for custom entity record["text"] = "Customer Registration record linked success"; // Text record["source"] = 2; // Choice record["type"] = 2; // Choice Xrm.WebApi.createRecord("post", record).then( function success(result) { var newId = result.id; console.log(newId);         alert(newId) }, function(error) {         console.log(error.message);          alert(error.message) } );

Dynamics CE/Dynamics 365 default site map missing

Image
       Sometimes, the Default site map might be missing from your Dynamics CE(9+ version) online trail version. This was happened to me while I was creating my trail instance in the month of Aug-2021. Resolution:      Once we open the default site map, we can see missing modules (ex: Sales, Service and marketing). In order to get the same, go to More actions drop down and select ‘Reset Dynamics 365(8.2) SiteMap to default’ as below Now you will be able to see the default site map.

Plug in execution process in PreValidation & PreOpeation & PostOperation in D365

Image
what if a plug in is registered on create message and with all the PreValidation , PreOperation and PostOperation what will happen if one got failed. Below are the use cases for reference. Account->Create PreValidationAccountCreate         Task Creation PreOperaionAccountCreate         Task Creation PostOperationAccountCrate              Task Creation Below all scenarios I  am trying to create a Task record. Scenario :1 If exception happening in PreValidationAccountCreate before any CRUD operation. Account record will not create in this case           ->PreValidationAccountCreate will trigger and will throw exception. It shows the trace log in plug in tracelog         ->PreOperationAccountCreate will not trigger, and it will not show in plug in Trace log         ->PostOperationAccountCrate will not trigger, and it will not show in plug in Trace log Scenario :2 If exception happening in PreValidationAccountCreate after any CRUD operation is done. Account record

How to get field name from previous step using expression in Power flow or Microsoft Flow

Image
  How to get field Name from previous step by using Expression when we use GetRecordByID trigger in power flow: There is no direct option in Power flow to get all columns or selected columns when we are triggering the flow from OOB button click. Ie “When a record is selected” trigger. Output from the above trigger. Click on “Show raw output” . This option you will get once the flow was run. Below we can see only “accountid” field from in the Output window below. But we can achieve it using another way. 1.        Create a “When a record is selected” trigger 1.        Add another action “Get Record By ID” from dataverse. Here I have selected name and emailaddress1 column. 1.        Take another action “Variable”. Declare it as “AccountName”. Here I want to capture the account record “name” field using expression. For that I need to use below expression. Body(‘GetRecordByID’)[‘name’] Here “GetRecordByID” I my previous action name which is highlighted in below picture in yellow col

How to call Global action using Console application

Image
 We can Global action in any place Ex. This we can execute using Js or we can call this using a console application or we can call this action using plug in. Here it will take input arguments(if you specify in your action) and returns output variable. Action will not execute in below conditions When the action is in Draft state When the action is profiled Hence, once you move or import the solution to the higher instance make sure all the Process will be in Active state. Enough of explanation.... Now Below piece of code to call entity specific action. for establishing the connection in console you can refer this  URL The difference between Entity specific action and global action is, for entity specific action we should add Target attribute where global action it's not required. If you are not specify the Target attribute for entity specific action it will give error(Error: Target attribute is required) Defining global action: Below are two Input attributes: EntityName(Type:string)

How to call Entity specific Action using c#

 We can call Entity specific action in any place Ex. This we can execute using Js or we can call this using a console application or we can call this action using plug in. Here it will take input arguments(if you specify in your action) and returns output variable. Action will not execute in below conditions When the action is in Draft state When the action is profiled Hence, once you move or import the solution to the higher instance make sure all the Process will be in Active state. Enough of explanation.... Now Below piece of code to call entity specific action. for establishing the connection in console you can refer this URL The difference between Entity specific action and global action is, for entity specific action we should add Target attribute where global action it's not required. If you are not specify the Target attribute for entity specific action it will give error(Error: Target attribute is required) In below example we have used 2 input varibales. AccountName (type

Connect Dynamics CE using ClientID and ClientSecret

 /*Connection establishing using ClientID & Client Secret*/ public static void GetConnection()         {             try             {                 string connectionString = "AuthType=ClientSecret; url=REPLACE WITH ORANIZATION URL; ClientId=REPLACE WITH YOUR CLIENT ID; ClientSecret=REPLACE WITH YOUR CLIENT SECRET";                 crmServiceClient = new CrmServiceClient(connectionString); //Connecting to the D-365 CDS instance                 if (crmServiceClient != null && crmServiceClient.IsReady)                 {                     Console.WriteLine("\nConnection successful.");                 }                 else                 {                     Console.WriteLine("\nPlease make sure the Connection String is correct.");                 }             }             catch (Exception ex)             {                 throw new Exception(ex.Message);             }         }