Class NSQuoteAgent

Services for the Quote Management feature, part of the Sale module.

Examples

NSQuoteAgent agent;
agent.callMethod(arg1, arg2);

Constructors

NSQuoteAgent()

Services for the Quote Management feature, part of the Sale module.

Declaration

NSQuoteAgent

Examples

NSQuoteAgent agent;
agent.callMethod(arg1, arg2);

Methods

AddSaleTypeQuoteAttachment(Integer,Integer)

Adds a new quote attachment document to a sale type

Declaration

Integer AddSaleTypeQuoteAttachment(Integer saleTypeId, Integer documentId)

Examples

NSQuoteAgent agent;
Integer saleTypeId;
Integer documentId;
Integer res = agent.AddSaleTypeQuoteAttachment(saleTypeId, documentId);

Parameters

Type Name Description
Integer saleTypeId
Integer documentId

Returns

Type Description
Integer

ApproveQuoteVersion(Integer,String,Integer,String)

Approves a quote version

Declaration

NSApproveRejectResponse ApproveQuoteVersion(Integer quoteVersionId, String approvedByText, Integer approvedByAssociateId, String approvalText)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
String approvedByText;
Integer approvedByAssociateId;
String approvalText;
NSApproveRejectResponse res = agent.ApproveQuoteVersion(quoteVersionId, approvedByText, approvedByAssociateId, approvalText);

Parameters

Type Name Description
Integer quoteVersionId
String approvedByText
Integer approvedByAssociateId
String approvalText

Returns

Type Description
NSApproveRejectResponse

CanConnectorProvideCapability(Integer,String)

Declaration

Bool CanConnectorProvideCapability(Integer quoteConnectionId, String capabilityName)

Examples

NSQuoteAgent agent;
Integer quoteConnectionId;
String capabilityName;
Bool res = agent.CanConnectorProvideCapability(quoteConnectionId, capabilityName);

Parameters

Type Name Description
Integer quoteConnectionId
String capabilityName

Returns

Type Description
Bool Can the connector provide the capability.

CopyQuoteAlternative(Integer,Integer,String)

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

Declaration

NSQuoteAlternative CopyQuoteAlternative(Integer quoteVersionId, Integer quoteAlternativeId, String quoteAlternativeName)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
Integer quoteAlternativeId;
String quoteAlternativeName;
NSQuoteAlternative res = agent.CopyQuoteAlternative(quoteVersionId, quoteAlternativeId, quoteAlternativeName);

Parameters

Type Name Description
Integer quoteVersionId
Integer quoteAlternativeId
String quoteAlternativeName

Returns

Type Description
NSQuoteAlternative

CopySuperOfficePriceList(Integer,String,DateTime,DateTime,Integer,Bool)

Creates a copy of a PriceList in the SuperOffice database

Declaration

NSPriceList CopySuperOfficePriceList(Integer originalPriceListId, String newName, DateTime validFrom, DateTime validTo, Integer newCurrencyId, Bool convertCurrency)

Examples

NSQuoteAgent agent;
Integer originalPriceListId;
String newName;
DateTime validFrom;
DateTime validTo;
Integer newCurrencyId;
Bool convertCurrency;
NSPriceList res = agent.CopySuperOfficePriceList(originalPriceListId, newName, validFrom, validTo, newCurrencyId, convertCurrency);

Parameters

Type Name Description
Integer originalPriceListId
String newName
validFrom
validTo
Integer newCurrencyId
Bool convertCurrency

Returns

Type Description
NSPriceList

CreateAndSaveQuote(Integer,Integer,String)

Creates a new quote on a sale.

Declaration

NSQuoteEntity CreateAndSaveQuote(Integer saleId, Integer connectionId, String firstAlternativeName)

Examples

NSQuoteAgent agent;
Integer saleId;
Integer connectionId;
String firstAlternativeName;
NSQuoteEntity res = agent.CreateAndSaveQuote(saleId, connectionId, firstAlternativeName);

Parameters

Type Name Description
Integer saleId
Integer connectionId
String firstAlternativeName

Returns

Type Description
NSQuoteEntity

CreateAndSaveQuoteFromSale(Integer,Integer)

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

Declaration

NSQuoteEntity CreateAndSaveQuoteFromSale(Integer copyFromSaleId, Integer copyToSaleId)

Examples

NSQuoteAgent agent;
Integer copyFromSaleId;
Integer copyToSaleId;
NSQuoteEntity res = agent.CreateAndSaveQuoteFromSale(copyFromSaleId, copyToSaleId);

Parameters

Type Name Description
Integer copyFromSaleId
Integer copyToSaleId

Returns

Type Description
NSQuoteEntity

CreateAndSaveQuoteVersion(Integer)

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

Declaration

NSQuoteVersion CreateAndSaveQuoteVersion(Integer quoteVersionId)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
NSQuoteVersion res = agent.CreateAndSaveQuoteVersion(quoteVersionId);

Parameters

Type Name Description
Integer quoteVersionId

Returns

Type Description
NSQuoteVersion

CreateConnectionFromConnectorName(String)

Creates a new connection.

Declaration

NSQuoteConnection CreateConnectionFromConnectorName(String connectorName)

Examples

NSQuoteAgent agent;
String connectorName;
NSQuoteConnection res = agent.CreateConnectionFromConnectorName(connectorName);

Parameters

Type Name Description
String connectorName

Returns

Type Description
NSQuoteConnection

CreateDefaultPriceList()

Sets default values into a new NSPriceList.

Declaration

NSPriceList CreateDefaultPriceList()

Examples

