Showing posts with label CRM 2016/Dynamics 365. Show all posts
Showing posts with label CRM 2016/Dynamics 365. Show all posts

Wednesday, 11 September 2019

Retrieve Cases associated with Contacts and Accounts in one go

Hi Everyone,

Today I was working on some work and got a requirement to get Cases of linked with Account and Contact. 

In a normal scenario, we can always do two Calls like 

Cases where CustomerID = Account GUID and 
Cases where CustomerID = Contact GUID

Somehow, I didn't like this approach of making two calls. Spending sometime helped to reduce a call and I was able to retrieve Cases related to Account and Contact in one call.

Here is the FetchXML I have used and uitype plays a major role here.

            <fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
                                      <entity name='incident'>
                                        <attribute name='title' />
                                        <attribute name='ticketnumber' />
                                        <attribute name='createdon' />
                                        <attribute name='incidentid' />
                                        <attribute name='caseorigincode' />
                                        <order attribute='title' descending='false' />
                                        <filter type='and'>
                                          <condition attribute='customerid' operator='in'>
                                            <value uitype='account'>{ACCOUNT-GUID}</value>
                                            <value uitype='contact'>{Contact-GUID}</value>
                                          </condition>
                                        </filter>
                                     </entity>
                                    </fetch>

Hope this helps.

--
Happy CRM'ing
Gopinath

Sunday, 4 June 2017

Workflow must be in Published State

Hi,

Suddenly, today our CRM instance starts showing below error on save of Lead record. We are pretty sure that there is no new changes on the Lead entity.

"Workflow must be in Published State"

After some analysis, checked the workflow error and it says some issue with SLA. We have a SLA on the Lead, I have de-activated and activated the same and able to save the record.


[Microsoft.Crm.Service.GlobalSlaPlugin: Microsoft.Crm.Service.GlobalSlaPlugin.SlaPostCreatePlugin]
[554f5c53-1941-e711-8129-c4346bad9624: ObjectModel Implementation]


Fix - De-activating and Activating the SLA configured on the repective entity fixes the issue.

Hope this helps.

--
Happy CRM'ing

Gopinath