// Variable for the version of the field - Display in Props UI.
fieldVersion = "1.0.4";
// CS version and required Version variables
requiredCSversion = 9;
csVersion = ListFirst(ListLast(request.cp.productversion," "),".");
This Custom Field Type requires CommonSpot #requiredCSversion# or above.
// initialize some of the attributes variables
typeid = attributes.typeid;
prefix = attributes.prefix;
formname = attributes.formname;
formID = attributes.formID;
currentValues = attributes.currentValues;
// AjaxProxy Path to make ajax call in context of the site
ajaxComURL = application.ADF.ajaxProxy;
ajaxBeanName = 'customElementDataManager';
if( not structKeyExists(currentValues, "childCustomElement") )
currentValues.childCustomElement = "";
if( not structKeyExists(currentValues, "parentUniqueField") )
currentValues.parentUniqueField = "";
if( not structKeyExists(currentValues, "childUniqueField") )
currentValues.childUniqueField = "";
if( not structKeyExists(currentValues, "childLinkedField") )
currentValues.childLinkedField = "";
if( not structKeyExists(currentValues, "inactiveField") )
currentValues.inactiveField = "";
if( not structKeyExists(currentValues, "inactiveFieldValue") )
currentValues.inactiveFieldValue = "";
if( not structKeyExists(currentValues, "displayFields") )
currentValues.displayFields = "";
if( not structKeyExists(currentValues, "widthValue") )
currentValues.widthValue = "";
if( not structKeyExists(currentValues, "widthUnit") )
currentValues.widthUnit = "";
if( not structKeyExists(currentValues, "heightValue") )
currentValues.heightValue = "";
if( not structKeyExists(currentValues, "heightUnit") )
currentValues.heightUnit = "";
if( not structKeyExists(currentValues, "sortByType") )
currentValues.sortByType = "";
if( not structKeyExists(currentValues, "sortByField") )
currentValues.sortByField = "";
if( not structKeyExists(currentValues, "sortByDir") )
currentValues.sortByDir = "";
if( not structKeyExists(currentValues, "positionField") )
currentValues.positionField = "";
if( not structKeyExists(currentValues, "refersParent") )
currentValues.refersParent = 1;
if( not structKeyExists(currentValues, "assocCustomElement") )
currentValues.assocCustomElement = "";
if( not structKeyExists(currentValues, "interfaceOptions") )
currentValues.interfaceOptions = "new,editChild,delete";
if( not structKeyExists(currentValues, "compOverride") )
currentValues.compOverride = "";
if( not structKeyExists(currentValues, "parentInstanceIDField") )
currentValues.parentInstanceIDField = "";
if( not structKeyExists(currentValues, "childInstanceIDField") )
currentValues.childInstanceIDField = "";
customElementObj = Server.CommonSpot.ObjectFactory.getObject('CustomElement');
allCustomElements = customElementObj.getList(type="All", state="Active");
parentCustomElementDetails = customElementObj.getInfo(elementID=formID);
selectedTypeFields = customElementObj.getFields(elementID=formID);
errorMsgCustom = 'Some error occurred while trying to perform the operation.';
SELECT *
FROM allCustomElements
WHERE lower(Type) =
SELECT ID, Label AS Name
FROM selectedTypeFields
WHERE
application.ADF.scripts.loadJQuery(noConflict=true);
application.ADF.scripts.loadJQueryUI();
Child Custom Element:
style="display:none;">
style="display:none;">
#Server.CommonSpot.udf.tag.checkboxRadio(type="checkbox", name="#prefix#refersParentCheckbox", value="1", label="The child element contains the reference to the parent instance", checked=(currentValues.refersParent EQ 1), labelClass="cs_dlgLabelSmall", onchange="#prefix#toggleAssocFld()")#
#Server.CommonSpot.udf.tag.input(type="hidden", id="#prefix#refersParent", name="#prefix#refersParent", value="#currentValues.refersParent#")#