Quantcast
Channel: Microsoft Dynamics CRM
Viewing all 154803 articles
Browse latest View live

Forum Post: RE: JScript to Show/Hide Sections on a form based on an Option Set value - troubleshoot

$
0
0
So, you can get away with declaring dealStage before formContext?!

Forum Post: RE: JScript to Show/Hide Sections on a form based on an Option Set value - troubleshoot

$
0
0
Thanks Andrew. I implemented this onLoad of form and OnChange of Deal Stage, passing execution for each, and it did not work. Still same error. Should dealStage be moved up?

Forum Post: RE: JScript to Show/Hide Sections on a form based on an Option Set value - troubleshoot

$
0
0
Can you please provide a screenshot where you register handler?

Forum Post: RE: JScript to Show/Hide Sections on a form based on an Option Set value - troubleshoot

$
0
0
Sure thing. Here you go. Web Resource: JScript: function ShowHideDocAttachmentSections(ExecutionContext) { var dealStage = formContext.getAttribute("lennar_dealstage").getValue(); var formContext = context.getFormContext(); var docTab = formContext.ui.tabs.get("tab_12"); if (dealStage != 531180000) { formContext.ui.sections.get("tab_12_section_6").setVisible(true); } else { formContext.ui.sections.get("tab_12_section_6").setVisible(false); } if (dealStage != 531180001) { formContext.ui.sections.get("tab_12_section_7").setVisible(true); } else { formContext.ui.sections.get("tab_12_section_7").setVisible(false); } if (dealStage != 531180002) { formContext.ui.sections.get("tab_12_section_8").setVisible(true); } else { formContext.ui.sections.get("tab_12_section_8").setVisible(false); } if (dealStage != 531180004) { formContext.ui.sections.get("tab_12_section_9").setVisible(true); } else { formContext.ui.sections.get("tab_12_section_9").setVisible(false); } } Form / Handlers: OnLoad: OnChange: Basically the form is calling the ShowHideDocAttachmentSections from the lennar_visibilityofDocAttachSections JScript web resource... Hope this helps. Thanks again.

Forum Post: RE: D365 SSRS report in Visual Studio 2017

$
0
0
Hello, You were told right. I have heard nothing regarding support of newer versions of VS than 2015. To develop reports for Dynamics you need an extension "Report Authoring Extension" and at the moment highest supported version is 2015. It is written here - www.microsoft.com/.../details.aspx

Forum Post: RE: JScript to Show/Hide Sections on a form based on an Option Set value - troubleshoot

$
0
0
I updated the script in my initial reply. Can you please use updated version of code?

Forum Post: RE: JScript to Show/Hide Sections on a form based on an Option Set value - troubleshoot

$
0
0
Also on your "OnLoad" configuration screenshot I see that other library is referenced for "handler" - "Sales/Opportunity...". Doublecheck that you use the correct library in registration. Don't forget to save and publish changes.

Forum Post: Add/Remove Marketing List Members using Microsoft Flow

$
0
0
Just wanted to share this flow with everyone after several hours of trial and error with Microsoft Flow. How to use microsoft flow to add and remove members to a static marketing list. To add a record to the marketing list, use the Common Data Service (Current Environment) connector and select "Perform a bound action". In the details of your bound action: There might be a long delay for the flow connector to retrieve a list of the actions. Be patient! Entity Name: Marketing List Action Name: Add Member List Item ID: GUID of the marketing list Entity ID: GUID of the record to add to marketing list (e.g. contact) To remove a record from the marketing list, use the Common Data Service (Current Environment) connector and select "Perform a bound action". In the details of your bound action: Entity Name: Marketing List Action Name: RemoveMemberList Item ID: GUID of the marketing list listmemberid: GUID of the record value (e.g. contact)

Forum Post: RE: JScript to Show/Hide Sections on a form based on an Option Set value - troubleshoot

$
0
0
Thanks again. Updated the JScript in the web resource and made sure OnLoad was correct. Save and Publish as usual. I now get a 'Cannot read property 'get' of undefined. Is this due to line 3 being 'getFormContext' instead of 'getformContext'? TypeError: Cannot read property 'get' of undefined at ShowHideDocAttachmentSections ( lennardev.crm.dynamics.com/.../lennar_VisibilityofDocAttachSections:19:25) at cp.executeFunction ( lennardev.crm.dynamics.com/.../app.js at cp.execute ( lennardev.crm.dynamics.com/.../app.js at rp._executeIndividualEvent ( lennardev.crm.dynamics.com/.../app.js at rp._executeEventHandler ( lennardev.crm.dynamics.com/.../app.js at Object.execute ( lennardev.crm.dynamics.com/.../app.js at S._executeSyncAction ( lennardev.crm.dynamics.com/.../app.js at S._executeSync ( lennardev.crm.dynamics.com/.../app.js at S.executeAction ( lennardev.crm.dynamics.com/.../app.js at t.dispatch ( lennardev.crm.dynamics.com/.../app.js

Forum Post: RE: JScript to Show/Hide Sections on a form based on an Option Set value - troubleshoot

$
0
0
Make sure you wrote correct section and tab name in your code.

Forum Post: JS: Reference Error