NSQuoteAgent agent;
NSPriceList thing = agent.CreateDefaultPriceList();
thing = agent.SavePriceList(thing);

Returns

Type Description
NSPriceList

CreateDefaultProduct()

Sets default values into a new NSProduct.

Declaration

NSProduct CreateDefaultProduct()

Examples

NSQuoteAgent agent;
NSProduct thing = agent.CreateDefaultProduct();
thing = agent.SaveProduct(thing);

Returns

Type Description
NSProduct

CreateDefaultQuoteAlternative()

Sets default values into a new NSQuoteAlternative.

Declaration

NSQuoteAlternative CreateDefaultQuoteAlternative()

Examples

NSQuoteAgent agent;
NSQuoteAlternative thing = agent.CreateDefaultQuoteAlternative();
thing = agent.SaveQuoteAlternative(thing);

Returns

Type Description
NSQuoteAlternative

CreateOrUpdateQuoteVersionAttachments(Integer)

Looks at the Quote version, related sale and sale type, and ensures that the correct NSQuoteVersionAttachment records exist. This method may create or delete records

Declaration

NSQuoteVersionAttachment[] CreateOrUpdateQuoteVersionAttachments(Integer quoteVersionId)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
NSQuoteVersionAttachment[] res = agent.CreateOrUpdateQuoteVersionAttachments(quoteVersionId);

Parameters

Type Name Description
Integer quoteVersionId

Returns

Type Description
NSQuoteVersionAttachment[]

CreateQuoteAlternative(Integer,String,String)

Creates a new quote alternative on a version.

Declaration

NSQuoteAlternative CreateQuoteAlternative(Integer quoteVersionId, String quoteAlternativeName, String quoteAlternativeDescription)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
String quoteAlternativeName;
String quoteAlternativeDescription;
NSQuoteAlternative res = agent.CreateQuoteAlternative(quoteVersionId, quoteAlternativeName, quoteAlternativeDescription);

Parameters

Type Name Description
Integer quoteVersionId
String quoteAlternativeName
String quoteAlternativeDescription

Returns

Type Description
NSQuoteAlternative

CreateQuoteLine(Integer,String)

Creates a quoteline based on a product key.

Declaration

NSQuoteLine CreateQuoteLine(Integer quoteAlternativeId, String eRPProductKey)

Examples

NSQuoteAgent agent;
Integer quoteAlternativeId;
String eRPProductKey;
NSQuoteLine res = agent.CreateQuoteLine(quoteAlternativeId, eRPProductKey);

Parameters

Type Name Description
Integer quoteAlternativeId
String eRPProductKey

Returns

Type Description
NSQuoteLine

CreateQuoteLineFromProduct(Integer,NSProduct)

Creates a quoteline based on a product.

Declaration

NSQuoteLine CreateQuoteLineFromProduct(Integer quoteAlternativeId, NSProduct product)

Examples

NSQuoteAgent agent;
Integer quoteAlternativeId;
NSProduct product;
NSQuoteLine res = agent.CreateQuoteLineFromProduct(quoteAlternativeId, product);

Parameters

Type Name Description
Integer quoteAlternativeId
NSProduct product

Returns

Type Description
NSQuoteLine

DeleteConnection(Integer)

Marks a connection as deleted.

Declaration

Void DeleteConnection(Integer quoteConnectionId)

Examples

NSQuoteAgent agent;
Integer quoteConnectionId;
agent.DeleteConnection(quoteConnectionId);

Parameters

Type Name Description
Integer quoteConnectionId

Returns

Type Description
Void

DeletePriceList(Integer)

Deletes the NSPriceList

Declaration

Void DeletePriceList(Integer priceList)

Examples

NSQuoteAgent agent;
agent.DeletePriceList(123);

Parameters

Type Name Description
Integer priceList

Returns

Type Description
Void

DeleteProduct(Integer)

Deletes the NSProduct

Declaration

Void DeleteProduct(Integer product)

Examples

NSQuoteAgent agent;
agent.DeleteProduct(123);

Parameters

Type Name Description
Integer product

Returns

Type Description
Void

DeleteQuote(Integer)

Deletes a Quote

Declaration

Void DeleteQuote(Integer quoteId)

Parameters

Type Name Description
Integer quoteId

Returns

Type Description
Void

DeleteQuoteAlternative(Integer)

Deletes a quote alternative

Declaration

Void DeleteQuoteAlternative(Integer quoteAlternativeId)

Examples

NSQuoteAgent agent;
Integer quoteAlternativeId;
agent.DeleteQuoteAlternative(quoteAlternativeId);

Parameters

Type Name Description
Integer quoteAlternativeId

Returns

Type Description
Void

DeleteQuoteLine(Integer)

Deletes the QuoteLine in the SuperOffice database

Declaration

Void DeleteQuoteLine(Integer quoteLineId)

Examples

NSQuoteAgent agent;
Integer quoteLineId;
agent.DeleteQuoteLine(quoteLineId);

Parameters

Type Name Description
Integer quoteLineId

Returns

Type Description
Void

DeleteQuoteLines(Integer[])

Deletes the QuoteLines in the SuperOffice database

Declaration

Void DeleteQuoteLines(Integer[] quoteLineIds)

Examples

NSQuoteAgent agent;
Integer[] quoteLineIds;
agent.DeleteQuoteLines(quoteLineIds);

Parameters

Type Name Description
Integer[] quoteLineIds

Returns

Type Description
Void

DeleteSaleTypeQuoteAttachment(Integer)

Deletes the sale type quote attachment with the given ID

Declaration

Void DeleteSaleTypeQuoteAttachment(Integer saleTypeQuoteAttachmentId)

