Click or drag to resize
CTExtensionStoreExportProfileLinkToDBObject Method
Store link-data of your extension from export profile to given DB object type with given id. ID's stored using this function are kept linked to correct objects even in profile import/export -cases. Use intData to distinct different links of same type.

Namespace: CTExtensions
Assembly: CTInterface (in CTInterface.dll)
Syntax
public bool StoreExportProfileLinkToDBObject(
	ICTExportProfile oExportProf,
	SQLObjectType eObjectType,
	int id,
	int intData = 0
)

Parameters

oExportProf
Type: ICTExportProfile
Profile to link with given object
eObjectType
Type: SQLObjectType
Type of the object
id
Type: SystemInt32
ID of the object
intData (Optional)
Type: SystemInt32
Integer data can be used to identify specific links of same object type.

Return Value

Type: Boolean
True if successfull, false otherwise
Examples
Example how to store links to specific attributes so that they are correctly kept during profile import/export.
C#
enum AttributeTypes
{
  MainAttribute = 1,
  SecondaryAttribute = 2
}

ICTExportProfile oProfile = /* GetExportProfile(...); */
int iAttributeId = /* GetSelectedMainAttribute(...); */

// Save currently selected attribute as MainAttribute to DB.
StoreExportProfileLinkToDBObject(oProfile, (int)SQLObjectMgr.SQLObjectType_SQLAttribute, iAttrbuteId, (int)AttributeTypes.MainAttribute);

// Get MainAttribute's stored attribute id. This is valid even if the attribute id has changed during profile import/export.
iAttributeId = GetExportProfileLinkToDBObject(oProfile, (int)SQLObjectMgr.SQLObjectType_SQLAttribute, (int)AttributeTypes.MainAttribute);
See Also