PublicAPI.CRM.ContractorELMA API Documentation
Contractor
Access path: PublicAPI.CRM.Contractor
Methods

  NameDescription
Public methodAddAuthorPermission
Grant the author permission for the contractor
Public methodAddComment(Contractor, String)
Add Comment to a contractor
Public methodAddComment(Contractor, String, User)
Public methodAddPermission(Contractor, OrganizationItem, Permission)
Grant permissions for a contractor to a job position
Public methodAddPermission(Contractor, User, Permission)
Grant a user permissions for a contractor
Public methodAddPermission(Contractor, UserGroup, Permission)
Grant a user group permissions for a contractor
Public methodCount 
Returns the total number of objects of this type
Public methodCount(IEntityFilter)
Get Total Number of Objects by Filter
Public methodCreate
Create New Entity (without a Database entry)
Public methodCreateContact
Creates a contact, linked to the contractor. Creates an object without saving to the database
Public methodCreateSale
Creates a sale, linked to the contractor
Public methodDelete
Delete Object
Public methodDeleteAuthorPermission
Remove permissions for a contractor from the author
Public methodDeletePermission(Contractor, OrganizationItem)
Remove all permissions for a contractor from a job position
Public methodDeletePermission(Contractor, User)
Remove all the permissions for a contractor from a user
Public methodDeletePermission(Contractor, UserGroup)
Remove all the permissions for a contractor from a user group
Public methodDeletePermission(Contractor, OrganizationItem, Permission)
Remove permissions for a contractor from a job position
Public methodDeletePermission(Contractor, User, Permission)
Remove permissions to manage a contractor from a user
Public methodDeletePermission(Contractor, UserGroup, Permission)
Remove permissions to manage a contractor from a user
Public methodDisableInheritPermissions
Disable inheriting permissions from category
Public methodEnableInheritPermissions
Enable inheriting permissions from a category
Public methodFilter
Creates an assistant for working with the "Contractor" object filter
Public methodFind(FetchOptions)
Find objects according to fetch options
Public methodFind(String)
Find objects according to the filter in the EQL language
Public methodFind(IEntityFilter, FetchOptions)
Fing objects according to fetch options and filter
Public methodFindByIdArray
Find All Objects by Array IDs
Public methodIsDirty
Check, if there are unsaved changes in the object
Public methodIsNew
Check, if the object is new (not saved in the database)
Public methodLoad(Guid)
Load by UID. If not found, an exception is invoked
Public methodLoad(Int64)
Load by ID. If not found, an exception is invoked
Public methodLoadOrCreate(Guid)
Load by ID. If not found, the new object is returned
Public methodLoadOrCreate(Int64)
Load by ID. If not found, the new object is returned
Public methodLoadOrNull(Guid)
Load by UID. If not found, null is returned
Public methodLoadOrNull(Int64)
Load by ID. If not found, null is returned
Public methodRefresh
Refresh (read over) Object from Database
Public methodSave
Save Object to Database
Back to Top
Properties

  NameDescription
Public propertyContractorIndividual
Individual
Public propertyContractorLegal
Company
Public propertyTypeUid
Returns the unique object identifier "Contractor"
Back to Top
Remarks

Section containing methods for managing contractors
Examples

Create an empty contractor (a company)

var myContractor = PublicAPI.CRM.Contractor.ContractorLegal.Create();

Before operations with variable myContractor, fill its required fields

//name of the created contractor
myContractor.Name = "New Life LLC";
//participant responsible for contractor, load administrator
myContractor.Responsible = PublicAPI.Security.User.LoadOrNull(1);

add a comment to our contractor

PublicAPI.CRM.Contractor.AddComment(myContractor, "This contractor does not have contacts yet; but they will be created later");

Please save the object in the base to ensure its proper functioning

myContractor.Save();

See Also