How to retrieve the open order OwningProfileID in 3.0?

Discussions related to custom development with Select.
Post Reply
BBenson
Posts: 44
Joined: Wed Feb 23, 2011 4:06 pm

How to retrieve the open order OwningProfileID in 3.0?

Post by BBenson »

Hello,

We have a custom package that needs to get the currently open order's OwningProfileID in order to do different handling based upon it. In 2.6 we did the following, which no longer compiles in Cameron:

var profileId = order.OwningProfileID;

How do I achieve the same in Cameron?

Thanks,
Bob
Joni Hoffman
Posts: 18
Joined: Fri Oct 03, 2008 1:12 pm

Re: How to retrieve the open order OwningProfileID in 3.0?

Post by Joni Hoffman »

You would do this:

var profileID = order.OwnershipProfile.ID
Joni Hoffman
Software Developer
SoftPro
BBenson
Posts: 44
Joined: Wed Feb 23, 2011 4:06 pm

Re: How to retrieve the open order OwningProfileID in 3.0?

Post by BBenson »

Joni,

Thanks for the quick reply but this does not compile either:

Error 1 'SoftPro.OrderTracking.Client.Orders.IOrder' does not contain a definition for 'OwnershipProfile' and no extension method 'OwnershipProfile' accepting a first argument of type 'SoftPro.OrderTracking.Client.Orders.IOrder' could be found (are you missing a using directive or an assembly reference?)

Bob
Joni Hoffman
Posts: 18
Joined: Fri Oct 03, 2008 1:12 pm

Re: How to retrieve the open order OwningProfileID in 3.0?

Post by Joni Hoffman »

What I provided earlier should work when using dynamics. If you are not using dynamics, try the code below.

IOrder order = OrderThatYouGetFromSomewhere();
Guid profileID = ((IProfileInfo)order["OwnershipProfile"]).ID
Joni Hoffman
Software Developer
SoftPro
BBenson
Posts: 44
Joined: Wed Feb 23, 2011 4:06 pm

Re: How to retrieve the open order OwningProfileID in 3.0?

Post by BBenson »

Thank You,

This does work now, I missed the dynamic part.

Bob
User avatar
uwdoug79
Posts: 78
Joined: Wed Aug 07, 2013 12:43 pm
Location: Earth
Contact:

Re: How to retrieve the open order OwningProfileID in 3.0?

Post by uwdoug79 »

How would one set the OwningProfileID in 3.0 when adding to the template before sending a new order to SPS?

In 2.6 I was doing this:

Code: Select all

                            
specTemplate.OwningProfileID = guid;
specTemplate.BaseOrderNumber = Convert.ToString(dt.Rows[i].ItemArray[2]);
...
IOrder order = ot.NewOrder(specTemplate);

Doug Hamilton
CHICAGO TITLE
20825 SWENSON DR SUITE 300 WAUKESHA, WI 53186
P: 262-796-3808 F: 262-796-3888
EMAIL: Doug.Hamilton@fnf.com
www.wi.ctic.com | www.chicagoagent.com | www.etitle.ws
Post Reply