Articles

Affichage des articles associés au libellé CRM

retrieve more than 5 K record

    public static EntityCollection paginationQuery (OrganizationServiceProxy _service, QueryExpression query)         {             int queryCount = 2500;             int pageNumber = 1;             int recordCount = 0;             query.PageInfo = new PagingInfo();             query.PageInfo.Count = queryCount;             query.PageInfo.PageNumber = pageNumber;             query.PageInfo.PagingCookie = null;             EntityCollection fullResult = new EntityCollection();      ...

Decode/render HTML from a field in crm dynamics

In email entity the Hmtl is well decode. but if you want to decode it in other entity, it will not work you will just see the tag everywhere then I propose you to create a webressource and to apply this code. as you can see the field to to decode is hard coded but you can also give it as a webressource parameter. in a old post I explain how to pass value here is the html + javascript <html><head><meta></head> <body onload="onLoad()" onfocusout="parent.setEmailRange();" style="overflow-wrap: break-word;"> <script > function onLoad() { debugger; var para = document.createElement("decodedDescription"); var descriptionHtml = window.parent.Xrm.Page.getAttribute("description").getValue(); para.innerHTML = descriptionHtml; document.getElementById("decodedDescription").appendChild(para); }   </script > <div id="decodedDescription"> </div> </body></ht...

Add clickable button in the form

I do it via webressource <html><head>     <style>       * {                     margin: 0;                     padding: 0;                 }                                 .button{                     background-color: #00B3D9;                     color: #FFFFFF;                     font-family: Segoe UI, Tahoma, Arial;                     font-size: 14px;                     padding: 5px 10px 5px 10px;                   ...

Remap crm user to ActiveDirectory User

I imported an organization and I mapped only system user CRM : 2016 V8.2 OnPremise Then at the end only mapped User can connect To CRM while normal user are still visible in CRM systemUser. To see if they are mapped you can use select * from MSCRM_CONFIG.[dbo].[SystemUserOrganizations] org join SystemUserBase users on (users.SystemUserId = org.CrmUserId) then to remapp normal user I did 1/ disable user + save 2/ change the logon user (I added a s after) + Save 3/ change back the logon by the correct logon user (remove the S) 4 enable the user re do the query, select * from MSCRM_CONFIG.[dbo].[SystemUserOrganizations] org join SystemUserBase users on (users.SystemUserId = org.CrmUserId) you will see the user is mapped

retrieve queue item filtered by object

I had to look for that because when reactivating a case i Hade an error that say that multiple queueitem exist. if you want to retrieve the queue item by case/email/... knowing the guid of the case/email/... here is the query {{webapiurl}} /queueitems?$top=3&$filter=_objectid_value eq BA774537-B561-E911-80E7-005056B22A06 after i retrieve the queue item id and i delete it {{webapiurl}} /queueitems(c7774537-b561-e911-80e7-005056b22a06)

Update Email with web API

when you receive an email and it s wrong resolve because of human or computer you need to correct it. For that i set the email activity in draft with dynamics power pane (chrome extention) and after I apply this in PATCH mode with postMan { "statuscode":4,   "statecode":1,   "email_activity_parties" :  [         {             "partyid_lead@odata.bind" : "/leads(87701058-3C67-E911-80E7-005056B22A06)",             "participationtypemask" : 1         },         {             "partyid_queue@odata.bind" : "/queues(7A5AC7BE-BE0C-E411-8890-AC162DAC65CC)",             "participationtypemask" : 2         }         ] }

Make CRM Faster

it s quite the same logic as here https://www.linkedin.com/pulse/recently-viewed-items-performance-issuebug-ziv-ben-or/ the idea is too clean the historic of recently viewed item   static void Main(string[] args)         {             ConnectToCRM();             var fetchXml = $@" <fetch>   <entity name='userentityuisettings'>     <attribute name='userentityuisettingsid' />     <attribute name='recentlyviewedxml' />     <attribute name = 'lastviewedformxml' />     <filter type='and'>       <condition attribute='recentlyviewedxml' operator='not-null' />     </filter>   </entity> </fetch>";                             string max;             Console.Wr...

How to connect to Crm Dynamics On Premis 2016 with Consol App

private static void ConnectToCRM() { try { string OrganizationURL = ConfigurationManager.AppSettings["OrganizationURL"]; OrganizationURL += "/XRMServices/2011/Organization.svc"; _orgServiceManagement = ServiceConfigurationFactory.CreateManagement<IOrganizationService>(new Uri(OrganizationURL)); ClientCredentials Credentials = new ClientCredentials(); Credentials.Windows.ClientCredential = (NetworkCredential)CredentialCache.DefaultCredentials; _service = new OrganizationServiceProxy(_orgServiceManagement, Credentials); //LogHelper.Info("\r\nConnected to {0}\r\n ", OrganizationURL); WhoAmIRequest req = new WhoAmIRequest(); WhoAmIResponse resp = (WhoAmIResponse)_service.Execute(req); // LogHelper.Info("User ID: " + resp.UserId); //Guid currentUserId = resp.UserId; } catch (Exception ex) { Console.WriteLine(); Console.WriteLine("An error occured trying to connect to the MS CRM Server.\nPlease verify your login data....

CRM Dynamics : Improve Form with Tab Menu

I was wondering how to have all data user need in only one screen. Then I Googled and found this : http://www.itaintboring.com/dynamics-crm/dynamics-crm-creating-navigation-tabs/ I want to always keep Basic Information of the contact/account  we have tabs, and we can collapse it or uncollapse it If we collapse a a tab all the width of the screen is hidded.  Then I decided to try to work with section and not tabs. My idea was to have a Tabs with 3 column and only the column of the middle would be dynamic in link with the tab menu Then I created 1 Tab with 3 column and all the section in the column of the middle have  A name that start by "NavSection_"   The label hidded Are hidded by default unless the first <html><head><meta charset= "utf-8" > <style> * { margin: 0 ; padding: 0 ; } .activeTab { background-...