{Observation} Execution context of Real-time workflow

We all know that if we call a child workflow from a parent real-time workflow, it runs in context of that parent workflow but what happens if the trigger for the parent real-time workflow is updated using a custom application outside of CRM?

I had a custom .Net application which used to get values from CRM, send them to SAP and update the return values from SAP back into CRM. The custom application used to trigger as an batch application. There was a real-time workflow configured on update of the fields populated by the .Net application in CRM which internally used to call a child workflow process.

One day issue was reported by the .Net application as “[Microsoft.Xrm.Sdk.OrganizationServiceFault]: This workflow cannot run because one or more child workflows it uses have not been published or have been deleted. Please check the child workflows and try running this workflow again. (Fault Detail is equal to Microsoft.Xrm.Sdk.OrganizationServiceFault).”.

As the .Net application used to update the field which then used to trigger the real-time workflow (configured to run “After”) it was not quite obvious behavior for me. I did know that the child workflow was deactivated but my assumption was that the issue will be logged in system jobs and not in .Net application. I was expecting that .Net application will update the field in CRM, after which the parent real-time workflow will trigger which will try to call a deactivated child workflow and fail.

But after digging a bit it was observed that as the parent workflow was configured as real-time it keeps the context with calling .Net application and returns the error back to .Net application. Due to which the .Net application throw an exception. I’m still not sure why, but this is how it works.

Advertisements

Get a list of all Business Rules from your CRM environment

Referencing to the original post on CRM 2013 from here.

As Business Rules are created for a particular entity, we can see all the business rules that have been created for any particular entity from the entity customization itself.

This is ok when we need to see all the business rules on an entity. But it does not allow us to pull up a list of business rules across the whole system. Sometimes after deploying a solution, we need to check the business rules to make sure they’re activated, or if there are any errors, and we don’t want to have to go through each entity and check these.

As Business Rules are workflows under the hood, we can do an Advanced Find query with filter criteria on Categories as Business Rule (for CRM 2013, it was PBL) to get the list of all business rules in an organization. The result contains Name, Primary Entity, status and other basic information about the business rule.

p1

p2

 

Transaction aware batch process using ‘ExecuteMultipleRequest’

Rajeev Pentyala - Dynamics 365 Blog

In this article, I am going to discuss about transaction aware batch processing in ExecuteMultipleRequest using  ExecuteTransactionRequest.

Is ‘ExecuteMultipleRequest’ not a transaction aware?

  • By design, ‘ExecuteMultipleRequest’ is non-transactional.
  • Which means ‘Request’ objects added to ‘ExecuteMultipleRequest’ are independent of each other and if any exception occurred in any of the ‘Request’ will not roll back previously committed ‘Requests’.
  • However you have an option to stop the batch (i.e., By setting ContinueOnError = false),  if any exception occurs.
  • Important to note is that, this behavior is not a transaction aware and ‘Requests’ executed prior to the error, will still be committed.

How can we achieve ‘Transaction’ in Batch execution?

  • Using ExecuteTransactionRequest, we can achieve ‘Transaction’ (i.e., Commit and Rollback) in Batch execution
  • ExecuteTransactionRequest will execute the all the ‘Requests’ in a single transaction.
  • If any exception occurred in any of the ‘Request’ execution, will roll back all the previously…

View original post 301 more words

MultiSelect Option Set in Dynamics 365

Nishant Rana's Weblog

With July 2017 update, we can now finally create multi-select option set in Dynamics 365.

We can also use Existing Global Option Set while defining our Multi Select Option set.

This is how control looks within the form.

Within Advanced Find View

We can use the existing option set client-side methods on Multi Select Option Set.

https://msdn.microsoft.com/en-us/library/gg334409.aspx#Anchor_1

getSelectedOption() – for new_weekday multiselect option-set with value Thursday and Friday selected –

Hope it helps..

View original post

