dynamics-crm-2016

SQL Query get most recent activiy per account (efficient query)

隐身守侯 提交于 2021-01-29 20:09:16
问题 I use MS SQL Server 2016 and try to query the MS Dynamics 2016 on-premise DB efficiently. You don't need special knowledge about Dynamics to answer my problem because it's rather an SQL but a CRM problem. Suppose you have entities FilteredAccounts and FilteredActivities (that's the name in Dynamics View) FilteredActivites have the following columns: accountid name FilteredActivites have the following columns: activityid actualend [DATETIME] regardingobjectid (referring to account) statecode

Not able to delete the system workflow step in MS CRM 2016 on-premise

a 夏天 提交于 2021-01-28 05:05:52
问题 I have created a system workflow and deleted the workflow itself long back. But still the workflow is running. I cannot find it under normal process. But when I do the advanced find for process entity, I can find the workflow. When I am open it there is not delete or deactivate button for it. I tried deleting or deactivating it from the workflow view itself. But it is not allowing me do. Getting the generic error as "Microsoft Dynamics CRM has experienced an error. Reference number for

Get optionset text from OData query in CRM web api

感情迁移 提交于 2021-01-02 13:22:53
问题 https://example.com/crm/api/data/v8.2/accounts?$select=custom_optionset The above query selects all values in an optionset field in CRM. The return data looks something like this: { { "@odata.etag":"W/\"112607639\"","custom_optionset":285960000,"accountid":"a08f0bd1-e2c4-e111-8c9a-00155d0aa573" }, { "@odata.etag":"W/\"112615384\"","custom_optionset":285960010,"accountid":"a18f0bd1-e2c4-e111-8c9a-00155d0aa573" } } I don't want the value of the optionset. I want the associated text label. How

clearoption for optionset in crm business process flow

让人想犯罪 __ 提交于 2020-01-25 03:09:06
问题 I have a business process flow In one of its steps I have added an option set(sub category) I am trying to clear the options in the optionset using the below code Xrm.Page.getControl("new_subcategory").removeOption(100000005) Xrm.Page.getControl("new_subcategory").clearOptions() This removes the options for the optionset that is inside the form, but it is not removing for the same option set that is in the step of business process flow 回答1: You need to added header_process_ to the id. So: Xrm

How to hide a vanilla button according to form state

亡梦爱人 提交于 2020-01-21 12:24:07
问题 I am trying to hide my SAVE vanilla button according to form state. when the form state != create the vanilla button should not display. I tried different things but nothing works: I create a function in js that returns true if form is create state function isHideState(){ formstate = Xrm.Page.ui.getFormType(); if(formstate == formType.create){ return true;} else{ return false;} } I added a disply rule and connected it to my command that relevant to the js function : my rule is : FormStateRule

accessing the logged in CRM user from custom page

岁酱吖の 提交于 2020-01-16 08:40:09
问题 We have Dynamics CRM and a webform which is loaded from the ribbon, essentially inside an iframe. How do we get the logged on user? On the top right, is my name and image as logged in via Active Directory. However, if I do something like: var UserID = window.parent.Xrm.Page.context.getUserId(); or in C#: UserPrincipal user = UserPrincipal.Current; lblUser.Text = user.SamAccountName; then we get the generic user that CRM is configured to use. If I do a right click on the entire form and go

On PREM Dynamics CRM 2016 JavaScript equivalent of my C# QueryExpression

好久不见. 提交于 2020-01-15 08:14:31
问题 I am trying to get the FetchXML query for a specific query expression fro Dynamics CRM. I have manged to do it using the XRM SDK in a C# project as follows. string connectionStr = @"Server=https://mycompany.com/XRMServices/2011/Organization.svc; Username=theUserName; Password=pwd"; Microsoft.Xrm.Client.CrmConnection conn = Microsoft.Xrm.Client.CrmConnection.Parse(connectionStr); var service = new Microsoft.Xrm.Client.CrmOrganizationServiceContext(conn); var query = new QueryExpression();

Dynamics CRM. Fully custom FetchXml in subgrid

房东的猫 提交于 2020-01-11 14:01:31
问题 I'm making a subgrid on account to show all related contacts by multiple fields. Here's fetch xml I'm trying to set: <fetch mapping="logical"> <entity name="contact"> <attribute name="firstname" /> <filter type="or"> <condition attribute="new_behorde" operator="eq" value="" /> <condition attribute="new_behorde2" operator="eq" value="" /> <condition attribute="new_behorde3" operator="eq" value="" /> </filter> </entity> I'm setting this using document.getElementById("contacts").control

Xrm.Utility.openwebresource opens new tab

半城伤御伤魂 提交于 2020-01-04 13:11:43
问题 We have an onprem crm 2016. I'm opening an html webresource on a click of a ribbon button. I'm using Xrm.Utility.openWebResource(...) . The problem with that is we're using IE11 and all users' browsers are configured to let IE decide how to open pop ups. Guess what, IE decides to open a new tab! Is there a way to open an html web resource in a new window without changing the users' browser options? 回答1: Xrm.Utility.openWebResource() performs different in Chrome compared to IE11. Below options

Xrm.Utility.openwebresource opens new tab

空扰寡人 提交于 2020-01-04 13:11:26
问题 We have an onprem crm 2016. I'm opening an html webresource on a click of a ribbon button. I'm using Xrm.Utility.openWebResource(...) . The problem with that is we're using IE11 and all users' browsers are configured to let IE decide how to open pop ups. Guess what, IE decides to open a new tab! Is there a way to open an html web resource in a new window without changing the users' browser options? 回答1: Xrm.Utility.openWebResource() performs different in Chrome compared to IE11. Below options