General Methods
The following general methods are available when writing Custom Code for a service.
Method Name | Description | Returns |
---|---|---|
GetClass(int classId) | Gets a class with the provided ID. | The class object. |
GetClasses(IProject project) | Gets all the classes defined in a project. | A list of classes. |
GetClasses(int projectId) | Gets all the classes defined in a project. | A list of classes. |
GetDocumentMaster(IDocument doc) | Gets the master document for a provided document. | The master document object. |
FindClassByName(int projectId, string name, LarcAI.DictionaryLookupMethod? lookup = null, float minConfidence = 0.80F) | Try to find a class by name. | The class object. |
GetParentService() | Gets the parent service of the current service. | The parent service parameter definition. |
GetParentService(int id) | Gets the parent service of the current service. | The parent service parameter definition. |
ParseDecimal(string str, out decimal amount) | Try to parse a string value to decimal. | True if successful, otherwise false. |
GetUserAsync(string userId) | Gets the current logged in user. | The application user. |
GetUsersAsync(IEnumerable userIds) | Gets all users via user ID. | A list of application users. |
GetUserAsync(IProjectUser pu) | Gets a user linked to a project. | The application user. |
GetUsersAsync(IEnumerable pudata) | Gets a user linked to a project. | The application user. |
GetUsers(LinkType? type = null, List roles = null, string permissions = null | Gets a list of all users with roles and permissions. | A list of project users. |
GetUsers(int serviceId, LinkType? type = null, List roles = null, string permissions = null) | Gets a list of all users with roles and permissions. | A list of project users. |
GetUsers(int projectId, int? groupId, LinkType? type = null, List roles = null, string permissions = null) | Gets a list of all users with roles and permissions. | A list of project users. |
GetUsers(int projectId, int serviceId, int? groupId, LinkType? type = null, List roles = null, string permissions = null) | Gets a list of all users with roles and permissions. | A list of project users. |
GetMicrosoftGraphClient() | Gets the MS Graph client. | The MS Graph client object. |
CallWebHookAsync(IDocument srcdoc, IDocument masterdoc = null, IDocumentParameter par = null, IParameterDef def = null, IVerification verification = null, IWorkItem wi = null, int? webHookServiceId = null) | Calls a webhook service to post data to an external system. | The webhook call result. |
SaveChanges() | Save any changes made to Entity Framework in the Custom Code. | The SaveChanges response. |
SaveChangesAsync() | Save any changes made to Entity Framework in the Custom Code. | The SaveChanges response |