$
0
0
Hello Everyone, I wrote a js to hide the lookup field on the form if the user is not System Admin . After saving it is throwing the reference error Error: ReferenceError: 'OnLoad' is undefined at eval code (eval code:1:1) at RunHandlerInternal ( xxxxxx.dynamics.com/.../ClientApiWrapper.aspx at RunHandlers ( xxxxxxx.dynamics.com/.../ClientApiWrapper.aspx at OnScriptTagLoaded ( xxxxxxxx.dynamics.com/.../ClientApiWrapper.aspx at Anonymous function (https://xxxxxxxxx.dynamics.com/form/ClientApiWrapper.aspx?ver=-202171222:244:1) JS script: function OnLoad() { if (UserHasRole("System Administrator") { Xrm.Page.ui.controls.get("field_name").setVisible(true); } else { Xrm.Page.ui.controls.get(" field_name ").setVisible(false); } } function UserHasRole(RoleName) { var currentUserRoles = Xrm.Page.context.getUserRoles(); for (var i = 0; i < currentUserRoles.length; i++) { var userRoleId = currentUserRoles[i]; var userRoleName = GetRoleName(userRoleId); if (userRoleName == RoleName) { return true; } } return false; } function GetRoleName(roleId) { var serverUrl = location.protocol + "//" + location.host + "/" + Xrm.Page.context.getOrgUniqueName(); var odataSelect = serverUrl + "/XRMServices/2011/OrganizationData.svc" + "/" + "RoleSet?$filter=RoleId eq guid'" + roleId + "'"; var roleName = null; $.ajax( { type: "GET", async: false, contentType: "application/json; charset=utf-8", datatype: "json", url: odataSelect, beforeSend: function (XMLHttpRequest) { XMLHttpRequest.setRequestHeader("Accept", "application/json"); }, success: function (data, textStatus, XmlHttpRequest) { roleName = data.d.results[0].Name; }, error: function (XmlHttpRequest, textStatus, errorThrown) { alert('OData Select Failed: ' + textStatus + errorThrown + odataSelect); } } ); return roleName; } Please help me to resolve the error Thanks In Advance

Forum Post: View custom fields of the Email Activity in the Outlook app

$
0
0
Hello, I've created a custom field, a case entity lookup on the Email Activity form of Dynamics CRM 365. Is it possible to see this field in the Outlook app?

Blog Post: Associate and Disassociate Records using C# Code - Dynamics CRM/365

$
0
0
Hi Everyone, This might be a old one but somehow I could not get this piece code very easily. Here is the piece of C# code for Associating and Dissociating two records with N:N relationship. Associate string relationshipName = " >" ; Relationship relationship = new Relationship(relationshipName); EntityReferenceCollection relatedEntities = new EntityReferenceCollection(); EntityReference secondaryEntity = new EntityReference( "SecondEntitySchemaName" , GUIDOfSecondEntityRecord); relatedEntities.Add(secondaryEntity); crmService.Associate( "FirstEntitySchemaName" , GUIDOfFirstEntityRecord, relationship, relatedEntities); Disassociate string relationshipName = " >" ; Relationship relationship = new Relationship(relationshipName); EntityReferenceCollection relatedEntities = new EntityReferenceCollection(); EntityReference secondaryEntity = new EntityReference( "SecondEntitySchemaName" , GUIDOfSecondEntityRecord); relatedEntities.Add(secondaryEntity); crmService. Disassociate ( "FirstEntitySchemaName" , GUIDOfFirstEntityRecord, relationship, relatedEntities); Hope this helps. -- Happy 365'ing Gopinath

Forum Post: RE: Add/Remove Marketing List Members using Microsoft Flow

$
0
0
Thanks Antheny for the kindly sharing.

Forum Post: Parent account should be copied as child entity

$
0
0
help me with this, Add key account category in account and attach non key account to key account this relationship like parent child relationship. In account we should add child account sub grid same like Account enity Thank you

Forum Post: RE: JS: Reference Error

$
0
0
Hi Bhavya, I don't know which version CRM do you have but please try following code Onload event. function CheckUserRole() { var _roleQuery = ''; var currentUserRoles = Xrm.Page.context.getUserRoles(); for (var i = 0; i < currentUserRoles.length; i++) { if (i == 0) _roleQuery += 'roleid eq ' + currentUserRoles[i]; else _roleQuery += ' or roleid eq ' + currentUserRoles[i]; } var req = new XMLHttpRequest(); req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.1/roles?$select=name" + '&$filter=' + _roleQuery, true); req.setRequestHeader("OData-MaxVersion", "4.0"); req.setRequestHeader("OData-Version", "4.0"); req.setRequestHeader("Accept", "application/json"); req.setRequestHeader("Content-Type", "application/json; charset=utf-8"); req.setRequestHeader("Prefer", "odata.include-annotations=\"*\""); req.onreadystatechange = function () { if (this.readyState === 4) { req.onreadystatechange = null; if (this.status === 200) { var results = JSON.parse(this.response); for (var i = 0; i < results.value.length; i++) { var roleName = results.value[i]["name"]; if (roleName == "System Administrator") { ///perform a task in your case if (UserHasRole("System Administrator") { Xrm.Page.ui.controls.get("field_name").setVisible(true); } else { Xrm.Page.ui.controls.get("field_name").setVisible(false); } } } } else { alert(this.statusText); } } }; req.send(); }

Forum Post: In a managed Solutions i want users can edit the data but cannot delete

$
0
0
I have a managed solution, in that i want to allow edit data but not delete. how can i achieve this please help

Forum Post: Changing Field data type from singel line of text to multiline text

$
0
0
I have a managed solution deployed in customer place, we had a "Single Line text" field in a custom entity, now we want to change the field type to "Multi line text" due to character limit. how can we achieve this, without effect on schema Please help

Forum Post: RE: Changing Field data type from singel line of text to multiline text

$
0
0
Hi, You cannot change the type of field after its creation.there is only one way is to create new field.

Forum Post: RE: Changing Field data type from singel line of text to multiline text

$
0
0
Yes, there is no way to change the data type of a field once it is created. Only solution is to create a new field.
Viewing all 154803 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>