Changed By Field

Discussions related to SoftPro Select user interface development.

Moderator: Phil Barton

Post Reply
sanjay.mittal
Posts: 94
Joined: Mon Dec 28, 2009 3:43 pm

Changed By Field

Post by sanjay.mittal »

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
Mark McKenna

Re: Changed By Field

Post by Mark McKenna »

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).
sanjay.mittal
Posts: 94
Joined: Mon Dec 28, 2009 3:43 pm

Re: Changed By Field

Post by sanjay.mittal »

Mark -

Do you have a code sample for this?

Thanks
Sanjay
Mark McKenna

Re: Changed By Field

Post by Mark McKenna »

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
sanjay.mittal
Posts: 94
Joined: Mon Dec 28, 2009 3:43 pm

Re: Changed By Field

Post by sanjay.mittal »

Thanks Mark
softprocam
Posts: 21
Joined: Tue Apr 15, 2014 8:40 am

Re: Changed By Field

Post by softprocam »

I don't see ChangeEvent Property under order .How do you get ChangeEvent for Given order.
Post Reply