Show / Hide Table of Contents

Interface IQuoteAgent

Interface for the Quote Agent Services for the Quote Management feature, part of the Sale module

Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("Quote Agent", "Interface for the Quote Agent. Services for the Quote Management feature, part of the Sale module")]
public interface IQuoteAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;

using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
   using (QuoteAgent agent = new QuoteAgent())
   {
      // call methods on agent here...
   }
}

Methods

AddSaleTypeQuoteAttachmentAsync(int, int, CancellationToken)

Adds a new quote attachment document to a sale type

Declaration
Task<int> AddSaleTypeQuoteAttachmentAsync(int saleTypeId, int documentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int saleTypeId

The ID of the sale type

int documentId

The ID of the document

CancellationToken cancellationToken
Returns
Type Description
Task<int>

ID of the new sale type quote attachment row

ApproveQuoteVersionAsync(int, string, int, string, CancellationToken)

Approves a quote version

Declaration
Task<ApproveRejectResponse> ApproveQuoteVersionAsync(int quoteVersionId, string approvedByText, int approvedByAssociateId, string approvalText, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

QuoteVersionId to approve.

string approvedByText

'Approved by' prefix to ApprovalText used when creating appointment task to log approval. Must be passed since service does not know which language to use for 'Approved By' string.

int approvedByAssociateId

AssociateId of the associate who approved the quote version.

string approvalText

Approval text.

CancellationToken cancellationToken
Returns
Type Description
Task<ApproveRejectResponse>

Response of the the operation

CanConnectorProvideCapabilityAsync(int, string, CancellationToken)

Can the connector provide the capability

Declaration
Task<bool> CanConnectorProvideCapabilityAsync(int quoteConnectionId, string capabilityName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

Primary key of the connection

string capabilityName

Capability name

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

Capability name

CancelApprovalRequestAsync(int, CancellationToken)

Cancel a pending quote approval request.

Declaration
Task<PluginResponse> CancelApprovalRequestAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

The quoteversion for which approval was previously sent.

CancellationToken cancellationToken
Returns
Type Description
Task<PluginResponse>

Response of the the operation

CopyQuoteAlternativeAsync(int, int, string, CancellationToken)

Copy a quote alternative from the same sale and adds it to a version.

Declaration
Task<QuoteAlternative> CopyQuoteAlternativeAsync(int quoteVersionId, int quoteAlternativeId, string quoteAlternativeName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

QuoteVersionId of the version to copy the alternative to.

int quoteAlternativeId

QuoteAlternativeId of the alternative to make a copy of.

string quoteAlternativeName

The name to set on the new alternative.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteAlternative>

The copied QuoteAlternative.

CopySuperOfficePriceListAsync(int, string, DateTime, DateTime, int, bool, CancellationToken)

Create a copy of a PriceList in the SuperOffice database

Declaration
Task<PriceList> CopySuperOfficePriceListAsync(int originalPriceListId, string newName, DateTime validFrom, DateTime validTo, int newCurrencyId, bool convertCurrency, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int originalPriceListId

Id of the PriceList to be copied

string newName

Name of the copied PriceList

DateTime validFrom

Start date for the new pricelist.

DateTime validTo

End date for the new pricelist.

int newCurrencyId

Currency id of the copied PriceList. If 0 or the same as the original the copied products will keep their prices and the currency will be the same as the original.

bool convertCurrency

If true, product prices will be recalculated to the new currency. If false, product prices will be set to zero.

CancellationToken cancellationToken
Returns
Type Description
Task<PriceList>

The copied PriceList

CreateAndSaveQuoteAsync(int, int, string, CancellationToken)

Creates a new quote on a sale.

Declaration
Task<QuoteEntity> CreateAndSaveQuoteAsync(int saleId, int connectionId, string firstAlternativeName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int saleId

SaleId of the connected sale

int connectionId

ConnectionId

string firstAlternativeName

Name to be given to the default alternative

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteEntity>

Quote carrier

CreateAndSaveQuoteFromSaleAsync(int, int, CancellationToken)

Creates a copy the active version with connected alternatives and quotelines from another sale.

Declaration
Task<QuoteEntity> CreateAndSaveQuoteFromSaleAsync(int copyFromSaleId, int copyToSaleId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int copyFromSaleId

Id of the sale to copy the active quote from.

int copyToSaleId

Id of the sale to copy the active quote to.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteEntity>

The created Quote

CreateAndSaveQuoteLinesAsync(int, string[], CancellationToken)

Create and save quotelines based on the product keys added

Declaration
Task<int> CreateAndSaveQuoteLinesAsync(int quoteAlternativeId, string[] erpProductKeys, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteAlternativeId

Primary key of the alternative

string[] erpProductKeys

Array of the product keys to add

CancellationToken cancellationToken
Returns
Type Description
Task<int>

Count of added quoteLines

CreateAndSaveQuoteVersionAsync(int, CancellationToken)

Created a new QuoteVersion based on another QuoteVersion on the same Quote.

Declaration
Task<QuoteVersion> CreateAndSaveQuoteVersionAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

QuoteVersionId of the version to copy the contents from.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteVersion>

The Quote version

CreateConnectionFromConnectorNameAsync(string, CancellationToken)

Create a new connection.

Declaration
Task<QuoteConnection> CreateConnectionFromConnectorNameAsync(string connectorName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string connectorName

The name of the connector to create this connection for.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteConnection>

The created connection

CreateDefaultPriceListAsync(CancellationToken)

Loading default values into a new PriceList.

Declaration
Task<PriceList> CreateDefaultPriceListAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<PriceList>

New PriceList with default values

CreateDefaultProductAsync(CancellationToken)

Loading default values into a new Product.

Declaration
Task<Product> CreateDefaultProductAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<Product>

New Product with default values

CreateDefaultQuoteAlternativeAsync(CancellationToken)

Loading default values into a new QuoteAlternative.

Declaration
Task<QuoteAlternative> CreateDefaultQuoteAlternativeAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<QuoteAlternative>

New QuoteAlternative with default values

CreateOrUpdateQuoteVersionAttachmentsAsync(int, CancellationToken)

Look at the Quote version, related sale and sale type, and ensure that the correct QuoteVersionAttachment records exist. This method may create or delete records

Declaration
Task<QuoteVersionAttachment[]> CreateOrUpdateQuoteVersionAttachmentsAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

The ID of the quote version

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteVersionAttachment[]>

The current attachments for the given Quote version, after all updates have been completed

CreateQuoteAlternativeAsync(int, string, string, CancellationToken)

Create a new quote alternative on a version.

Declaration
Task<QuoteAlternative> CreateQuoteAlternativeAsync(int quoteVersionId, string quoteAlternativeName, string quoteAlternativeDescription, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

QuoteVersionId of the version to create the alternative on.

string quoteAlternativeName

The name to set on the new alternative.

string quoteAlternativeDescription

The description to set on the new alternative.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteAlternative>

The newly created QuoteAlternative.

CreateQuoteLineAsync(int, string, CancellationToken)

Create a quoteline based on a product key.

Declaration
Task<QuoteLine> CreateQuoteLineAsync(int quoteAlternativeId, string eRPProductKey, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteAlternativeId

Primary key of the alternative

string eRPProductKey

Primary key of the product in the ProductProvider

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteLine>

The updated quote line.

CreateQuoteLineFromProductAsync(int, Product, CancellationToken)

Create a quoteline based on a product.

Declaration
Task<QuoteLine> CreateQuoteLineFromProductAsync(int quoteAlternativeId, Product product, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteAlternativeId

Primary key of the alternative

Product product

Product carrier

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteLine>

The updated quote line.

DeleteConnectionAsync(int, CancellationToken)

Marks a connection as deleted.

Declaration
Task DeleteConnectionAsync(int quoteConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

Primary key of the connection to delete

CancellationToken cancellationToken
Returns
Type Description
Task

A void return

DeletePriceListAsync(int, CancellationToken)

Deletes the PriceList

Declaration
Task DeletePriceListAsync(int priceListId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int priceListId

The identity of the PriceList

CancellationToken cancellationToken
Returns
Type Description
Task

This method has no return value

DeleteProductAsync(int, CancellationToken)

Deletes the Product

Declaration
Task DeleteProductAsync(int productId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int productId

The identity of the Product

CancellationToken cancellationToken
Returns
Type Description
Task

This method has no return value

DeleteQuoteAlternativeAsync(int, CancellationToken)

Delete a quote alternative

Declaration
Task DeleteQuoteAlternativeAsync(int quoteAlternativeId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteAlternativeId

Id of the quote alternative to delete.

CancellationToken cancellationToken
Returns
Type Description
Task

A void return

DeleteQuoteAsync(int, CancellationToken)

Delete a Quote

Declaration
Task DeleteQuoteAsync(int quoteId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteId

QuoteId of the Quote to delete.

CancellationToken cancellationToken
Returns
Type Description
Task

DeleteQuoteLineAsync(int, CancellationToken)

Deletes the QuoteLine in the SuperOffice database

Declaration
Task DeleteQuoteLineAsync(int quoteLineId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteLineId

Primary key of the quoteline to delete

CancellationToken cancellationToken
Returns
Type Description
Task

Nothing

DeleteQuoteLinesAsync(int[], CancellationToken)

Delete the QuoteLines in the SuperOffice database

Declaration
Task DeleteQuoteLinesAsync(int[] quoteLineIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int[] quoteLineIds

Primary keys of the quotelines to delete

CancellationToken cancellationToken
Returns
Type Description
Task

Nothing

DeleteSaleTypeQuoteAttachmentAsync(int, CancellationToken)

Deletes the sale type quote attachment with the given id

Declaration
Task DeleteSaleTypeQuoteAttachmentAsync(int saleTypeQuoteAttachmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int saleTypeQuoteAttachmentId

The ID of the sale type quote attachment row to delete

CancellationToken cancellationToken
Returns
Type Description
Task

FindProductAsync(int, string, string, CancellationToken)

Gets a product, from the ProductProvider

Declaration
Task<Product[]> FindProductAsync(int quoteAlternativeId, string userInput, string priceListKey, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteAlternativeId

Quote alternative to search in.

string userInput

search string

string priceListKey

If the pricelist is null or empty, the function will search in all active pricelists.

CancellationToken cancellationToken
Returns
Type Description
Task<Product[]>

Product array

GenerateQuoteDocumentsAsync(int, int, bool, int, bool, string, CancellationToken)

Generate all the documents required to send the Quote as an email to the prospect - or an Order Confirmation; it just depends on the template id's for the lines doc and mail body. Quote version status is not changed by this method.

Declaration
Task<QuotePublishDocuments> GenerateQuoteDocumentsAsync(int quoteVersionId, int emailBodyTemplateId, bool attachMainDocument, int quotedProductsTemplateId, bool includeAttachments, string rawMailSubject, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

VersionId of the quote to be sent; the status of the version will not be changed by calling this method

int emailBodyTemplateId

Id of the template for the email body, must be nonzero and refer to either a Quote mail body or Order Confirmation mail body, with html content

bool attachMainDocument

Should the main quote document be attached to the email; generally false for Order Confirmations

int quotedProductsTemplateId

Id of the template for the quote- or order confirmation-lines; zero if no document should be produced

bool includeAttachments

If true, then the currently specified (in the database) attachments will be included

string rawMailSubject

Subject line for email, in the correct language, sent in here to have any template variables substituted

CancellationToken cancellationToken
Returns
Type Description
Task<QuotePublishDocuments>

Carrier specifying the document id's of all the documents, as well as other results

GetActivePriceListsAsync(int, string, CancellationToken)

Gets the available active PriceLists in a specific currency. Will return empty array if there is no PriceList with the stated currency available.

Declaration
Task<PriceList[]> GetActivePriceListsAsync(int quoteConnectionId, string currency, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

Primary key of the connection

string currency

Iso currency like: USD or NOK. See http://www.currency-iso.org/dl_iso_table_a1.xls for details. Case insensitive. Will return empty array if there is no PriceList with the stated currency available.

CancellationToken cancellationToken
Returns
Type Description
Task<PriceList[]>

The PriceLists that supports a specific currency

GetActivePriceListsByCurrencyIdAsync(int, int, CancellationToken)

Gets the available active PriceLists in a specific currency. Will return empty array if there is no PriceList with the stated currency available.

Declaration
Task<PriceList[]> GetActivePriceListsByCurrencyIdAsync(int quoteConnectionId, int currencyId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

Primary key of the connection

int currencyId

SuperOffice currency id.

CancellationToken cancellationToken
Returns
Type Description
Task<PriceList[]>

The PriceLists that supports a specific currency

GetAllAvailableQuoteConnectionsAsync(CancellationToken)

Get all available connections. Some installed connections may not be available to the user. Use GetAllAvailableQuoteConnectionsWithPriceLists if you need the pricelists on the connections as well.

Declaration
Task<QuoteConnection[]> GetAllAvailableQuoteConnectionsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<QuoteConnection[]>

List of connections

GetAllAvailableQuoteConnectionsWithPriceListsAsync(CancellationToken)

Get all available connections. Some installed connections may not be available to the user. Includes pricelists for the connection. This is a heavy call

Declaration
Task<QuoteConnection[]> GetAllAvailableQuoteConnectionsWithPriceListsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<QuoteConnection[]>

List of connections

GetAllInstalledQuoteConnectionsAsync(CancellationToken)

Get all installed connections. Some installed connections may not be available to the user.

Declaration
Task<QuoteConnection[]> GetAllInstalledQuoteConnectionsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<QuoteConnection[]>

List of connections

GetAllPriceListsAsync(int, string, CancellationToken)

Gets the all PriceLists in all currencies, including those inactive. Will return empty array if there is no PriceList available.

Declaration
Task<PriceList[]> GetAllPriceListsAsync(int quoteConnectionId, string currency, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

Primary key of the connection

string currency

Iso currency like: USD or NOK. See http://www.currency-iso.org/dl_iso_table_a1.xls for details. Case insensitive. Will return empty array if there is no PriceList with the stated currency available.

CancellationToken cancellationToken
Returns
Type Description
Task<PriceList[]>

The PriceLists that supports a specific currency

GetAllPriceListsByCurrencyIdAsync(int, int, CancellationToken)

Gets the all PriceLists in all currencies, including those inactive. Will return empty array if there is no PriceList available.

Declaration
Task<PriceList[]> GetAllPriceListsByCurrencyIdAsync(int quoteConnectionId, int currencyId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

Primary key of the connection

int currencyId

SuperOffice currency id.

CancellationToken cancellationToken
Returns
Type Description
Task<PriceList[]>

The PriceLists that supports a specific currency

GetAllQuoteLineConfigurationsAsync(CancellationToken)

Returns all the configuration fields

Declaration
Task<QuoteLineConfiguration[]> GetAllQuoteLineConfigurationsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<QuoteLineConfiguration[]>

Array of QuoteLineConfigurations

GetConfigurationFieldsAsync(int, string, CancellationToken)

Used by ADMIN. Asks for metadata needed to populate admin dialog that takes in the information needed to create a connection to an ERP system. The values entered in the dialog are stored in SuperOffice db and used when InitializeConnector is called by the client.

Declaration
Task<FieldMetadataDictionary> GetConfigurationFieldsAsync(int connectionId, string connectorName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int connectionId

Id of an existing connection, if any. Initializes connection with current config values if non-zero.

string connectorName

Name of the connector. Ignored if connectionId is non-zero.

CancellationToken cancellationToken
Returns
Type Description
Task<FieldMetadataDictionary>

carriers

GetConnectionAsync(int, CancellationToken)

Returns the specified connection.

Declaration
Task<QuoteConnection> GetConnectionAsync(int quoteConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

Primary key of the connection

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteConnection>

The connection

GetConnectionConfigFieldsAsync(int, CancellationToken)

Returns the config fields for the connection.

Declaration
Task<StringDictionary> GetConnectionConfigFieldsAsync(int quoteConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

Primary key of the connection

CancellationToken cancellationToken
Returns
Type Description
Task<StringDictionary>

Config Fields

GetConnectionStartupErrorsAsync(CancellationToken)

Returns an array of PluginResponseInfos for all failed connection initializations.

Declaration
Task<PluginResponse[]> GetConnectionStartupErrorsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<PluginResponse[]>

Array of PluginResponseInfos for each failed connection initialization.

GetConnectionStartupResponseAsync(int, CancellationToken)

Returns the PluginResponseInfo for the connection initialization. Does not initialize the connection, just returns what happened when initialize was called.

Declaration
Task<PluginResponse> GetConnectionStartupResponseAsync(int quoteConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

Primary key of the connection

CancellationToken cancellationToken
Returns
Type Description
Task<PluginResponse>

PluginResponseInfo for the connection initialization.

GetConnectionsForAssociateAsync(int, CancellationToken)

Returns all connections available for the specified user.

Declaration
Task<QuoteConnection[]> GetConnectionsForAssociateAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int associateId

Primary key of the user

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteConnection[]>

The connections

GetConnectorCapabilitiesAsync(int, CancellationToken)

Gets a list of connector capabilities

Declaration
Task<string[]> GetConnectorCapabilitiesAsync(int quoteConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

Primary key of the connection

CancellationToken cancellationToken
Returns
Type Description
Task<string[]>

Capabilities

GetConnectorCapabilityNamesAsync(int, CancellationToken)

Gets a list of all possible connector capabilities

Declaration
Task<string[]> GetConnectorCapabilityNamesAsync(int quoteConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

Primary key of the connection

CancellationToken cancellationToken
Returns
Type Description
Task<string[]>

Capabilities names

GetExtraInfoAsync(string, CancellationToken)

Converts an xml string into an object representation.

Declaration
Task<ProductExtraDataField[]> GetExtraInfoAsync(string quoteLineExtraData, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string quoteLineExtraData

The extra data as xml.

CancellationToken cancellationToken
Returns
Type Description
Task<ProductExtraDataField[]>

An object representation on the xml

GetInUseQuoteLineConfigurationsAsync(CancellationToken)

Returns the configuration fields that should be visible in the GUI.

Declaration
Task<QuoteLineConfiguration[]> GetInUseQuoteLineConfigurationsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<QuoteLineConfiguration[]>

Array of QuoteLineConfigurations

GetOrderConfirmationAsync(int, int, CancellationToken)

Get a base64-encoded data stream that is just the order confirmation document, for the given quote version; no permanent document is created or stored anywhere; the result is a PDF

Declaration
Task<string> GetOrderConfirmationAsync(int quoteVersionId, int confirmationTemplateId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

VersionId of the quote to be sent; the status of the version will not be changed by calling this method

int confirmationTemplateId

Id of the template for the order confirmation lines document

CancellationToken cancellationToken
Returns
Type Description
Task<string>

Base64-encoded binary data, that is in fact a PDF document that should be shown to the user

GetOrderStateAsync(int, CancellationToken)

If there is a problem with a quoteline, the error description shall be placed in the status and reason fields of the quoteline, if there is a problem with the alternative, the error description shall be placed in the status and reason fields of the alternative. A summary of all the problems (if any) should be placed in the response object. Requires that the Create-Order capability is true.

Declaration
Task<PluginUrlResponse> GetOrderStateAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

the QuoteVersionId of the ordered version.

CancellationToken cancellationToken
Returns
Type Description
Task<PluginUrlResponse>

The order state. If a new quoteversion is created, the QuoteVersionId will be found in Changes.AddedRecords.

GetPriceListAsync(int, CancellationToken)

Gets a PriceList object.

Declaration
Task<PriceList> GetPriceListAsync(int priceListId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int priceListId

The identifier of the PriceList object

CancellationToken cancellationToken
Returns
Type Description
Task<PriceList>

A single PriceList

GetProductAsync(int, string, CancellationToken)

Get a product with the given key

Declaration
Task<Product> GetProductAsync(int quoteConnectionId, string eRPProductKey, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

The connection this product comes from.

string eRPProductKey

Primary key of the Product in the ProductProvider

CancellationToken cancellationToken
Returns
Type Description
Task<Product>

GetProductFromDbIdAsync(int, CancellationToken)

Get a product with the given database id

Declaration
Task<Product> GetProductFromDbIdAsync(int productId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int productId

The database id of the product

CancellationToken cancellationToken
Returns
Type Description
Task<Product>

The product info

GetProductImageAsync(int, string, int, CancellationToken)

Gets an image connected to a product, from the ProductProvider

Declaration
Task<string> GetProductImageAsync(int quoteConnectionId, string eRPProductKey, int rank, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

The connection this product comes from.

string eRPProductKey

Primary key of the Product in the ProductProvider

int rank

The rank of the image.

CancellationToken cancellationToken
Returns
Type Description
Task<string>

The base64 encoded image as a string.

GetQuoteAlternativeAsync(int, CancellationToken)

Gets a QuoteAlternative object.

Declaration
Task<QuoteAlternative> GetQuoteAlternativeAsync(int quoteAlternativeId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteAlternativeId

The identifier of the QuoteAlternative object

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteAlternative>

A single QuoteAlternative

GetQuoteAlternativesAsync(int, CancellationToken)

Get all quote alternatives for a quote version

Declaration
Task<QuoteAlternative[]> GetQuoteAlternativesAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

QuoteVersionId of the revison to get alternatives for.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteAlternative[]>

Array of Quote alternatives

GetQuoteAsync(int, CancellationToken)

Get a Quote

Declaration
Task<Quote> GetQuoteAsync(int quoteId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteId

QuoteId of the Quote to get.

CancellationToken cancellationToken
Returns
Type Description
Task<Quote>

The Quote

GetQuoteEntityAsync(int, CancellationToken)

Get a Quote

Declaration
Task<QuoteEntity> GetQuoteEntityAsync(int quoteId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteId

QuoteId of the Quote to get.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteEntity>

The Quote

GetQuoteEntityFromSaleIdAsync(int, CancellationToken)

Get a Quote for a sale

Declaration
Task<QuoteEntity> GetQuoteEntityFromSaleIdAsync(int saleId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int saleId

SaleId of the Quote to get.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteEntity>

The Quote

GetQuoteFromSaleIdAsync(int, CancellationToken)

Get a Quote for a sale

Declaration
Task<Quote> GetQuoteFromSaleIdAsync(int saleId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int saleId

SaleId of the Quote to get.

CancellationToken cancellationToken
Returns
Type Description
Task<Quote>

The Quote

GetQuoteLineAsync(int, CancellationToken)

Get QuoteLine from database

Declaration
Task<QuoteLine> GetQuoteLineAsync(int quoteLineId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteLineId

Primary key of the quoteline to get.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteLine>

The updated quote line (If the quoteline was new, it returns with id's set.

GetQuoteLineConfigurationAsync(int, CancellationToken)

Returns the configuration field with the given id

Declaration
Task<QuoteLineConfiguration> GetQuoteLineConfigurationAsync(int quoteLineConfigurationId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteLineConfigurationId

Id of the QuoteLineConfiguration to get.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteLineConfiguration>

QuoteLineConfiguration

GetQuoteLineConfigurationFromFieldNameAsync(string, CancellationToken)

Returns the configuration field with the given field name

Declaration
Task<QuoteLineConfiguration> GetQuoteLineConfigurationFromFieldNameAsync(string fieldName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string fieldName

Field name of the QuoteLineConfiguration to get.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteLineConfiguration>

QuoteLineConfiguration

GetQuoteLinesAsync(int, CancellationToken)

Get all QuoteLines from an alternative

Declaration
Task<QuoteLine[]> GetQuoteLinesAsync(int quoteAlternativeId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteAlternativeId

Id of the alternative to return the quotelines for

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteLine[]>

QuoteLine array

GetQuoteVersionAsync(int, CancellationToken)

Get a QuoteVersion

Declaration
Task<QuoteVersion> GetQuoteVersionAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

QuoteVersionId to get information from

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteVersion>

Array of Quote versions

GetQuoteVersionWorkflowButtonStatesAsync(int, int, CancellationToken)

Get all button states for the Quote version dialog.

Declaration
Task<QuoteVersionWorkflowState> GetQuoteVersionWorkflowButtonStatesAsync(int quoteVersionId, int quoteAlternativeId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

Id of the quote version to get the button states for.

int quoteAlternativeId

Id of the active quote alternative id.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteVersionWorkflowState>

Workflow state information

GetQuoteVersionWorkflowImageStateAsync(int, CancellationToken)

Get state icon and name for the Quote version dialog header.

Declaration
Task<QuoteVersionButtonState> GetQuoteVersionWorkflowImageStateAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

Id of the quote version to get the version state for.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteVersionButtonState>

Image and state name information

GetQuoteVersionWorkflowStateAsync(int, int, CancellationToken)

Get all button states for the Quote version dialog. Packages ImageState, Button states and status info into one call. Collects most important warnings/errors from across all quotelines/alternatives in this quote version.

Declaration
Task<QuoteVersionWorkflowState> GetQuoteVersionWorkflowStateAsync(int quoteVersionId, int quoteAlternativeId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

Id of the quote version to get the button states for.

int quoteAlternativeId

Id of the active quote alternative id.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteVersionWorkflowState>

Workflow state information

GetQuoteVersionWorkflowStatusInfoAsync(int, CancellationToken)

Get status info for the Quote version dialog header. Collects most important warnings/errors from across all quotelines/alternatives in this quote version.

Declaration
Task<QuoteVersionStatusInformation> GetQuoteVersionWorkflowStatusInfoAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

Id of the quote version to get the status info for.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteVersionStatusInformation>

Most important status text + icon information.

GetQuoteVersionsAsync(int, CancellationToken)

Get all quote versions for a sale

Declaration
Task<QuoteVersion[]> GetQuoteVersionsAsync(int quoteId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteId

QuoteId of the quote to get versions from

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteVersion[]>

Array of Quote versions

HasConnectionsAsync(CancellationToken)

Whether or not the system has any connections available for this user.

Declaration
Task<PluginResponse> HasConnectionsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<PluginResponse>

The response

IncludeQuoteVersionAttachmentAsync(int, int, bool, CancellationToken)

Toggle the 'included' state of a quote version attachment; will throw exceptions if called on locked versions

Declaration
Task<bool> IncludeQuoteVersionAttachmentAsync(int quoteVersionId, int documentId, bool include, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

The ID of the Quote version

int documentId

The ID of the document

bool include

Desired state

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

The new state

MoveQuoteLineAsync(int, bool, CancellationToken)

Move quote line rank up/down

Declaration
Task MoveQuoteLineAsync(int quoteLineId, bool direction, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteLineId

Id of quote line to move up/down

bool direction

True is up, false is down

CancellationToken cancellationToken
Returns
Type Description
Task

Void return

PlaceOrderAsync(int, bool, string, string, string, CancellationToken)

Place an order in the ERP system.

Declaration
Task<PluginUrlResponse> PlaceOrderAsync(int quoteAlternativeId, bool markSaleAsSold, string poNumber, string orderComment, string culture, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteAlternativeId

Id of the alternative to place the order on.

bool markSaleAsSold

Should the state of the owning Sale be set to sold

string poNumber

Purchase order number, saved to Quote record

string orderComment

Order comment, saved to Quote record

string culture

Desired culture for email body and other culture-sensitive templates/content

CancellationToken cancellationToken
Returns
Type Description
Task<PluginUrlResponse>

Status for the placed order: OkWithInfo / Warn / Error with message or URL to open.

RecalculateQuoteAlternativeAsync(int, CancellationToken)

When the user changes one or more values in a quoteline or a quoteAlternative, the connector gets to change the QuoteLines and the alternative, for instance calculate VAT. RecalculateQuoteAlternative shall be called when the user changes any of the following fields: Quantity, DiscountAmount, DiscountPercent, listprice (if allowed). RecalculateQuoteAlternative will calculate the TotalPrice and the VAT (if possible) for the lines and the alternative.

Declaration
Task<QuoteAlternativeRecalculated> RecalculateQuoteAlternativeAsync(int quoteAlternative, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteAlternative

The alternative to be recalculated

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteAlternativeRecalculated>

The updated quote version.

RecalculateQuoteLineAsync(QuoteLine, string[], CancellationToken)

When the user changes one or more values in a quoteline, the connector gets to change the QuoteLine, for instance calculate VAT. Shall be called when the user changes any of the following fields: Quantity, DiscountAmount, DiscountPercent, ListPrice (if allowed). Will calculate the TotalPrice and the VAT (if possible) for the line.

Declaration
Task<QuoteLine> RecalculateQuoteLineAsync(QuoteLine quoteLine, string[] changedFields, CancellationToken cancellationToken = default)
Parameters
Type Name Description
QuoteLine quoteLine

The QuoteLine to recalculate

string[] changedFields

The id of the changed fields in the form 'TableName.FieldName'

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteLine>

The updated quote line.

RejectQuoteVersionAsync(int, string, int, string, CancellationToken)

Rejects a quote version

Declaration
Task<ApproveRejectResponse> RejectQuoteVersionAsync(int quoteVersionId, string rejectedByText, int rejectedByAssociateId, string rejectionText, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

QuoteVersionId to approve.

string rejectedByText

'Rejected by' prefix to RejectionText used when creating appointment task to log rejection. Must be passed since service does not know which language to use for 'Rejected By' string.

int rejectedByAssociateId

AssociateId of the associate who rejected the quote version.

string rejectionText

Rejection text.

CancellationToken cancellationToken
Returns
Type Description
Task<ApproveRejectResponse>

Response of the the operation

RemoveProductAsync(int, CancellationToken)

Removes a product from the database

Declaration
Task RemoveProductAsync(int productId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int productId

The database id of the product to remove

CancellationToken cancellationToken
Returns
Type Description
Task

RequestApprovalAsync(int, int, string, CancellationToken)

Notifies specified associate that this quote needs approval.

Declaration
Task<PluginResponse> RequestApprovalAsync(int quoteVersionId, int associateId, string comment, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

The quoteversion to be approved.

int associateId

The associate that should be notified.

string comment

Details or reason for request

CancellationToken cancellationToken
Returns
Type Description
Task<PluginResponse>

Response of the the operation

RestoreConnectionAsync(int, CancellationToken)

Restores a connection marked as deleted.

Declaration
Task RestoreConnectionAsync(int quoteConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

Primary key of the connection to restore

CancellationToken cancellationToken
Returns
Type Description
Task

A void return

SaveConnectionAsync(QuoteConnection, CancellationToken)

Saves a connection to the database.

Declaration
Task<QuoteConnection> SaveConnectionAsync(QuoteConnection connection, CancellationToken cancellationToken = default)
Parameters
Type Name Description
QuoteConnection connection

The connection to save.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteConnection>

The resulting connection.

SaveConnectionConfigFieldsAsync(int, StringDictionary, CancellationToken)

Saves the connection config fields

Declaration
Task<StringDictionary> SaveConnectionConfigFieldsAsync(int quoteConnectionId, StringDictionary connectionConfigFields, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteConnectionId

Primary key of the connection

StringDictionary connectionConfigFields

ConnectionConfigFields to save.

CancellationToken cancellationToken
Returns
Type Description
Task<StringDictionary>

Config Fields

SavePriceListAsync(PriceList, CancellationToken)

Updates the existing PriceList or creates a new PriceList if the id parameter is 0.

Declaration
Task<PriceList> SavePriceListAsync(PriceList priceList, CancellationToken cancellationToken = default)
Parameters
Type Name Description
PriceList priceList

The PriceList that is saved

CancellationToken cancellationToken
Returns
Type Description
Task<PriceList>

New or updated PriceList

SaveProductAsync(Product, CancellationToken)

Updates the existing Product or creates a new Product if the id parameter is 0.

Declaration
Task<Product> SaveProductAsync(Product product, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Product product

The Product that is saved

CancellationToken cancellationToken
Returns
Type Description
Task<Product>

New or updated Product

SaveQuoteAlternativeAsync(QuoteAlternative, CancellationToken)

Updates the existing QuoteAlternative or creates a new QuoteAlternative if the id parameter is 0.

Declaration
Task<QuoteAlternative> SaveQuoteAlternativeAsync(QuoteAlternative quoteAlternative, CancellationToken cancellationToken = default)
Parameters
Type Name Description
QuoteAlternative quoteAlternative

The QuoteAlternative that is saved

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteAlternative>

New or updated QuoteAlternative

SaveQuoteAsync(Quote, CancellationToken)

Saves a Quote

Declaration
Task<Quote> SaveQuoteAsync(Quote quote, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Quote quote

The Quote to save

CancellationToken cancellationToken
Returns
Type Description
Task<Quote>

The saved Quote

SaveQuoteEntityAsync(QuoteEntity, CancellationToken)

Saves a QuoteEntity. Versions and alternatives will not be saved by this call.

Declaration
Task<QuoteEntity> SaveQuoteEntityAsync(QuoteEntity quoteEntity, CancellationToken cancellationToken = default)
Parameters
Type Name Description
QuoteEntity quoteEntity

The Quote entity to save

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteEntity>

The saved Quote

SaveQuoteLineAsync(QuoteLine, CancellationToken)

Saves the QuoteLine in the SuperOffice database

Declaration
Task<QuoteLine> SaveQuoteLineAsync(QuoteLine quoteLine, CancellationToken cancellationToken = default)
Parameters
Type Name Description
QuoteLine quoteLine

The QuoteLine to save.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteLine>

The updated quote line (If the quoteline was new, it returns with id's set.

SaveQuoteLineConfigurationAsync(QuoteLineConfiguration, CancellationToken)

Save a QuoteLineConfiguration object. It is not possible to add a new configuration.

Declaration
Task<QuoteLineConfiguration> SaveQuoteLineConfigurationAsync(QuoteLineConfiguration quoteLineConfiguration, CancellationToken cancellationToken = default)
Parameters
Type Name Description
QuoteLineConfiguration quoteLineConfiguration

The QuoteLineConfiguration to save.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteLineConfiguration>

The saved QuoteLineConfiguration.

SaveQuoteLineConfigurationsAsync(QuoteLineConfiguration[], CancellationToken)

Save a collection of QuoteLineConfigurations. It is not possible to add a new configurations.

Declaration
Task<QuoteLineConfiguration[]> SaveQuoteLineConfigurationsAsync(QuoteLineConfiguration[] quoteLineConfigurations, CancellationToken cancellationToken = default)
Parameters
Type Name Description
QuoteLineConfiguration[] quoteLineConfigurations

The QuoteLineConfigurations to save.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteLineConfiguration[]>

The saved QuoteLineConfigurations.

SaveQuoteLinesAsync(QuoteLine[], CancellationToken)

Saves the QuoteLines in the SuperOffice database

Declaration
Task<QuoteLine[]> SaveQuoteLinesAsync(QuoteLine[] quoteLines, CancellationToken cancellationToken = default)
Parameters
Type Name Description
QuoteLine[] quoteLines

The QuoteLines to save.

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteLine[]>

The updated quote lines (If the quoteline was new, it returns with id's set.

SaveQuoteVersionAsync(QuoteVersion, CancellationToken)

Saves a quote version

Declaration
Task<QuoteVersion> SaveQuoteVersionAsync(QuoteVersion quoteVersion, CancellationToken cancellationToken = default)
Parameters
Type Name Description
QuoteVersion quoteVersion

The quote version to save

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteVersion>

The saved quote version

SaveQuoteVersionNumberAsync(int, string, CancellationToken)

Save the quote version number if it is valid

Declaration
Task<bool> SaveQuoteVersionNumberAsync(int quoteVersionId, string number, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

VersionId of the quote version

string number

The number to save

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

True if the number was valid and then saved

SendQuoteVersionAsync(int, DateTime, DateTime, string, string, CancellationToken)

Send the quote to the user's customer. More parameters to be added later...

Declaration
Task<PluginUrlResponse> SendQuoteVersionAsync(int quoteVersionId, DateTime expiryDate, DateTime followupDate, string followupText, string culture, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

QuoteVersionId of the quoteversion to send

DateTime expiryDate

Date the quote expires

DateTime followupDate

Date for the followup task, to remind the sales rep about the quote

string followupText

The body text for the follwup appointment, resolved to the correct culture (no resources please)

string culture

Desired culture for email body and other culture-sensitive templates/content

CancellationToken cancellationToken
Returns
Type Description
Task<PluginUrlResponse>

Response of the operation

TestConnectionAsync(string, StringDictionary, CancellationToken)

Used by the Admin clients. Testing if the connection data is sufficient to get a connection with the ERP system. The Connector should try to do some operations to check if the connection has sufficient rights to run. The connection has not been created yet. TestConnection is called without InitializeConnector being called first.

Declaration
Task<PluginResponse> TestConnectionAsync(string connectorName, StringDictionary connectionData, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string connectorName

Name of the connector.

StringDictionary connectionData

Basically the name/value collection of the configuration data requested to create a connection

CancellationToken cancellationToken
Returns
Type Description
Task<PluginResponse>

How the test went

ToggleProductInAssortmentAsync(int, CancellationToken)

Toggles if the prdouct is in assortment or not

Declaration
Task ToggleProductInAssortmentAsync(int productId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int productId

The database id of the product to toggle is assortment value of

CancellationToken cancellationToken
Returns
Type Description
Task

ToggleQuoteVersionAttachmentIncludedAsync(int, CancellationToken)

Toggle the 'included' state of a quote version attachment

Declaration
Task<bool> ToggleQuoteVersionAttachmentIncludedAsync(int quoteVersionAttachmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionAttachmentId

The ID of the quote version attachment row

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

The new state

ToggleSaleTypeQuoteAttachmentDefaultIncludedAsync(int, CancellationToken)

Toggle the 'default included' state of a sale type quote attachment

Declaration
Task<bool> ToggleSaleTypeQuoteAttachmentDefaultIncludedAsync(int saleTypeQuoteAttachmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int saleTypeQuoteAttachmentId

The ID of the sale type quote attachment row

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

The new state

UpdateQuoteVersionPricesAsync(int, CancellationToken)

Update price on the all the quotelines for each alternative in the current quote version

Declaration
Task<QuoteVersionValidated> UpdateQuoteVersionPricesAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

The version to be update prices for

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteVersionValidated>

The updated quote version.

ValidateQuoteVersionAsync(int, QuoteVersionButtonAction, CancellationToken)

When the user changes one or more values in a quoteline or a quoteAlternative, the connector gets to change the QuoteLines and the alternative, for instance calculate VAT. ValidateQuoteVersion shall be called when the user presses the validate button, presses the send button or closes the quote dialog. RecalculateQuoteAlternative should typically validate all alternatives, set values in extrafields, and set the state in the version.

Declaration
Task<QuoteVersionValidated> ValidateQuoteVersionAsync(int quoteVersionId, QuoteVersionButtonAction action, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int quoteVersionId

The version to be validated

QuoteVersionButtonAction action

The action, if any, related to the validate call, like PlaceOrder or SendQuote

CancellationToken cancellationToken
Returns
Type Description
Task<QuoteVersionValidated>

The updated quote version.

© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top