I got a quick question about the Softpro API. When we save an order using the API, can we set the changed by field in the history log? We want to show the user name that is different than the one who is specifically created to save orders through API.
Thanks
Sanjay
Changed By Field
Moderator: Phil Barton
Re: Changed By Field
Change events that are written to the order history log automatically assign the current user as the "Who" when they are created. The Select SDK Help does indicate that these entries are exposed through the IChangeEvent interface, and that the Who property is assignable, so you might try getting a reference to the trustee you want to assign and using that to set it directly (for example, the IOrder exposes a list of all available trustees from which to pick).
-
- Posts: 94
- Joined: Mon Dec 28, 2009 3:43 pm
Re: Changed By Field
Mark -
Do you have a code sample for this?
Thanks
Sanjay
Do you have a code sample for this?
Thanks
Sanjay
Re: Changed By Field
Something along these lines should work:
Code: Select all
// order is IOrder
ITrustee user = order.AllUsers.FirstOrDefault(t => t.LastName == "Mustaine");
IChangeEvent ce = order.ChangeEvent.FirstOrDefault();
ce.Who = user;
// save order
-
- Posts: 21
- Joined: Tue Apr 15, 2014 8:40 am
Re: Changed By Field
I don't see ChangeEvent Property under order .How do you get ChangeEvent for Given order.