Using Cameron API to update CommitmentLegal

Discussions concerning general integration topics.

Moderator: Phil Barton

Post Reply
vaetgt1
Posts: 11
Joined: Thu Aug 27, 2009 12:00 pm

Using Cameron API to update CommitmentLegal

Post by vaetgt1 »

In Boylan to update the Commitment Legal we use this piece of code in VB.net.

Dim netCredential As System.Net.NetworkCredential
Dim spsOrderTracking As OrderTracking
Dim spsOrderQuery As OrderQuerySpec
Dim spsOrder As IOrder

netCredential = New System.Net.NetworkCredential(“a user name”,”a password”, "[SERVER]")
Using spsServer As New SelectServer(CStr(sqlReader("A servername")), netCredential)

spsServer.EnsureAuthenticated()
spsOrderTracking = spsServer.GetService(Of OrderTracking)()
spsOrderQuery = New OrderQuerySpec
spsOrderQuery.BaseOrderNumber = CStr(sqlReader("an sps order number"))
spsOrder = spsOrderTracking.GetOrder(spsOrderQuery, False)
spsOrder.Property(0).CommitmentLegal = “this is my test legal”

Is there an example (or any documentation) of the equivalent in Cameron
Joni Hoffman
Posts: 18
Joined: Fri Oct 03, 2008 1:12 pm

Re: Using Cameron API to update CommitmentLegal

Post by Joni Hoffman »

The CommitmentLegal property is now an instance of our LegalDescription object.
So, to set the text of the description you would just have to alter your line from below like this:
spsOrder.Property(0).CommitmentLegal.Description = “this is my test legal”
Joni Hoffman
Software Developer
SoftPro
vaetgt1
Posts: 11
Joined: Thu Aug 27, 2009 12:00 pm

Re: Using Cameron API to update CommitmentLegal

Post by vaetgt1 »

Ah, I am sorry I shold have made things clearer, it's not just that last line I waslooking for it's the whole thig.

Basically in Boylan the OrderTracking object can be found at
SoftPro.OrderTracking.Client.OrderTracking
however in Cameron no such object exists and so the code doesn't even get pass the second line which is
Dim spsOrderTracking As OrderTracking
John Morris
Posts: 411
Joined: Thu Sep 11, 2008 11:35 am
Location: Raleigh, NC, USA
Contact:

Re: Using Cameron API to update CommitmentLegal

Post by John Morris »

This thread talks about using the new v3.0 API.

viewtopic.php?f=19&t=348
John Morris
Sr. Software Architect
SoftPro
vaetgt1
Posts: 11
Joined: Thu Aug 27, 2009 12:00 pm

Re: Using Cameron API to update CommitmentLegal

Post by vaetgt1 »

Thanks for the reply however that only gets me to the 3rd line of code.

My original post was
Dim netCredential As System.Net.NetworkCredential
Dim spsOrderTracking As OrderTracking
Dim spsOrderQuery As OrderQuerySpec
Dim spsOrder As IOrder

netCredential = New System.Net.NetworkCredential(“a user name”,”a password”, "[SERVER]")
Using spsServer As New SelectServer(CStr(sqlReader("A servername")), netCredential)

spsServer.EnsureAuthenticated()
spsOrderTracking = spsServer.GetService(Of OrderTracking)()
spsOrderQuery = New OrderQuerySpec
spsOrderQuery.BaseOrderNumber = CStr(sqlReader("an sps order number"))
spsOrder = spsOrderTracking.GetOrder(spsOrderQuery, False)
spsOrder.Property(0).CommitmentLegal = “this is my test legal”

and the reply got me to the line
IOrderStore os = sps.GetService<IOrderStore>();

So can you tell me what is supposed to happen next?
John Morris
Posts: 411
Joined: Thu Sep 11, 2008 11:35 am
Location: Raleigh, NC, USA
Contact:

Re: Using Cameron API to update CommitmentLegal

Post by John Morris »

Look lower down in the sample in that thread. It shows how to find/open orders.

Code: Select all

//search for an order, by number (Yes, you can use LINQ!)
IOrderInfo info = (from o in os.Orders
                         where o.Number == "1234"
                         select o).Single();

//open the found order in readonly mode, read something and close it (this time, not using the dispose pattern)
IOrder order2 = os.OpenOrder(info, true);
Console.WriteLine("The settlement data is {0}.", order2["SettlementDate"]);
os.CloseOrder(order2);
John Morris
Sr. Software Architect
SoftPro
vaetgt1
Posts: 11
Joined: Thu Aug 27, 2009 12:00 pm

Re: Using Cameron API to update CommitmentLegal

Post by vaetgt1 »

It seems I may have made my original post to confusing, so let me attempt to rephrase it.

Can you supply ALL of the code (in VB.net is possible otherwise any language will do), using the Cameron API, so that I can copy it into a project and run it, to perform the following actions.

Connect to the mid-tier, open an order, update the commitment legal description, save the order.
Post Reply