Parameters

Type Name Description
Integer saleTypeQuoteAttachmentId

Returns

Type Description
Void

FindProduct(Integer,String,String)

Gets a product, from the ProductProvider

Declaration

NSProduct[] FindProduct(Integer quoteAlternativeId, String userInput, String priceListKey)

Examples

NSQuoteAgent agent;
Integer quoteAlternativeId;
String userInput;
String priceListKey;
NSProduct[] res = agent.FindProduct(quoteAlternativeId, userInput, priceListKey);

Parameters

Type Name Description
Integer quoteAlternativeId
String userInput
String priceListKey

Returns

Type Description
NSProduct[]

GenerateQuoteDocuments(Integer,Integer,Bool,Integer,Bool,String)

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 IDs for the lines doc and mail body.

Declaration

NSQuotePublishDocuments GenerateQuoteDocuments(Integer quoteVersionId, Integer emailBodyTemplateId, Bool attachMainDocument, Integer quotedProductsTemplateId, Bool includeAttachments, String rawMailSubject)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
Integer emailBodyTemplateId;
Bool attachMainDocument;
Integer quotedProductsTemplateId;
Bool includeAttachments;
String rawMailSubject;
NSQuotePublishDocuments res = agent.GenerateQuoteDocuments(quoteVersionId, emailBodyTemplateId, attachMainDocument, quotedProductsTemplateId, includeAttachments, rawMailSubject);

Parameters

Type Name Description
Integer quoteVersionId
Integer emailBodyTemplateId
Bool attachMainDocument
Integer quotedProductsTemplateId
Bool includeAttachments
String rawMailSubject

Returns

Type Description
NSQuotePublishDocuments

GetActivePriceLists(Integer,String)

Gets the available active PriceLists in a specific currency.

Declaration

NSPriceList[] GetActivePriceLists(Integer quoteConnectionId, String currency)

Examples

NSQuoteAgent agent;
Integer quoteConnectionId;
String currency;
NSPriceList[] res = agent.GetActivePriceLists(quoteConnectionId, currency);

Parameters

Type Name Description
Integer quoteConnectionId
String currency

Returns

Type Description
NSPriceList[] Will return empty array if there is no PriceList with the stated currency available.

GetActivePriceListsByCurrencyId(Integer,Integer)

Gets the available active PriceLists in a specific currency.

Declaration

NSPriceList[] GetActivePriceListsByCurrencyId(Integer quoteConnectionId, Integer currencyId)

Examples

NSQuoteAgent agent;
Integer quoteConnectionId;
Integer currencyId;
NSPriceList[] res = agent.GetActivePriceListsByCurrencyId(quoteConnectionId, currencyId);

Parameters

Type Name Description
Integer quoteConnectionId
Integer currencyId

Returns

Type Description
NSPriceList[] Will return empty array if there is no PriceList with the stated currency available.

GetAllAvailableQuoteConnections()

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

Declaration

NSQuoteConnection[] GetAllAvailableQuoteConnections()

Examples

NSQuoteAgent agent;
NSQuoteConnection[] res = agent.GetAllAvailableQuoteConnections();

Returns

Type Description
NSQuoteConnection[]

GetAllAvailableQuoteConnectionsWithPriceLists()

Gets all available connections. Some installed connections may not be available to the user. Includes price lists for the connection.

Declaration

NSQuoteConnection[] GetAllAvailableQuoteConnectionsWithPriceLists()

Examples

NSQuoteAgent agent;
NSQuoteConnection[] res = agent.GetAllAvailableQuoteConnectionsWithPriceLists();

Returns

Type Description
NSQuoteConnection[]

GetAllInstalledQuoteConnections()

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

Declaration

NSQuoteConnection[] GetAllInstalledQuoteConnections()

Examples

NSQuoteAgent agent;
NSQuoteConnection[] res = agent.GetAllInstalledQuoteConnections();

Returns

Type Description
NSQuoteConnection[]

GetAllPriceLists(Integer,String)

Gets the all PriceLists in all currencies, including those inactive.

Declaration

NSPriceList[] GetAllPriceLists(Integer quoteConnectionId, String currency)

Examples

NSQuoteAgent agent;
Integer quoteConnectionId;
String currency;
NSPriceList[] res = agent.GetAllPriceLists(quoteConnectionId, currency);

Parameters

Type Name Description
Integer 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.

Returns

Type Description
NSPriceList[] Will return an empty array if there is no PriceList with the stated currency available.

GetAllPriceListsByCurrencyId(Integer,Integer)

Gets the all PriceLists in all currencies, including those inactive.

Declaration

NSPriceList[] GetAllPriceListsByCurrencyId(Integer quoteConnectionId, Integer currencyId)

Examples

NSQuoteAgent agent;
Integer quoteConnectionId;
Integer currencyId;
NSPriceList[] res = agent.GetAllPriceListsByCurrencyId(quoteConnectionId, currencyId);

Parameters

Type Name Description
Integer quoteConnectionId
Integer currencyId

Returns

Type Description
NSPriceList[] Will return empty array if there is no PriceList available.

GetAllQuoteLineConfigurations()

Returns all the configuration fields

Declaration

NSQuoteLineConfiguration[] GetAllQuoteLineConfigurations()

Examples

NSQuoteAgent agent;
NSQuoteLineConfiguration[] res = agent.GetAllQuoteLineConfigurations();

Returns

Type Description
NSQuoteLineConfiguration[]

GetConfigurationFields(Integer,String)

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 the SuperOffice database and used when InitializeConnector is called by the client.

Declaration

