variables.ElementName = getCalOrganizationsCEName();
variables.ElementIDfield = "uniqueID";
//variables.CCAPIName = getCalOrganizationsCCAPIname();
variables.CCAPIName = getCCAPIName(variables.elementName);
variables.elementViewName = getCEViewName(variables.elementName);
if ( LEN(arguments.uniqueID) )
return application.ptCalendar.ceData.getCEData(variables.ElementName, variables.ElementIDfield, TRIM(arguments.uniqueID));
else
return application.ptCalendar.ceData.getCEData(variables.ElementName);
var activefield = "Active";
var activeValue = 1;
var numericSortField = "ordinal";
var retDataArray = application.ptCalendar.ceData.getCEData(variables.ElementName, activefield, activeValue);
// if a SortField is Passed in... Sort the Array of Struct
if ( ArrayLen(retDataArray) AND LEN(TRIM(arguments.sortField)) AND StructKeyExists(retDataArray[1],"values") AND StructKeyExists(retDataArray[1].values,arguments.sortField) ) {
if ( arguments.sortField EQ numericSortField )
retDataArray = application.ptCalendar.cedata.arrayOfCEDataSort(retDataArray,arguments.sortField,"asc","numeric");
else
retDataArray = application.ptCalendar.cedata.arrayOfCEDataSort(retDataArray,arguments.sortField,"asc","textnocase");
}
return retDataArray;
var dataList = "";
var fieldName = "name";
var dataArray = getCalOrganizations(uniqueID=arguments.uniqueID);
var itm = 1;
for ( itm=1; itm LTE ArrayLen(dataArray); itm=itm+1 ) {
if ( StructKeyExists(dataArray[itm],"values") AND StructKeyExists(dataArray[itm].values,fieldName) AND Len(Trim(dataArray[itm].values[fieldName])) )
dataList = ListAppend(dataList,dataArray[itm].values[fieldName],arguments.delimiter);
}
return dataList;
var orgStruct = StructNew();
var fieldName = "name";
var orgArray = application.ptCalendar.ceData.getCEData(variables.ElementName,fieldName,arguments.orgName);
if ( ArrayLen(orgArray) )
orgStruct = orgArray[1];
return orgStruct;
var orgStruct = getOrganizationByName(orgName=arguments.orgName);
var retValue = "";
// If a Org name matches return the UUID for the record
if ( !StructIsEmpty(orgStruct) AND StructKeyExists(orgStruct,"values") AND StructKeyExists(orgStruct.values,"uniqueID") AND LEN(TRIM(orgStruct.values.uniqueID)) )
retValue = TRIM(orgStruct.values.uniqueID);
return retValue;
var fieldName = "name";
return application.ptCalendar.ceData.getCEData(variables.ElementName,fieldName,TRIM(arguments.orgNameList));
var dataList = "";
var fieldName = "uniqueID";
var dataArray = getOrganizationsByNames(orgNameList=arguments.orgNameList);
var itm = 1;
for ( itm=1; itm LTE ArrayLen(dataArray); itm=itm+1 ) {
if ( StructKeyExists(dataArray[itm],"values") AND StructKeyExists(dataArray[itm].values,fieldName) AND Len(Trim(dataArray[itm].values[fieldName])) )
dataList = ListAppend(dataList,TRIM(dataArray[itm].values[fieldName]));
}
return dataList;
var retDataArray = ArrayNew(1);
var dataStruct = StructNew();
var dataArray = ArrayNew(1);
var idField = variables.ElementIDfield;
var valueField = "name";
var numericSortField = "ordinal";
var itm = 1;
// Get ALL records or Only Active Records
if ( arguments.activeOnly )
dataArray = getActiveOrganizations();
else
dataArray = getCalOrganizations();
// Build the Data Struct for id and name pairs
for ( itm=1; itm LTE ArrayLen(dataArray); itm=itm+1 ) {
if ( StructKeyExists(dataArray[itm],"values") AND StructKeyExists(dataArray[itm].values,idField) AND LEN(TRIM(dataArray[itm].values[idField])) AND StructKeyExists(dataArray[itm].values,valueField) ) {
dataStruct = StructNew();
dataStruct[idField] = dataArray[itm].values[idField];
dataStruct[valueField] = dataArray[itm].values[valueField];
if ( StructKeyExists(dataArray[itm].values,numericSortField) )
dataStruct[numericSortField] = dataArray[itm].values[numericSortField];
else
dataStruct[numericSortField] = 0;
// Add the Data Struct to the Return Array
arrayAppend(retDataArray,dataStruct);
}
}
// if a SortField is Passed in... Sort the Array of Struct
if ( ArrayLen(retDataArray) AND LEN(TRIM(arguments.sortField)) AND StructKeyExists(retDataArray[1],TRIM(arguments.sortField)) ) {
if ( arguments.sortField EQ numericSortField )
retDataArray = application.ptCalendar.data.arrayOfStructsSort(retDataArray,TRIM(arguments.sortField),"asc","numeric");
else
retDataArray = application.ptCalendar.data.arrayOfStructsSort(retDataArray,TRIM(arguments.sortField),"asc","textnocase");
}
return retDataArray;
var retStatusStruct = application.ptCalendar.csContent.populateContent(variables.CCAPIName, arguments.dataValues);
/* retStatusStruct RETURNS: CONTENTUPDATED : true/false & CONTENTUPDATERESPONSE: Success:1 */
return retStatusStruct;
var dataQry = QueryNew("temp");
var filterDataQry = QueryNew("temp");
var activefield = "Active";
var activeValue = 1;
SELECT *
FROM #variables.elementViewName#
WHERE 1=1
AND #activefield# =
AND
AND #variables.ElementIDfield# =