Posts

How to filter regarding entity in dynamic CRM using JavaScript

Image
 //filter regarding function regardingFilter (executionContext)  { var formContext = executionContext.getFormContext(); var regarding = formContext.getControl("regardingobjectid") ? formContext.getControl("regardingobjectid") : null; if (regarding.getEntityTypes().length >= 1)             {                regarding.setEntityTypes(['opportunity']);           }                        } Screenshot:  After filter: Before filter :

Add option set item based on the specific Apps in Dynamic crm

 // Filter field value based on  App  onLoadFilter function(executionContext) {     "use strict";     try{     var formContext = executionContext.getFormContext();     var globalContext = Xrm.Utility.getGlobalContext();     globalContext.getCurrentAppProperties().then(function (object) {         if (object.uniqueName === "App Schema Name") {             var formContext = executionContext.getFormContext();             var optionSetCtrl = formContext.getControl("field schema name");             optionSetCtrl.clearOptions();             optionSetCtrl.addOption({ value: 999999993, text: "A" }, 1);             optionSetCtrl.addOption({ value:  999999994, text: "B" }, 2);             optionSetCtrl.addOption({ value:  999999995, text: "Cr" }, 3);             optionSetCtrl.addOption({ value:  999999996, text: "D" }, 4);             optionSetCtrl.addOption({ value:  999999997, text: "E" }, 5);             optionSetC

How to redirect tab directly in dynamic CRM using JavaScript

Image
Step 1: Go to form properties. Step 2: click on parameter tab. Step 3: Add one parameter like below  var formType = formContext.ui.getFormType();     if (formType === 2) {         if (formContext.data.attributes.get("param_focusCaseTab") !== undefined && formContext.data.attributes.get("param_focusCaseTab").getValue() !== null) {             var param_focusCaseTab = formContext.data.attributes.get("param_focusCaseTab").getValue();             if (param_focusCaseTab === true) {                 formContext.ui.tabs.get("tab_cases").setFocus();             }         }     }

latest dynamics 365 interview questions

Image
Q. How to pass extra value in custom page in power apps? Ans: Generally in pageInput we can define four parameter like  pageType, name, entityName, recordId. But in real senarion if we want to share extra value then we can use in pageInput parameter itself. Example : var pageInput =  { pageType: "custom", name: customPageName, entityName: executionContext.data.entity.getEntityName(), recordId: currentRecordId + "$" + recordName ; }; Above value you can retrieve in custom page onStart function like below : Set(splitParam,Split(Param("recordId"),"$")); Set(recordName,Last(FirstN(splitParam,2)).Value); Set(RecordID, Substitute(Substitute(Last(FirstN(splitParam,1)).Value, "{", ""), "}","")); Q. If I create one record that created record date is older than 3 days then I want to perform some operation with the help of business rule. example: Let's assume I have case entity form and have