Map GetConfigurationFields()

Examples

NSQuoteAgent agent;
Integer connectionId;
String connectorName;
Map res = agent.GetConfigurationFields(connectionId, connectorName);

Parameters

Type Name Description
Integer 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.

Returns

Type Description

GetConnection(Integer)

Returns the specified connection.

Declaration

NSQuoteConnection GetConnection(Integer quoteConnectionId)

Examples

NSQuoteAgent agent;
Integer quoteConnectionId;
NSQuoteConnection res = agent.GetConnection(quoteConnectionId);

Parameters

Type Name Description
Integer quoteConnectionId

Returns

Type Description
NSQuoteConnection

GetConnectionConfigFields(Integer)

Returns the config fields for the connection.

Declaration

Map GetConnectionConfigFields(Integer quoteConnectionId)

Examples

NSQuoteAgent agent;
Integer quoteConnectionId;
Map res = agent.GetConnectionConfigFields(quoteConnectionId);

Parameters

Type Name Description
Integer quoteConnectionId Primary key of the connection.

Returns

Type Description

GetConnectionsForAssociate(Integer)

Returns all connections available for the specified user.

Declaration

NSQuoteConnection[] GetConnectionsForAssociate(Integer associateId)

Examples

NSQuoteAgent agent;
Integer associateId;
NSQuoteConnection[] res = agent.GetConnectionsForAssociate(associateId);

Parameters

Type Name Description
Integer associateId

Returns

Type Description
NSQuoteConnection[]

GetConnectionStartupErrors()

Returns an array of PluginResponseInfos for all failed connection initializations.

Declaration

NSPluginResponse[] GetConnectionStartupErrors()

Examples

NSQuoteAgent agent;
NSPluginResponse[] res = agent.GetConnectionStartupErrors();

Returns

Type Description
NSPluginResponse[]

GetConnectionStartupResponse(Integer)

Returns the PluginResponseInfo for the connection initialization.

Declaration

NSPluginResponse GetConnectionStartupResponse(Integer quoteConnectionId)

Examples

NSQuoteAgent agent;
Integer quoteConnectionId;
NSPluginResponse res = agent.GetConnectionStartupResponse(quoteConnectionId);

Parameters

Type Name Description
Integer quoteConnectionId

Returns

Type Description
NSPluginResponse

GetConnectorCapabilities(Integer)

Gets a list of connector capabilities

Declaration

String[] GetConnectorCapabilities(Integer quoteConnectionId)

Examples

NSQuoteAgent agent;
Integer quoteConnectionId;
String[] res = agent.GetConnectorCapabilities(quoteConnectionId);

Parameters

Type Name Description
Integer quoteConnectionId

Returns

Type Description
String[]

GetConnectorCapabilityNames(Integer)

Gets a list of all possible connector capabilities

Declaration

String[] GetConnectorCapabilityNames(Integer quoteConnectionId)

Examples

NSQuoteAgent agent;
Integer quoteConnectionId;
String[] res = agent.GetConnectorCapabilityNames(quoteConnectionId);

Parameters

Type Name Description
Integer quoteConnectionId

Returns

Type Description
String[]

GetExtraInfo(String)

Converts an XML string into an object representation.

Declaration

NSProductExtraDataField[] GetExtraInfo(String quoteLineExtraData)

Examples

NSQuoteAgent agent;
String quoteLineExtraData;
NSProductExtraDataField[] res = agent.GetExtraInfo(quoteLineExtraData);

Parameters

Type Name Description
String quoteLineExtraData

Returns

Type Description
NSProductExtraDataField[]

GetInUseQuoteLineConfigurations()

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

Declaration

NSQuoteLineConfiguration[] GetInUseQuoteLineConfigurations()

Examples

NSQuoteAgent agent;
NSQuoteLineConfiguration[] res = agent.GetInUseQuoteLineConfigurations();

Returns

Type Description
NSQuoteLineConfiguration[]

GetOrderConfirmation(Integer,Integer)

Gets 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

String GetOrderConfirmation(Integer quoteVersionId, Integer confirmationTemplateId)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
Integer confirmationTemplateId;
String res = agent.GetOrderConfirmation(quoteVersionId, confirmationTemplateId);

Parameters

Type Name Description
Integer quoteVersionId
Integer confirmationTemplateId

Returns

Type Description
String

GetOrderState(Integer)

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

NSPluginUrlResponse GetOrderState(Integer quoteVersionId)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
NSPluginUrlResponse res = agent.GetOrderState(quoteVersionId);

Parameters

Type Name Description
Integer quoteVersionId

Returns

Type Description
NSPluginUrlResponse

GetPriceList(Integer)

Gets an NSPriceList object.

Declaration

NSPriceList GetPriceList(Integer priceListId)

Examples

NSQuoteAgent agent;
NSPriceList thing = agent.GetPriceList(123);

Parameters

Type Name Description
Integer priceListId

Returns

Type Description
NSPriceList

GetProduct(Integer,String)

Gets a product with the given key

Declaration

NSProduct GetProduct(Integer quoteConnectionId, String eRPProductKey)

Parameters

Type Name Description
Integer quoteConnectionId
String eRPProductKey

Returns

Type Description
NSProduct

GetProductFromDbId(Integer)

Gets a product with the given database ID

Declaration

NSProduct GetProductFromDbId(Integer productId)

Examples

NSQuoteAgent agent;
Integer productId;
NSProduct res = agent.GetProductFromDbId(productId);

Parameters

Type Name Description
Integer productId

Returns

Type Description
NSProduct

GetProductImage(Integer,String,Integer)

Gets an image connected to a product, from the ProductProvider

