How we can Create Other type of contact with Contact Type name as 'Closing Location'

Discussions related to custom development with Select.
Post Reply
jturek
Posts: 14
Joined: Fri Jul 20, 2018 6:17 pm

How we can Create Other type of contact with Contact Type name as 'Closing Location'

Post by jturek »

Hi Team.,

I have tried to create 'Other' type Order contact with Contact Type name as 'Closing Location' but not able to achieve the same
Can you please suggest for the same ?

Create contact: Other (closing location)
Closing Location Contact.PNG
Closing Location Contact.PNG (135.46 KiB) Viewed 851 times
To getting this done written the below code, it creates 'Other' type of Contact.

Code: Select all

                                    // Add new Contact - Other (Closing Location)
                                    dynamic newContract = ((IOrder)order).CreateNew("Other");
                                    
                                    // SET the Location
                                     dynamic address = (dynamic)contract.Address;
                                    address.Address1 = objScheduleClosingRequest.Location;
BobRichards
Posts: 1377
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: How we can Create Other type of contact with Contact Type name as 'Closing Location'

Post by BobRichards »

If you look in the Field Code Browser in the Select UI, an "Other Contact" is of type "Other". This type has a string property named "OtherType" that is a string. Just set the value for OtherType.

Code: Select all

// Add new Contact - Other (Closing Location)
 dynamic newContract = ((IOrder)order).CreateNew("Other");
 newContact.OtherType = "Closing Location";
Bob Richards, Senior Software Developer, SoftPro
Post Reply