Deal
Access path: PublicAPI.CRM.SaleMethods
Name | Description | |
---|---|---|
AddAuthorPermission |
Grant the author permission for the contractor
| |
AddComment(Sale, String) |
Add a comment to the sale
| |
AddComment(Sale, String, User) | ||
AddPermission(Sale, OrganizationItem, Permission) |
Grant permissions for a contractor to a job position
| |
AddPermission(Sale, User, Permission) |
Grant a user permissions for a contractor
| |
AddPermission(Sale, UserGroup, Permission) |
Grant a user group permissions for a contractor
| |
Count |
Returns the total number of objects of this type
| |
Count(IEntityFilter) |
Get Total Number of Objects by Filter
| |
Create |
Create New Entity (without a Database entry)
| |
CreateInpayment |
Create an inpayment, linked to the sale.
Creates an object without saving to the database
| |
Delete |
Delete Object
| |
DeleteAuthorPermission |
Remove permissions for a contractor from the author
| |
DeletePermission(Sale, OrganizationItem) |
Delete all the permissions for a contractor from a job position
| |
DeletePermission(Sale, User) |
Remove all the permissions for a contractor from a user
| |
DeletePermission(Sale, UserGroup) |
Remove all the permissions for a contractor from a user group
| |
DeletePermission(Sale, OrganizationItem, Permission) |
Remove permissions for a contractor from a job position
| |
DeletePermission(Sale, User, Permission) |
Remove permissions to manage a contractor from a user
| |
DeletePermission(Sale, UserGroup, Permission) |
Remove permissions to manage a contractor from a user
| |
DisableInheritPermissions |
Disable inheriting permissions from category
| |
EnableInheritPermissions |
Enable inheriting permissions from a category
| |
Filter |
Creates an assistant for working with the "Deal" object filter
| |
Find(FetchOptions) |
Find objects according to fetch options
| |
Find(String) |
Find objects according to the filter in the EQL language
| |
Find(IEntityFilter, FetchOptions) |
Fing objects according to fetch options and filter
| |
FindByIdArray |
Find All Objects by Array IDs
| |
GetAllInpayments |
Get all the sale inpayments
| |
IsDirty |
Check, if there are unsaved changes in the object
| |
IsNew |
Check, if the object is new (not saved in the database)
| |
Load(Guid) |
Load by UID. If not found, an exception is invoked
| |
Load(Int64) |
Load by ID. If not found, an exception is invoked
| |
LoadOrCreate(Guid) |
Load by ID. If not found, the new object is returned
| |
LoadOrCreate(Int64) |
Load by ID. If not found, the new object is returned
| |
LoadOrNull(Guid) |
Load by UID. If not found, null is returned
| |
LoadOrNull(Int64) |
Load by ID. If not found, null is returned
| |
LoadSaleTypeOrNull |
Load a deal type by name, if there is not one, null is returned
| |
Refresh |
Refresh (read over) Object from Database
| |
Save |
Save Object to Database
| |
SetActiveStatus |
Set the "Active" status
| |
SetNegativeClosedStatus |
Set the "Closed(unsuccessfully)" status
| |
SetPositiveClosedStatus |
Set the "Closed(successfully)" status
| |
SetPostponedStatus |
Set the "Postponed" status
| |
SetStage |
Change a deal stage
| |
SetStatus |
Change Sale Status
|
Properties
Name | Description | |
---|---|---|
TypeUid |
Returns the unique object identifier "Deal"
|
Remarks
Examples
Create a deal for the contractor, created here
var mySale = PublicAPI.CRM.Contractor.CreateSale(myContractor);
Before you start working with mySale variable, fill in its requested fields (except for "Contractor", it is already filled)
//Deal Name mySale.Name = "Selling equipment to New World ltd."; //Select the administrator as the user responsible mySale.Responsible = PublicAPI.Security.User.LoadOrNull(1); //Load deal type by name and move it to the deal mySale.SaleType = PublicAPI.CRM.Sale.LoadSaleTypeOrNull("Deal type");
Add a comment to the deal
PublicAPI.CRM.Sale.AddComment(mySale, "mySale is a deal, created for myContarctor");
Remember to save the object to the database for its correct operation
mySale.Save();
After creating an inpayment and adding it to the deal, change deal status from "Active" toe "Closed(Success)"
PublicAPI.CRM.Sale.SetPositiveClosedStatus(mySale, "Deal is successfully closed, no comments");
See Also