Declaration

String GetProductImage(Integer quoteConnectionId, String eRPProductKey, Integer rank)

Examples

NSQuoteAgent agent;
Integer quoteConnectionId;
String eRPProductKey;
Integer rank;
String res = agent.GetProductImage(quoteConnectionId, eRPProductKey, rank);

Parameters

Type Name Description
Integer quoteConnectionId
String eRPProductKey
Integer rank

Returns

Type Description
String

GetQuote(Integer)

Gets an NSQuote

Declaration

NSQuote GetQuote(Integer quoteId)

Examples

NSQuoteAgent agent;
Integer quoteId;
NSQuote res = agent.GetQuote(quoteId);

Parameters

Type Name Description
Integer quoteId

Returns

Type Description
NSQuote

GetQuoteAlternative(Integer)

Gets an NSQuoteAlternative object.

Declaration

NSQuoteAlternative GetQuoteAlternative(Integer quoteAlternativeId)

Examples

NSQuoteAgent agent;
NSQuoteAlternative thing = agent.GetQuoteAlternative(123);

Parameters

Type Name Description
Integer quoteAlternativeId

Returns

Type Description
NSQuoteAlternative

GetQuoteAlternatives(Integer)

Gets all quote alternatives for a quote version

Declaration

NSQuoteAlternative[] GetQuoteAlternatives(Integer quoteVersionId)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
NSQuoteAlternative[] res = agent.GetQuoteAlternatives(quoteVersionId);

Parameters

Type Name Description
Integer quoteVersionId

Returns

Type Description
NSQuoteAlternative[]

GetQuoteEntity(Integer)

Gets a Quote

Declaration

NSQuoteEntity GetQuoteEntity(Integer quoteId)

Examples

NSQuoteAgent agent;
Integer quoteId;
NSQuoteEntity res = agent.GetQuoteEntity(quoteId);

Parameters

Type Name Description
Integer quoteId

Returns

Type Description
NSQuoteEntity

GetQuoteEntityFromSaleId(Integer)

Gets a Quote for a sale

Declaration

NSQuoteEntity GetQuoteEntityFromSaleId(Integer saleId)

Examples

NSQuoteAgent agent;
Integer saleId;
NSQuoteEntity res = agent.GetQuoteEntityFromSaleId(saleId);

Parameters

Type Name Description
Integer saleId

Returns

Type Description
NSQuoteEntity

GetQuoteFromSaleId(Integer)

Gets an NSQuote for a sale

Declaration

NSQuote GetQuoteFromSaleId(Integer saleId)

Examples

NSQuoteAgent agent;
Integer saleId;
NSQuote res = agent.GetQuoteFromSaleId(saleId);

Parameters

Type Name Description
Integer saleId

Returns

Type Description
NSQuote

GetQuoteLine(Integer)

Gets QuoteLine from database

Declaration

NSQuoteLine GetQuoteLine(Integer quoteLineId)

Examples

NSQuoteAgent agent;
Integer quoteLineId;
NSQuoteLine res = agent.GetQuoteLine(quoteLineId);

Parameters

Type Name Description
Integer quoteLineId

Returns

Type Description
NSQuoteLine

GetQuoteLineConfiguration(Integer)

Returns the configuration field with the given ID

Declaration

NSQuoteLineConfiguration GetQuoteLineConfiguration(Integer quoteLineConfigurationId)

Examples

NSQuoteAgent agent;
Integer quoteLineConfigurationId;
NSQuoteLineConfiguration res = agent.GetQuoteLineConfiguration(quoteLineConfigurationId);

Parameters

Type Name Description
Integer quoteLineConfigurationId

Returns

Type Description
NSQuoteLineConfiguration

GetQuoteLineConfigurationFromFieldName(String)

Returns the configuration field with the given field name

Declaration

NSQuoteLineConfiguration GetQuoteLineConfigurationFromFieldName(String fieldName)

Examples

NSQuoteAgent agent;
String fieldName;
NSQuoteLineConfiguration res = agent.GetQuoteLineConfigurationFromFieldName(fieldName);

Parameters

Type Name Description
String fieldName

Returns

Type Description
NSQuoteLineConfiguration

GetQuoteLineImage(Integer,Integer)

Gets an image connected to a quoteline, either from the ERPProvider or from the SuperOffice database

Declaration

NSImage GetQuoteLineImage(Integer quoteLineId, Integer rank)

Examples

NSQuoteAgent agent;
Integer quoteLineId;
Integer rank;
NSImage res = agent.GetQuoteLineImage(quoteLineId, rank);

Parameters

Type Name Description
Integer quoteLineId
Integer rank

Returns

Type Description
NSImage

GetQuoteLines(Integer)

Gets all QuoteLines from an alternative

Declaration

NSQuoteLine[] GetQuoteLines(Integer quoteAlternativeId)

Examples

NSQuoteAgent agent;
Integer quoteAlternativeId;
NSQuoteLine[] res = agent.GetQuoteLines(quoteAlternativeId);

Parameters

Type Name Description
Integer quoteAlternativeId

Returns

Type Description
NSQuoteLine[]

GetQuoteList(String)

Gets a named list from the connector.

Declaration

NSQuoteListItem[] GetQuoteList(String quoteListType)

Examples

NSQuoteAgent agent;
String quoteListType;
NSQuoteListItem[] res = agent.GetQuoteList(quoteListType);

Parameters

Type Name Description
String quoteListType

Returns

Type Description
NSQuoteListItem[] Array of QuoteListItems; NULL if the given list is not supported.

GetQuoteVersion(Integer)

