latest Post

Set Date Fulfilled for historical closed Sales Orders.

Recently I have found myself importing lots of data from legacy systems into Dynamics CRM.   A recent challenge I came across was trying to set the fulfilment date of historical closed Orders.  

Out of the box when closing Sales Orders Microsoft gives the user the option to set the date fulfilled field.(see below screenshot) 

Standard Data Import Tool
However, when  using the standard data import tool and mapping the fields from Excel to CRM it ignores the date fulfilled when the status of the Order is marked as "fulfilled". It  simply sets the date fulfilled to today's date. If I left the sales order open I was successfully able to set the date fulfilled field but the record remains open obviously.

Out of interest I  then created two simple on demand workflows, one which would re-open the closed Sales Orders and  another one which would then close the Sales Orders. You may ask why? Well I just wanted to witness if closing Sales Orders via a workflow also overwrote the date fulfilled field. Therefore I carried out the below steps.

1.) Ran the workflow to re-open the Sales Orders 
2.) Manually exported the Sales Orders that were closed and then re imported after setting the date fulfilled field on all records. 
3.) Checked the correct date fulfilled was showing in CRM 
4.) Ran the on demand workflow that closed the Sales Orders as fulfilled. 

I then checked the date fulfilled of the records closed via the workflow and noticed as expected the same thing happened and all those records had a date fulfilled set as today.

SSIS KingswaySoft 
I then tried this using SSIS with the brilliant Kingswaysoft connector and again witnessed the same thing. The date completely been ignored and replaced with today's date.

The solution
Asking in the community forums and reading some MSDN articles it appears that this is the expected behaviour. The date fulfilled is set based on the close date of the order close activity. In order to change the order close date activity  you need to use the  FulfillSalesOrderRequest class and set the order close property rather than set it directly on the Sales order. To use this we would need to write a custom workflow or plugin.

However, I noticed we were using an older version of the Kingwaysoft Connector and I found this little comment in the kingswaysoft change logs "New: When using the CRM destination component to close an incident, opportunity, quote, or salesorder record, we now support writing to its corresponding close entity, including incidentresolution, opportunityclose, quoteclose, and orderclose. "  

Searching for more information on this new feature brought me to the following blog post on which explains the exact same problem and shows how the new functionality in the latest version of the Kingswaysoft connector works.

Once I upgraded to the latest version of the connector I was able to set the following fields on the destination editor for the Sale order entity. 

- orderclose_actualend 
- orderclose_createdon 
- orderClose_description
- orderClose_subject

Now when mapping both the "status"  and  the "orderclose_actualend" fields the Sales Orders show as fulfilled with the correct fulfilment date.

Recommended Posts × +


Post a Comment