Class CustomObjectAgent
Proxy class for the CustomObject Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Inherited Members
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class CustomObjectAgent : ICustomObjectAgent, IAgent
Constructors
CustomObjectAgent(ICustomObjectImplementation, ICustomObjectDefinitionImplementation, ISoRequestItemsAccessor)
Proxy class for the CustomObject Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public CustomObjectAgent(ICustomObjectImplementation customObjectImplementation, ICustomObjectDefinitionImplementation customObjectDefinitionImplementation, ISoRequestItemsAccessor accessor)
Parameters
| Type | Name | Description |
|---|---|---|
| ICustomObjectImplementation | customObjectImplementation | |
| ICustomObjectDefinitionImplementation | customObjectDefinitionImplementation | |
| ISoRequestItemsAccessor | accessor |
CustomObjectAgent(ICustomObjectImplementation, ICustomObjectDefinitionImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository)
Proxy class for the CustomObject Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public CustomObjectAgent(ICustomObjectImplementation customObjectImplementation, ICustomObjectDefinitionImplementation customObjectDefinitionImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository)
Parameters
| Type | Name | Description |
|---|---|---|
| ICustomObjectImplementation | customObjectImplementation | |
| ICustomObjectDefinitionImplementation | customObjectDefinitionImplementation | |
| ISoRequestItemsAccessor | accessor | |
| IDebugUser | debugUser | |
| IServiceCallsRepository | serviceCallsRepository |
Methods
CreateDefaultCustomObjectAsync(string, CancellationToken)
Returns a new Custom Object row pre-populated with the default values declared by the Custom Object Definition. The row is not yet persisted.
Declaration
public Task<CustomObject> CreateDefaultCustomObjectAsync(string definitionName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | definitionName | Database table name of the Custom Object Definition, e.g. 'y_equipment'. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<CustomObject> | A new Custom Object row pre-populated with default values. Not yet persisted. |
CreateDefaultCustomObjectDefinitionAsync(CancellationToken)
Loading default values into a new CustomObjectDefinition.
Declaration
public Task<CustomObjectDefinition> CreateDefaultCustomObjectDefinitionAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<CustomObjectDefinition> | New CustomObjectDefinition with default values |
DeleteCustomObjectAsync(string, int, CancellationToken)
Deletes a single Custom Object row by primary key.
Any of the following function rights grants access to the resource: AdminAll, CSEditExtraTableContent
Declaration
public Task DeleteCustomObjectAsync(string definitionName, int id, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | definitionName | Database table name of the Custom Object Definition, e.g. 'y_equipment'. |
| int | id | Primary key of the row to delete. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
GetCustomObjectAsync(string, int, CancellationToken)
Returns a single Custom Object row by definition name and primary key.
Any of the following function rights grants access to the resource: AdminAll, CSEditExtraTableContent, CSListExtraTableContent
Declaration
public Task<CustomObject> GetCustomObjectAsync(string definitionName, int id, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | definitionName | Database table name of the Custom Object Definition, e.g. 'y_equipment'. |
| int | id | Primary key of the row to fetch. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<CustomObject> | The Custom Object row, or null if no row with that id exists. |
GetCustomObjectDefinitionAsync(string, CancellationToken)
Returns the schema (table + field definitions) for a Custom Object Definition by its database table name.
Declaration
public Task<CustomObjectDefinition> GetCustomObjectDefinitionAsync(string definitionName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | definitionName | Database table name of the Custom Object Definition, e.g. 'y_equipment'. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<CustomObjectDefinition> | The Custom Object Definition, or null if no definition with that name exists. |
GetCustomObjectsIconsAsync(CancellationToken)
Returns SVG icon data for all Custom Object tables, keyed by table name.
Declaration
public Task<StringDictionary> GetCustomObjectsIconsAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<StringDictionary> | Map of table name to SVG icon data URI. |
GetCustomObjectsMetadataAsync(CancellationToken)
Returns bootstrap metadata for all Custom Object tables.
Declaration
public Task<CustomObjectMetadata[]> GetCustomObjectsMetadataAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<CustomObjectMetadata[]> | Metadata for all custom object tables. |
HasScreenChooserAsync(string, bool, CancellationToken)
Returns true if a screen chooser is configured for the given Custom Object Definition and mode.
Any of the following function rights grants access to the resource: AdminAll, CSEditExtraTableContent, CSListExtraTableContent
Declaration
public Task<bool> HasScreenChooserAsync(string definitionName, bool edit, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | definitionName | Database table name of the Custom Object Definition. |
| bool | edit | True to check for a custom edit screen; false to check for a custom view screen. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if a screen chooser (view or edit) is configured for this Custom Object. |
SaveCustomObjectAsync(string, CustomObject, CancellationToken)
Saves a Custom Object row. If the row has a primary key set it will be updated, otherwise a new row is inserted.
Any of the following function rights grants access to the resource: AdminAll, CSEditExtraTableContent
Declaration
public Task<CustomObject> SaveCustomObjectAsync(string definitionName, CustomObject row, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | definitionName | Database table name of the Custom Object Definition, e.g. 'y_equipment'. |
| CustomObject | row | The Custom Object row to save. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<CustomObject> | The saved Custom Object row, with any server-assigned values (e.g. primary key) filled in. |