Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 123975

Forum Post: RE: How to change field values on closed records by plugin

$
0
0

I've tried this but the step to close my salesorder record did not work because i get an error in my visual studio by defining the CloseOrder Entity. It says that the Entity CloseOrder did not exist.

In this case my workaround is an easy thing: I created a new active statuscode and implemented a jscript that protected all available fields when the new status occurs.

I used the following code:

               var request = new FulfillSalesOrderRequest

               {

                   OrderClose = new OrderClose

                   {

                       SalesOrderId = new EntityReference

                       {

                           LogicalName = "salesorder",

                           Id = salesorder.Id

                       }

                   },

                  Status = new OptionSetValue(124490018)

               };

               service.Execute(request);

Did somebody knew the mistake to close my salesorder record?


Viewing all articles
Browse latest Browse all 123975

Trending Articles



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