Skip to main content

Posts

Showing posts from 2022

loose coupling and tight coupling and in C#

Disable MFA in Dynamics 365 using Azure Active Directory

 

Async/Await in Javascript ||| Callback functions in javascript ||| Callback functions in javascript ||| Promises Basics, Promise.then() & Promise.catch()

  Async/Await in Javascript                            Callback functions in javascript  Promises Basics, Promise.then() & Promise.catch()   

Types of fields in D365 SDK(C#) corresponding to D365 Fields

D365Types of fields in D365 SDK(C#) corresponding to D365 Fields String---------------1.)Single Line of text Picklist-------------2.)Option Set Memo-----------------3.)Multi Select OptionSet Boolean--------------4.)Two OptionSet Integer--------------6.)Whole Number Double---------------7.)Floting Point Number Decimal--------------8.)Decimal Number Money----------------9.)Currency Memo----------------10.)Multipal Line of Text DateTime------------11.)Date and Time Lookup--------------12.)Loopkup Customer------------13.)Customer

How to open a create record form in new tab using JS

    // Info of child entity     var entityFormOptions = {};     entityFormOptions [ "entityName" ] = "cr1a2_class" ;     entityFormOptions [ "useQuickCreateForm" ] = true ;     entityFormOptions [ "openInNewWindow" ] = true ;     // Info of parent entity     var formParameters = {};     formParameters [ "new_classesid" ] = Xrm . Page . data . entity . getId ();     formParameters [ "new_classesidname" ] = Xrm . Page . getAttribute ( "name" ). getValue ();     formParameters [ "new_classesidtype" ] = "account" ;     // Open form in new window     Xrm . Navigation . openForm ( entityFormOptions , formParameters ). then (         function ( lookup ) {             console . log ( "Success" ); a         },         function ( error ) { console . log ( "Error" ); }     );

Retrieve, Associate, Disassociate N:N Related Records using C#

 URL retrieve QueryExpression query = new QueryExpression("list"); //Name of the entity to be passed whose records need to be retrieved var nIsToNRelationshipName="cdi_emailsend_suppressed_list"; //schema name of N:N relationship query.ColumnSet = new ColumnSet(true); var link = query.AddLink(nIsToNRelationshipName, "listid", "listid"); //Method Signature: AddLink("N:N schema name to be passed", "Primary key ID schema name of entity record to be retrieved", "schema name of attribute in the N:N relationship") Guid emailSendID = new Guid("79121c07-220e-41ae-9710-96b880973e6c"); //sample ID of Email Send record for which we are retrieving related records link.LinkCriteria = new FilterExpression() { Conditions = { new ConditionExpression("cdi_emailsendid", ConditionOperator.Equal, emailSendID) // Filter condition to get related marketing lists of an Email Send record } };   EntityCollection collRecord

How to call Web API and Get Data from dataverse in Power Apps Portal

Hi, the following is the steps to set up web API for Portal   1.) Enable Web API for a particular Table that you want to access by creating a site setting   eg- 2.) specify which field you want to access by this site setting eg- 3.) create Table Permission for the table, set  Privileges, and set  Web Roles eg- 4.)Use the following code to access data  var deferredAjax = $ . Deferred ();     var ajaxOptions ;     shell . getTokenDeferred (). done ( function ( token ){         debugger ;         alert ( "pass" )       ajaxOptions = {         type: "GET" ,         url: "/_api/msdyn_functionallocations?$select=msdyn_name&$filter=_trbdn_customerid_value eq XXXXXXXX-xxxx-xxxx-xxxx-xxxxxxxxxxxx and statecode eq 0" ,         contentType: "application/json" ,         headers: { "__RequestVerificationToken" : token }       };       // ajaxOptions.headers["__RequestVerificationToken"] = token;         $ . ajax ( ajaxOptions ).

read value from cookie

function readCookie(cname) { var name = cname + "="; var decoded_cookie = decodeURIComponent(document.cookie); var carr = decoded_cookie.split(';'); for(var i=0; i<carr.length;i++){ var c = carr[i]; while(c.charAt(0)==' '){ c=c.substring(1); } if(c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; }

setCookie function

let username = 'Max Brown'; // Set a Cookie function setCookie(cName, cValue, expDays) { let date = new Date(); date.setTime(date.getTime() + (expDays * 24 * 60 * 60 * 1000)); const expires = "expires=" + date.toUTCString(); document.cookie = cName + "=" + cValue + "; " + expires + "; path=/"; } // Apply setCookie setCookie('username', username, 30);