Template in API Development
-
- Posts: 94
- Joined: Mon Dec 28, 2009 3:43 pm
Template in API Development
Can you please tell me how can I use the default template for a user's default office when create orders through API? I couldn't find anything in the documentation.
Re: Template in API Development
Hi Sanjay,
To apply a template at order creation time, you will want to utilize the OrderCreationSpec type. It has a Templates property that exposes a collection of template numbers to apply when the order is created, in the order provided. The Select SDK help file has additional information about this type.
Usage:
To apply a template at order creation time, you will want to utilize the OrderCreationSpec type. It has a Templates property that exposes a collection of template numbers to apply when the order is created, in the order provided. The Select SDK help file has additional information about this type.
Usage:
Code: Select all
...
// Get the Order Tracking service
SoftPro.OrderTracking.Client.OrderTracking ot = server.GetService<SoftPro.OrderTracking.Client.OrderTracking>( );
// Create the spec
OrderCreationSpec spec = new OrderCreationSpec( );
spec.Templates.Add( "Template1235" );
// Create the order
using ( IOrder order = ot.CreateOrder(spec) )
{
...
ot.CloseOrder( order );
}
-
- Posts: 94
- Joined: Mon Dec 28, 2009 3:43 pm
Re: Template in API Development
Thanks Mark.
Can you also tell me how to get the default template name from a user's default office?
Best
Sanjay
Can you also tell me how to get the default template name from a user's default office?
Best
Sanjay
Re: Template in API Development
Unfortunately, the information you are trying to acquire is not currently exposed by the Select API and would require non-trivial database interaction, which is not something we generally recommend. I will email you directly to discuss your options further.
Re: Template in API Development
For those customers that are using, at minimum, Select version 2.6, note the following related API functionality that is available. Be sure and check out the ProfileManagement features in the Select SDK Help file.
Code: Select all
SelectServer sps = GetService<SelectServer>();
IProfile profile = sps.CurrentProfile;
IProfileItem profileItem = profile.Items.FirstOrDefault(pi => pi.Name == "DefaultTemplate" && pi.Category == "PFDefault");
object defaultTemplateID = profileItem.CurrentValue; // guid, if defined
Re: Template in API Development
Where can I find a list the templates? Are they stored in a lookup table?
Robert
Re: Template in API Development
Templates are persisted alongside Orders with the IsTemplate flag turned on.