Gets an NSQuoteVersion

Declaration

NSQuoteVersion GetQuoteVersion(Integer quoteVersionId)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
NSQuoteVersion res = agent.GetQuoteVersion(quoteVersionId);

Parameters

Type Name Description
Integer quoteVersionId

Returns

Type Description
NSQuoteVersion

GetQuoteVersions(Integer)

Gets all quote versions for a sale

Declaration

NSQuoteVersion[] GetQuoteVersions(Integer quoteId)

Examples

NSQuoteAgent agent;
Integer quoteId;
NSQuoteVersion[] res = agent.GetQuoteVersions(quoteId);

Parameters

Type Name Description
Integer quoteId

Returns

Type Description
NSQuoteVersion[]

GetQuoteVersionWorkflowButtonStates(Integer,Integer)

Gets all button states for the Quote version dialog.

Declaration

NSQuoteVersionWorkflowState GetQuoteVersionWorkflowButtonStates(Integer quoteVersionId, Integer quoteAlternativeId)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
Integer quoteAlternativeId;
NSQuoteVersionWorkflowState res = agent.GetQuoteVersionWorkflowButtonStates(quoteVersionId, quoteAlternativeId);

Parameters

Type Name Description
Integer quoteVersionId
Integer quoteAlternativeId

Returns

Type Description
NSQuoteVersionWorkflowState

GetQuoteVersionWorkflowImageState(Integer)

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

Declaration

NSQuoteVersionButtonState GetQuoteVersionWorkflowImageState(Integer quoteVersionId)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
NSQuoteVersionButtonState res = agent.GetQuoteVersionWorkflowImageState(quoteVersionId);

Parameters

Type Name Description
Integer quoteVersionId

Returns

Type Description
NSQuoteVersionButtonState

GetQuoteVersionWorkflowState(Integer,Integer)

Gets all button states for the Quote version dialog. Packages ImageState, Button states and status info into one call.

Declaration

NSQuoteVersionWorkflowState GetQuoteVersionWorkflowState(Integer quoteVersionId, Integer quoteAlternativeId)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
Integer quoteAlternativeId;
NSQuoteVersionWorkflowState res = agent.GetQuoteVersionWorkflowState(quoteVersionId, quoteAlternativeId);

Parameters

Type Name Description
Integer quoteVersionId
Integer quoteAlternativeId

Returns

Type Description
NSQuoteVersionWorkflowState

GetQuoteVersionWorkflowStatusInfo(Integer)

Gets status info for the Quote version dialog header.

Declaration

NSQuoteVersionStatusInformation GetQuoteVersionWorkflowStatusInfo(Integer quoteVersionId)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
NSQuoteVersionStatusInformation res = agent.GetQuoteVersionWorkflowStatusInfo(quoteVersionId);

Parameters

Type Name Description
Integer quoteVersionId

Returns

Type Description
NSQuoteVersionStatusInformation

HasConnections()

Declaration

NSPluginResponse HasConnections()

Examples

NSQuoteAgent agent;
NSPluginResponse res = agent.HasConnections();

Returns

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

IncludeQuoteVersionAttachment(Integer,Integer,Bool)

Toggles the 'included' state of a quote version attachment

Declaration

Bool IncludeQuoteVersionAttachment(Integer quoteVersionId, Integer documentId, Bool include)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
Integer documentId;
Bool include;
Bool res = agent.IncludeQuoteVersionAttachment(quoteVersionId, documentId, include);

Parameters

Type Name Description
Integer quoteVersionId
Integer documentId
Bool include

Returns

Type Description
Bool

MoveQuoteLine(Integer,Bool)

Moves quote line rank up/down

Declaration

Void MoveQuoteLine(Integer quoteLineId, Bool direction)

Examples

NSQuoteAgent agent;
Integer quoteLineId;
Bool direction;
agent.MoveQuoteLine(quoteLineId, direction);

Parameters

Type Name Description
Integer quoteLineId
Bool direction

Returns

Type Description
Void

PlaceOrder(Integer,Bool,String,String,String)

Places an order in the ERP system.

Declaration

NSPluginUrlResponse PlaceOrder(Integer quoteAlternativeId, Bool markSaleAsSold, String poNumber, String orderComment, String culture)

Examples

NSQuoteAgent agent;
Integer quoteAlternativeId;
Bool markSaleAsSold;
String poNumber;
String orderComment;
String culture;
NSPluginUrlResponse res = agent.PlaceOrder(quoteAlternativeId, markSaleAsSold, poNumber, orderComment, culture);

Parameters

Type Name Description
Integer quoteAlternativeId
Bool markSaleAsSold
String poNumber
String orderComment
String culture

Returns

Type Description
NSPluginUrlResponse

RecalculateQuoteAlternative(Integer)

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

NSQuoteAlternativeRecalculated RecalculateQuoteAlternative(Integer quoteAlternative)

Examples

NSQuoteAgent agent;
Integer quoteAlternative;
NSQuoteAlternativeRecalculated res = agent.RecalculateQuoteAlternative(quoteAlternative);

Parameters

Type Name Description
Integer quoteAlternative

Returns

Type Description
NSQuoteAlternativeRecalculated

RecalculateQuoteLine(NSQuoteLine,String[])

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

NSQuoteLine RecalculateQuoteLine(NSQuoteLine quoteLine, String[] changedFields)

Examples

NSQuoteAgent agent;
NSQuoteLine quoteLine;
String[] changedFields;
NSQuoteLine res = agent.RecalculateQuoteLine(quoteLine, changedFields);

Parameters

Type Name Description
NSQuoteLine quoteLine
String[] changedFields

