Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. tracingService.Trace("Retrieving Order");
  2. //retrieve the entity order as the input Entity
  3. //get both the copies of the entity, and get the updated fields from the new one
  4. var entity = (Entity)context.InputParameters["Target"];
  5. var oldEntity = Helpers.ActualEntity(new EntityReference("salesorder", entity.Id), service);
  6.  
  7. tracingService.Trace("Before cast");
  8. //Early bound entity
  9. var order = new salesorder(entity);
  10. var oldOrder = new salesorder(oldEntity);
  11.  
  12.  
  13. //if the orderprice is not locked return
  14. if ((order.ispricelocked == false) || (oldOrder.ispricelocked == false))
  15. return;
  16. else
  17. //if the orderprice is locked, unlock it
  18. {
  19. var req = new UnlockSalesOrderPricingRequest();
  20. req.SalesOrderId = order.Id;
  21. var resp = (UnlockSalesOrderPricingResponse)service.Execute(req);
  22. }
  23.  
  24. var Order = new salesorder(entity);
  25.  
  26. Order.Id is null or Guid.Empty
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement