Class QuoteConnectorExtender
Base class that allows 3rd party modules to extend the SuperOffice Quote Connector without directly linking to the specific version of the QuoteConnector.dll
This class is made to make it easier to make some installation specific changes to a connector without directly linking to the connector itself. Just inherit QuoteConnectorExtender and override the function you need to change or extend the functionality. IQuoteConnectorInherited Members
Namespace: SuperOffice.CRM
Assembly: SuperOffice.Plugins.dll
Syntax
public class QuoteConnectorExtender : IQuoteConnector, IDisposable
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
Constructors
QuoteConnectorExtender(IServiceProvider)
Default Constructor of the extender. Extend the SuperOfficeQuoteConnector in "SuperOffice.QuoteConnector.Dll".
Declaration
public QuoteConnectorExtender(IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
IServiceProvider | serviceProvider |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
QuoteConnectorExtender(string)
Constructor of the extender.
Declaration
public QuoteConnectorExtender(string nameOfPluginToExtend)
Parameters
Type | Name | Description |
---|---|---|
string | nameOfPluginToExtend | Relative or absolute path to the assembly, Ex: "C:\Program Files (x86)\SuperOffice\Plugins\MyConnector.dll" |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
Fields
_connector
The connector that the extender extends.
Declaration
protected IQuoteConnector _connector
Field Value
Type | Description |
---|---|
IQuoteConnector |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
Properties
CRMConnectionId
Return the id of this connector. CRMConnectionId
Declaration
public virtual int CRMConnectionId { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
ConnectorName
Returns the ConnectorName from the attribute
Declaration
protected string ConnectorName { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
NextConnectorKeyname
Concatenates the ConnectorName and "_NextConnectorKey"
Declaration
protected string NextConnectorKeyname { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
Methods
CanProvideCapability(string)
Will call the base connector's CanProvideCapability(string) unless you override this method.
Declaration
public virtual bool CanProvideCapability(string capabilityName)
Parameters
Type | Name | Description |
---|---|---|
string | capabilityName | Name of the capability, see CRMQuoteConnectorCapabilities |
Returns
Type | Description |
---|---|
bool | List of what the connector can do |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
Dispose()
Base class that allows 3rd party modules to extend the SuperOffice Quote Connector without directly linking to the specific version of the QuoteConnector.dll
This class is made to make it easier to make some installation specific changes to a connector without directly linking to the connector itself. Just inherit QuoteConnectorExtender and override the function you need to change or extend the functionality. IQuoteConnectorDeclaration
public void Dispose()
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
FindProductAsync(QuoteAlternativeContextInfo, string, string, string, CancellationToken)
Will call the base connector's FindProductAsync(QuoteAlternativeContextInfo, string, string, string, CancellationToken) unless you override this method.
Declaration
public virtual Task<ProductInfo[]> FindProductAsync(QuoteAlternativeContextInfo context, string currencyCode, string userinput, string priceListKey, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
QuoteAlternativeContextInfo | context | |
string | currencyCode | |
string | userinput | |
string | priceListKey | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProductInfo[]> |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetActivePriceLists(string)
Will call the base connector's GetActivePriceLists(string) unless you override this method.
Declaration
public virtual PriceListInfo[] GetActivePriceLists(string isoCurrencyCode)
Parameters
Type | Name | Description |
---|---|---|
string | isoCurrencyCode |
Returns
Type | Description |
---|---|
PriceListInfo[] |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetAddresses(QuoteAlternativeContextInfo)
Gets two addresses:
- the invoice address - [0].
- the delivery address - [1].
Declaration
public virtual AddressInfo[] GetAddresses(QuoteAlternativeContextInfo context)
Parameters
Type | Name | Description |
---|---|---|
QuoteAlternativeContextInfo | context |
Returns
Type | Description |
---|---|
AddressInfo[] | Returns null if no address was found. |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetAllPriceLists(string)
Will call the base connector's GetAllPriceLists(string) unless you override this method.
Declaration
public virtual PriceListInfo[] GetAllPriceLists(string isoCurrencyCode)
Parameters
Type | Name | Description |
---|---|---|
string | isoCurrencyCode |
Returns
Type | Description |
---|---|
PriceListInfo[] |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetCapabilities()
Will call the base connector's GetCapabilities() unless you override this method.
Declaration
public virtual Dictionary<string, bool> GetCapabilities()
Returns
Type | Description |
---|---|
Dictionary<string, bool> | List of what the connector can do |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetConfigurationFields()
Will call the base connector's GetConfigurationFields() unless you override this method.
Declaration
public virtual Dictionary<string, FieldMetadataInfo> GetConfigurationFields()
Returns
Type | Description |
---|---|
Dictionary<string, FieldMetadataInfo> |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetNumberOfActivePriceLists(string)
Will call the base connector's GetNumberOfActivePriceLists(string) unless you override this method.
Declaration
public virtual int GetNumberOfActivePriceLists(string isoCurrencyCode)
Parameters
Type | Name | Description |
---|---|---|
string | isoCurrencyCode |
Returns
Type | Description |
---|---|
int |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetNumberOfProductImages(string)
Will call the base connector's GetNumberOfProductImages(string) unless you override this method.
Declaration
public virtual int GetNumberOfProductImages(string erpProductKey)
Parameters
Type | Name | Description |
---|---|---|
string | erpProductKey |
Returns
Type | Description |
---|---|
int |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetOrderState(QuoteAlternativeContextInfo)
Calls the base class's implementation of GetOrderState(QuoteAlternativeContextInfo) unless you override this method.
Declaration
public virtual OrderResponseInfo GetOrderState(QuoteAlternativeContextInfo context)
Parameters
Type | Name | Description |
---|---|---|
QuoteAlternativeContextInfo | context | The alternative to place and order for |
Returns
Type | Description |
---|---|
OrderResponseInfo | An updated alternative. Fill in the delivered quantity, change the state or reason flags on quote lines to reflect the state of the order in the ERP system. |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetProduct(QuoteAlternativeContextInfo, string)
Will call the base connector's GetProduct(QuoteAlternativeContextInfo, string) unless you override this method.
Declaration
public virtual ProductInfo GetProduct(QuoteAlternativeContextInfo context, string erpProductKey)
Parameters
Type | Name | Description |
---|---|---|
QuoteAlternativeContextInfo | context | |
string | erpProductKey |
Returns
Type | Description |
---|---|
ProductInfo |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetProductImage(string, int)
Will call the base connector's GetProductImage(string, int) unless you override this method.
Declaration
public virtual string GetProductImage(string erpProductKey, int rank)
Parameters
Type | Name | Description |
---|---|---|
string | erpProductKey | |
int | rank |
Returns
Type | Description |
---|---|
string |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetProducts(QuoteAlternativeContextInfo, string[])
Will call the base connector's GetProducts(QuoteAlternativeContextInfo, string[]) unless you override this method.
Declaration
public virtual ProductInfo[] GetProducts(QuoteAlternativeContextInfo context, string[] erpProductKeys)
Parameters
Type | Name | Description |
---|---|---|
QuoteAlternativeContextInfo | context | |
string[] | erpProductKeys |
Returns
Type | Description |
---|---|
ProductInfo[] |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetQuoteLinesFromProduct(QuoteAlternativeContextInfo, string)
Will call the base connector's GetQuoteLinesFromProduct(QuoteAlternativeContextInfo, string) unless you override this method.
Declaration
public virtual QuoteLineInfo[] GetQuoteLinesFromProduct(QuoteAlternativeContextInfo context, string erpProductKey)
Parameters
Type | Name | Description |
---|---|---|
QuoteAlternativeContextInfo | context | |
string | erpProductKey |
Returns
Type | Description |
---|---|
QuoteLineInfo[] |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetQuoteListAsync(string, CancellationToken)
Will call the base connector's GetQuoteListAsync(string, CancellationToken) unless you override this method.
Declaration
public virtual Task<ListItemInfo[]> GetQuoteListAsync(string quoteListType, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | quoteListType | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ListItemInfo[]> |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetSearchResultsAsync(SearchRestrictionInfo[], CancellationToken)
Calls the base class's implementation of IQuoteConnector.GetSearchResults unless you override this method.
Declaration
public virtual IAsyncEnumerable<ProductInfo> GetSearchResultsAsync(SearchRestrictionInfo[] restrictions, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
SearchRestrictionInfo[] | restrictions | Array of restrictions chosen by the user; see SearchRestrictionInfo for details |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
IAsyncEnumerable<ProductInfo> | Array (possibly empty) of hits, populated as fully as reasonably possible (should follow same policy as IProductProvider.FindProducts |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
GetSearchableFields()
Calls the base class's implementation of GetSearchableFields() unless you override this method.
Declaration
public virtual FieldMetadataInfo[] GetSearchableFields()
Returns
Type | Description |
---|---|
FieldMetadataInfo[] | Metadata structures |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
InitializeConnection(QuoteConnectionInfo, UserInfo, bool, Dictionary<string, string>, IProductRegisterCache)
Will call the base connector's InitializeConnection(QuoteConnectionInfo, UserInfo, bool, Dictionary<string, string>, IProductRegisterCache) unless you override this method.
Declaration
public virtual PluginResponseInfo InitializeConnection(QuoteConnectionInfo connectionData, UserInfo user, bool isOnTravel, Dictionary<string, string> connectionConfigFields, IProductRegisterCache productRegister)
Parameters
Type | Name | Description |
---|---|---|
QuoteConnectionInfo | connectionData | Information about the connection |
UserInfo | user | Information about the current user |
bool | isOnTravel | True if we are currently on travel |
Dictionary<string, string> | connectionConfigFields | Configuration parameters |
IProductRegisterCache | productRegister | Interface to call if a product register cache is desired |
Returns
Type | Description |
---|---|
PluginResponseInfo |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
OnAfterSaveQuote(QuoteAlternativeContextInfo)
Will call the base connector's OnAfterSaveQuote(QuoteAlternativeContextInfo) unless you override this method.
Declaration
public virtual void OnAfterSaveQuote(QuoteAlternativeContextInfo context)
Parameters
Type | Name | Description |
---|---|---|
QuoteAlternativeContextInfo | context |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
OnAfterSentQuoteVersion(QuoteVersionContextInfo)
Will call the base connector's OnAfterSentQuoteVersion(QuoteVersionContextInfo) unless you override this method.
Declaration
public virtual QuoteSentResponseInfo OnAfterSentQuoteVersion(QuoteVersionContextInfo context)
Parameters
Type | Name | Description |
---|---|---|
QuoteVersionContextInfo | context |
Returns
Type | Description |
---|---|
QuoteSentResponseInfo |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
OnBeforeCreateQuote(QuoteAlternativeContextInfo)
Will call the base connector's OnBeforeCreateQuote(QuoteAlternativeContextInfo) unless you override this method.
Declaration
public virtual QuoteResponseInfo OnBeforeCreateQuote(QuoteAlternativeContextInfo context)
Parameters
Type | Name | Description |
---|---|---|
QuoteAlternativeContextInfo | context |
Returns
Type | Description |
---|---|
QuoteResponseInfo |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
OnBeforeCreateQuoteAlternative(QuoteAlternativeContextInfo)
Will call the base connector's OnBeforeCreateQuoteAlternative(QuoteAlternativeContextInfo) unless you override this method.
Declaration
public virtual QuoteAlternativeResponseInfo OnBeforeCreateQuoteAlternative(QuoteAlternativeContextInfo context)
Parameters
Type | Name | Description |
---|---|---|
QuoteAlternativeContextInfo | context |
Returns
Type | Description |
---|---|
QuoteAlternativeResponseInfo |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
OnBeforeCreateQuoteVersion(QuoteVersionContextInfo)
Will call the base connector's OnBeforeCreateQuote(QuoteAlternativeContextInfo) unless you override this method.
Declaration
public virtual QuoteVersionResponseInfo OnBeforeCreateQuoteVersion(QuoteVersionContextInfo context)
Parameters
Type | Name | Description |
---|---|---|
QuoteVersionContextInfo | context |
Returns
Type | Description |
---|---|
QuoteVersionResponseInfo |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
OnBeforeDeleteQuote(QuoteInfo, ISaleInfo, IContactInfo)
Will call the base connector's OnBeforeDeleteQuote(QuoteInfo, ISaleInfo, IContactInfo) unless you override this method.
Declaration
public virtual void OnBeforeDeleteQuote(QuoteInfo quote, ISaleInfo sale, IContactInfo contact)
Parameters
Type | Name | Description |
---|---|---|
QuoteInfo | quote | Quote that will be deleted |
ISaleInfo | sale | Sale the quote belongs to |
IContactInfo | contact | Contact the sale belongs to |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
OnQuoteLineChangedAsync(QuoteAlternativeContextInfo, QuoteLineInfo, string[], CancellationToken)
Will call the base connector's OnQuoteLineChangedAsync(QuoteAlternativeContextInfo, QuoteLineInfo, string[], CancellationToken) unless you override this method.
Declaration
public virtual Task<QuoteLineInfo> OnQuoteLineChangedAsync(QuoteAlternativeContextInfo context, QuoteLineInfo ql, string[] changedFields, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
QuoteAlternativeContextInfo | context | |
QuoteLineInfo | ql | |
string[] | changedFields | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<QuoteLineInfo> |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
PlaceOrder(QuoteAlternativeContextInfo)
Calls the base class's implementation of PlaceOrder(QuoteAlternativeContextInfo) unless you override this method.
Declaration
public virtual PlaceOrderResponseInfo PlaceOrder(QuoteAlternativeContextInfo context)
Parameters
Type | Name | Description |
---|---|---|
QuoteAlternativeContextInfo | context | The alternative to place and order for |
Returns
Type | Description |
---|---|
PlaceOrderResponseInfo | How it went |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
RecalculateQuoteAlternativeAsync(QuoteAlternativeContextInfo, CancellationToken)
Will call the base connector's RecalculateQuoteAlternativeAsync(QuoteAlternativeContextInfo, CancellationToken) unless you override this method.
Declaration
public virtual Task<QuoteAlternativeWithLinesInfo> RecalculateQuoteAlternativeAsync(QuoteAlternativeContextInfo context, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
QuoteAlternativeContextInfo | context | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<QuoteAlternativeWithLinesInfo> | Updated |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
SetConnectorToExtend(string)
Same as constructor
Declaration
protected void SetConnectorToExtend(string nameOfPluginToExtend)
Parameters
Type | Name | Description |
---|---|---|
string | nameOfPluginToExtend |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
TestConnection(Dictionary<string, string>)
Will call the base connector's TestConnection(Dictionary<string, string>) unless you override this method.
Declaration
public virtual PluginResponseInfo TestConnection(Dictionary<string, string> connectionData)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<string, string> | connectionData |
Returns
Type | Description |
---|---|
PluginResponseInfo |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
UpdateQuoteVersionPricesAsync(QuoteVersionContextInfo, HashSet<string>)
Will call the base connector's UpdateQuoteVersionPricesAsync(QuoteVersionContextInfo, HashSet<string>) unless you override this method.
Declaration
public virtual Task<QuoteVersionResponseInfo> UpdateQuoteVersionPricesAsync(QuoteVersionContextInfo context, HashSet<string> writeableFields)
Parameters
Type | Name | Description |
---|---|---|
QuoteVersionContextInfo | context | Current quote version |
HashSet<string> | writeableFields |
Returns
Type | Description |
---|---|
Task<QuoteVersionResponseInfo> | Updated quote version |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
ValidateAlternativeAsync(QuoteAlternativeContextInfo, bool, CancellationToken)
Will call the base connector's ValidateAlternativeAsync(QuoteAlternativeContextInfo, bool, CancellationToken) unless you override this method. Does nothing if you are extending a connector that is not based on QuoteConnectorBase.
Declaration
protected virtual Task<QuoteAlternativeWithLinesInfo> ValidateAlternativeAsync(QuoteAlternativeContextInfo context, bool clearOldValues = false, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
QuoteAlternativeContextInfo | context | |
bool | clearOldValues | Should the function clear out old values for status and reason? |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<QuoteAlternativeWithLinesInfo> | A potentially changed alternative AND quotelines |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
ValidateQuoteLineAsync(QuoteAlternativeContextInfo, QuoteLineInfo, bool, CancellationToken)
Will call the base connector's ValidateQuoteLineAsync(QuoteAlternativeContextInfo, QuoteLineInfo, bool, CancellationToken) unless you override this method. Does nothing if you are extending a connector that is not based on QuoteConnectorBase.
Declaration
protected virtual Task<QuoteLineInfo> ValidateQuoteLineAsync(QuoteAlternativeContextInfo context, QuoteLineInfo ql, bool clearOldValues = false, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
QuoteAlternativeContextInfo | context | |
QuoteLineInfo | ql | |
bool | clearOldValues | Should the function clear out old values for status and reason? |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<QuoteLineInfo> | A potentially changed quoteline |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
ValidateQuoteVersionAsync(QuoteVersionContextInfo, QuoteAction, CancellationToken)
Will call the base connector's ValidateQuoteVersionAsync(QuoteVersionContextInfo, QuoteAction, CancellationToken) unless you override this method.
Declaration
public virtual Task<QuoteResponseInfo> ValidateQuoteVersionAsync(QuoteVersionContextInfo context, QuoteAction action, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
QuoteVersionContextInfo | context | The version with it's context |
QuoteAction | action | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<QuoteResponseInfo> | A potentially changed context |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited
ValidateVersionAsync(QuoteVersionContextInfo, QuoteAction, bool, CancellationToken)
Will call the base connector's ValidateVersionAsync(QuoteVersionContextInfo, QuoteAction, bool, CancellationToken) unless you override this method. Does nothing if you are extending a connector that is not based on QuoteConnectorBase.
Declaration
protected virtual Task<QuoteVersionResponseInfo> ValidateVersionAsync(QuoteVersionContextInfo context, QuoteAction action, bool clearOldValues = false, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
QuoteVersionContextInfo | context | |
QuoteAction | action | |
bool | clearOldValues | Should the function clear out old values for status and reason? |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<QuoteVersionResponseInfo> | A potentially changed version with alternative AND quotelines |
Remarks
This class will call your interface implementations if they exist, otherwise it will call the inherited