Returns

Type Description
NSQuoteLine

RejectQuoteVersion(Integer,String,Integer,String)

Rejects a quote version

Declaration

NSApproveRejectResponse RejectQuoteVersion(Integer quoteVersionId, String rejectedByText, Integer rejectedByAssociateId, String rejectionText)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
String rejectedByText;
Integer rejectedByAssociateId;
String rejectionText;
NSApproveRejectResponse res = agent.RejectQuoteVersion(quoteVersionId, rejectedByText, rejectedByAssociateId, rejectionText);

Parameters

Type Name Description
Integer quoteVersionId
String rejectedByText
Integer rejectedByAssociateId
String rejectionText

Returns

Type Description
NSApproveRejectResponse

RemoveProduct(Integer)

Removes a product from the database

Declaration

Void RemoveProduct(Integer productId)

Parameters

Type Name Description
Integer productId

Returns

Type Description
Void

RestoreConnection(Integer)

Restores a connection marked as deleted.

Declaration

Void RestoreConnection(Integer quoteConnectionId)

Examples

NSQuoteAgent agent;
Integer quoteConnectionId;
agent.RestoreConnection(quoteConnectionId);

Parameters

Type Name Description
Integer quoteConnectionId

Returns

Type Description
Void

SaveConnection(NSQuoteConnection)

Saves a connection to the database.

Declaration

NSQuoteConnection SaveConnection(NSQuoteConnection connection)

Examples

NSQuoteAgent agent;
NSQuoteConnection connection;
NSQuoteConnection res = agent.SaveConnection(connection);

Parameters

Type Name Description
NSQuoteConnection connection

Returns

Type Description
NSQuoteConnection

SaveConnectionConfigFields(Integer,Map)

Saves the connection config fields.

Declaration

Map SaveConnectionConfigFields(Integer quoteConnectionId, Map connectionConfigFields)

Examples

NSQuoteAgent agent;
Integer quoteConnectionId;
Map connectionConfigFields;
Map res = agent.SaveConnectionConfigFields(quoteConnectionId, connectionConfigFields);

Parameters

Type Name Description
Integer quoteConnectionId Primary key of the connection
connectionConfigFields

Returns

Type Description

SavePriceList(NSPriceList)

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

Declaration

NSPriceList SavePriceList(NSPriceList priceList)

Examples

NSQuote  agent;
NSPriceList thing = agent.CreateDefaultPriceList();
thing = agent.SavePriceList(thing);

Parameters

Type Name Description
NSPriceList priceList The NSPriceList to save.

Returns

Type Description
NSPriceList

SaveProduct(NSProduct)

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

Declaration

NSProduct SaveProduct(NSProduct product)

Examples

NSQuote  agent;
NSProduct thing = agent.CreateDefaultProduct();
thing = agent.SaveProduct(thing);

Parameters

Type Name Description
NSProduct product The NSProduct to save.

Returns

Type Description
NSProduct

SaveQuote(NSQuote)

Saves an NSQuote

Declaration

NSQuote SaveQuote(NSQuote quote)

Examples

NSQuoteAgent agent;
NSQuote quote;
NSQuote res = agent.SaveQuote(quote);

Parameters

Type Name Description
NSQuote quote

Returns

Type Description
NSQuote

SaveQuoteAlternative(NSQuoteAlternative)

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

Declaration

NSQuoteAlternative SaveQuoteAlternative(NSQuoteAlternative quoteAlternative)

Examples

NSQuoteAgent agent;
NSQuoteAlternative thing = agent.CreateDefaultQuoteAlternative();
thing = agent.SaveQuoteAlternative(thing);

Parameters

Type Name Description
NSQuoteAlternative quoteAlternative The NSQuoteAlternative to save.

Returns

Type Description
NSQuoteAlternative

SaveQuoteEntity(NSQuoteEntity)

Saves an NSQuoteEntity.

Declaration

NSQuoteEntity SaveQuoteEntity(NSQuoteEntity quoteEntity)

Examples

NSQuoteAgent agent;
NSQuoteEntity quoteEntity;
NSQuoteEntity res = agent.SaveQuoteEntity(quoteEntity);

Parameters

Type Name Description
NSQuoteEntity quoteEntity

Returns

Type Description
NSQuoteEntity

SaveQuoteLine(NSQuoteLine)

Saves the NSQuoteLine in the SuperOffice database

Declaration

NSQuoteLine SaveQuoteLine(NSQuoteLine quoteLine)

Examples

NSQuoteAgent agent;
NSQuoteLine quoteLine;
NSQuoteLine res = agent.SaveQuoteLine(quoteLine);

Parameters

Type Name Description
NSQuoteLine quoteLine

Returns

Type Description
NSQuoteLine

SaveQuoteLineConfiguration(NSQuoteLineConfiguration)

Saves an NSQuoteLineConfiguration object. It is not possible to add a new configuration.

Declaration

NSQuoteLineConfiguration SaveQuoteLineConfiguration(NSQuoteLineConfiguration quoteLineConfiguration)

Examples

NSQuoteAgent agent;
NSQuoteLineConfiguration quoteLineConfiguration;
NSQuoteLineConfiguration res = agent.SaveQuoteLineConfiguration(quoteLineConfiguration);

Parameters

Type Name Description
NSQuoteLineConfiguration quoteLineConfiguration

Returns

Type Description
NSQuoteLineConfiguration

SaveQuoteLineConfigurations()

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

Declaration

NSQuoteLineConfiguration[] SaveQuoteLineConfigurations(NSQuoteLineConfiguration[] quoteLineConfigurations)

