PublicAPI.CRM.Contractor.CreateContact ELMA API Documentation
Creates a contact, linked to the contractor. Creates an object without saving to the database
 
 
Syntax

public Contact CreateContact(
	Contractor contractor
)

Parameters

contractor
Type: Contractor
Contractor, the contact is created for. Object. Access path: PublicAPI.CRM.Contractor

Return Value

Type: Contact
Contact
Examples

//load a contractor by ID 
var contractor = PublicAPI.CRM.Contractor.Load(3);

//create a contact 
var myContact = PublicAPI.CRM.Contractor.CreateContact(contractor);

//myContact - created contact 

//WARNING!! The contact if created without a name. For correct work with the contact, you should specify its name and save the entity to the database
myContact.Name = "Contact Name";
myContact.Save();
See Also