public Sale CreateSale( Contractor contractor )
Creates a sale, linked to the contractor
Syntax
public Sale CreateSale( Contractor contractor )
Parameters
- contractor
- Type: Contractor
Contractor, the sale is created for. Object. Access path: PublicAPI.CRM.Contractor
Return Value
Type: SaleSale
Examples
//load a contractor by ID var contractor = PublicAPI.CRM.Contractor.Load(3); //create a sale var mySale = PublicAPI.CRM.Contractor.CreateSale(contractor); //mySale - created sale //WARNING!! A sale is created without a name. For correct work with the sale, you should specify its name and save the entity to the database mySale.Name = "Имя for a sale"; mySale.Save();
See Also