Examples

NSQuoteAgent agent;
NSQuoteLineConfiguration[] quoteLineConfigurations;
NSQuoteLineConfiguration[] res = agent.SaveQuoteLineConfigurations(quoteLineConfigurations);

Parameters

Type Name Description
NSQuoteLineConfiguration[] quoteLineConfigurations

Returns

Type Description
NSQuoteLineConfiguration[]

SaveQuoteLineImage(Integer,NSImage,Integer)

Saves the image connected to a quoteline in the SuperOffice database

Declaration

Void SaveQuoteLineImage(Integer quoteLineId, NSImage image, Integer rank)

Examples

NSQuoteAgent agent;
Integer quoteLineId;
NSImage image;
Integer rank;
agent.SaveQuoteLineImage(quoteLineId, image, rank);

Parameters

Type Name Description
quoteLineId
image
Integer rank

Returns

Type Description
Void

SaveQuoteLines(NSQuoteLine[])

Saves the QuoteLines in the SuperOffice database

Declaration

NSQuoteLine[] SaveQuoteLines(NSQuoteLine[] quoteLines)

Examples

NSQuoteAgent agent;
NSQuoteLine[] quoteLines;
NSQuoteLine[] res = agent.SaveQuoteLines(quoteLines);

Parameters

Type Name Description
NSQuoteLine[] quoteLines

Returns

Type Description
NSQuoteLine[]

SaveQuoteVersion(NSQuoteVersion)

Saves a quote version

Declaration

NSQuoteVersion SaveQuoteVersion(NSQuoteVersion quoteVersion)

Examples

NSQuoteAgent agent;
NSQuoteVersion quoteVersion;
NSQuoteVersion res = agent.SaveQuoteVersion(quoteVersion);

Parameters

Type Name Description
NSQuoteVersion quoteVersion

Returns

Type Description
NSQuoteVersion

SaveQuoteVersionNumber(Integer,String)

Save the quote version number if it is valid

Declaration

Bool SaveQuoteVersionNumber(Integer quoteVersionId, String number)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
String number;
Bool res = agent.SaveQuoteVersionNumber(quoteVersionId, number);

Parameters

Type Name Description
Integer quoteVersionId
String number

Returns

Type Description
Bool

SendQuoteVersion(Integer,DateTime,DateTime,String,String)

Sends the quote to the user's customer.

Declaration

NSPluginUrlResponse SendQuoteVersion(Integer quoteVersionId, DateTime expiryDate, DateTime followupDate, String followupText, String culture)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
DateTime expiryDate;
DateTime followupDate;
String followupText;
String culture;
NSPluginUrlResponse res = agent.SendQuoteVersion(quoteVersionId, expiryDate, followupDate, followupText, culture);

Parameters

Type Name Description
Integer quoteVersionId
expiryDate
followupDate
String followupText
String culture

Returns

Type Description
NSPluginUrlResponse

TestConnection(String)

Tests 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

NSPluginResponse TestConnection(String connectorName, Map connectionData)

Examples

NSQuoteAgent agent;
String connectorName;
Map connectionData;
NSPluginResponse res = agent.TestConnection(connectorName, connectionData);

Parameters

Type Name Description
String connectorName

Returns

Type Description
NSPluginResponse how the test went.

ToggleProductInAssortment(Integer)

Toggles if the product is in assortment or not

Declaration

Void ToggleProductInAssortment(Integer productId)

Parameters

Type Name Description
Integer productId

Returns

Type Description
Void

ToggleQuoteVersionAttachmentIncluded(Integer)

Toggle the 'included' state of a quote version attachment

Declaration

Bool ToggleQuoteVersionAttachmentIncluded(Integer quoteVersionAttachmentId)

Examples

NSQuoteAgent agent;
Integer quoteVersionAttachmentId;
Bool res = agent.ToggleQuoteVersionAttachmentIncluded(quoteVersionAttachmentId);

Parameters

Type Name Description
Integer quoteVersionAttachmentId

Returns

Type Description
Bool

ToggleSaleTypeQuoteAttachmentDefaultIncluded(Integer)

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

Declaration

Bool ToggleSaleTypeQuoteAttachmentDefaultIncluded(Integer saleTypeQuoteAttachmentId)

Examples

NSQuoteAgent agent;
Integer saleTypeQuoteAttachmentId;
Bool res = agent.ToggleSaleTypeQuoteAttachmentDefaultIncluded(saleTypeQuoteAttachmentId);

Parameters

Type Name Description
Integer saleTypeQuoteAttachmentId

Returns

Type Description
Bool

UpdateQuoteVersionPrices(Integer)

Updates price on the all the quote lines for each alternative in the current quote version

Declaration

NSQuoteVersionValidated UpdateQuoteVersionPrices(Integer quoteVersionId)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
NSQuoteVersionValidated res = agent.UpdateQuoteVersionPrices(quoteVersionId);

Parameters

Type Name Description
Integer quoteVersionId

Returns

Type Description
NSQuoteVersionValidated

ValidateQuoteVersion(Integer,Integer)

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.

Declaration

NSQuoteVersionValidated ValidateQuoteVersion(Integer quoteVersionId, Integer action)

Examples

NSQuoteAgent agent;
Integer quoteVersionId;
Integer action;
NSQuoteVersionValidated res = agent.ValidateQuoteVersion(quoteVersionId, action);

Parameters

Type Name Description
Integer quoteVersionId
Integer action See <xref href="CRMScript.NetServer.QuoteVersionButtonAction" data-throw-if-not-resolved="false"></xref>.

Returns

Type Description
NSQuoteVersionValidated