Dynamics 365 v9 – NOT IN support for Advanced Find

Dynamics 365 Funda by Zohaib Uddin Khan

Let’s discuss all the new features of Dynamics 365 v9 updates. One of the interesting ones is ‘NOT IN Support for Advanced Find’.

Purpose of this new feature is to find all those Cases that do not contain a Task using Advanced Find.  Let’s kick in to play with it.

Go to Dynamics 365 – click on Advanced Find

Scenario # 1:

  • Look for: Cases
  • in the below pane, do ‘Tasks (regarding) = Contains Data”
  • Click on Results button.

This query will return all the Cases which have at least one Task associated with it.

D365-v9-NOT-IN-Advanced-Find-1

If you click on the ‘Download Fetch XML’, you will find the below info:

D365-v9-NOT-IN-Advanced-Find-3

Scenario # 2:

  • Look for: Cases
  • in the below pane, do ‘Tasks (regarding) = Does Not Contain Data”
  • Click on Results button.

This query will return all the Cases which don’t have any Task associated with it.

D365-v9-NOT-IN-Advanced-Find-2

If you click on the ‘Download Fetch XML’, you…

View original post 23 more words

Dynamics 365 Attribute Name lengths

@ramontebar

This article captures the maximum attribute name lengths allowed in Dynamics 365 (CRM). This is a simple thing but I carry on forgetting it and it is useful to have them always in mind.

  • Attribute Display Name max length = 50 characters
  • Attribute Unique Name max length = 41 characters
  • Attribute Description max length = 200 characters
  • Attribute Form Label max length = 100 characters

See below the corresponding screenshots locating those elements:

ramontebar_blog_new attribute name lengthsramontebar_blog_Field Attribute Label

View original post

Resolving Duplicate Lookup References in Import Process

Exploring Dynamics CRM

Normally when we import records which has a related entity, import process will resolve the lookup reference if it finds single record in the parent entity otherwise, it will stop processing the record and ends in fail.

Ex: When we are importing a Contact (Contact1) with Parent Account (Account1) and system has two accounts with same name then Import process gives error when processing Contact1

To resolve these types of records we need to make a small tweak before submitting the import job. Here we go

Click on Edit in the mapping dialog

Go to Parent Account field in the list of mappings and click on Lookup

Set the unique field as the reference

Now in the import file add the data as Account Number for Parent Account field.

Hope this helps 🙂

View original post

Add New (+) button behavior of sub grid in D365

While working with a sub-grid in D365, a question was thrown regarding behavior of Add record (plus) button. Many of you must have observed that for few sub-grids, click action of Add record button opens a new form to create a new record while for others a new line is added in sub-grid where one can add the record name and associate it. You might have figured the reason for this earlier but it was now that a college helped to figure out why it happens for me.

For those who were still looking for the reason of this behavior like me, this is all related to requirement level of the look-up field on child record. If Look-up is configured as business required then a new form is opened else the grid provides an inline row to associate the record. My assumption for this behavior is that if the look-up is business required, then it is assumed that all the existing records are already associated with some parent record thus user should create a new record. Always correct me if i’m wrong 🙂

Installing the latest version of Voice of the Customer (v 9.0.x.x)

@ramontebar

Last week I was running a new Dynamics 365 trial (v 8.2.1.289) and I wanted to use the Voice of the Customer module.

Based on the previous versions of this solution (v.8.x.x.x), I followed the same steps that I used to: Office 365 => Dynamics 365 Admin Portal => INSTANCES => Solutions, see below screenshot:


However, when I tried to install it from this Solutions section, the installation process just failed once and again.

After a quick call with Microsoft Support, they told me the new installation process at the APPLICATIONS tab, see below screenshot:

Once you are there, just click on MANAGE and follow the next few steps choosing your corresponding instance (whose version needs to be >=8.2). Then you can track again the installation process in the Solutions section:

Hope this saves you some time 😉

View original post