Create Order With Multiple Templates

Discussions concerning general integration topics.

Moderator: Phil Barton

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

Create Order With Multiple Templates

Post by uwdoug79 »

I have code that applies a template when creating an order in the API. Is it possible to add multiple templates to be applied to the order when created. I need to apply a default template to each order besides the unique one that gets picked when my users select a certain order type.

Code: Select all

                                
                                if (oTemplate.SpstTempateDescription == "N/A")
                                {
                                    specTemplate.Templates.Add("CTWI TO REFI");
                                }
                                else
                                {
                                    switch (Convert.ToInt32(dt.Rows[i].ItemArray[62]))
                                    {
                                        case vCDF:
                                            specTemplate.Templates.Add(oTemplate.SpstTempateDescription.Trim() + " CDF");
                                            blnCDF = true;
                                            break;
                                        default:
                                            specTemplate.Templates.Add(oTemplate.SpstTempateDescription);
                                            blnCDF = false;
                                            break;
                                    }
                                }
                               specTemplate.Templates.Add("Default Template");
                                
 
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
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Create Order With Multiple Templates

Post by BobRichards »

Yes. The OrderCreationSpec.Templates property will hold a list of templates. Just Add them to this list in the order you want them applied to the newly created order. If you only specify the templates, the order number/prefix/suffix will automatically fill themselves out if possible.

Code: Select all

OrderCreationSpec specTemplate= new OrderCreationSpec();
specTemplate.Templates.Add("Default Template");
specTemplate.Templates.Add("Additional Template1");
specTemplate.Templates.Add("Additional Template2");
Bob Richards, Senior Software Developer, SoftPro
Post Reply