var retData = ArrayNew(1);
// Check if the question ID is defined
if ( LEN(arguments.voteID) )
retData = application.ptPoll.cedata.getCEData(variables.voteElement, "ID", arguments.voteID);
else
retData = application.ptPoll.cedata.getCEData(variables.voteElement);
// Return the data
return retData;
var retStruct = { 'CONTENTUPDATED': false, 'CONTENTUPDATERESPONSE': 'Success:0' };
var elementName = variables.voteElement;
var CCAPIName = variables.voteCCAPI;
var useCeRecordAPI = getUseCeRecordApiByElement(ceName=elementName);
if ( NOT useCeRecordAPI )
{
// Save the custom element record using the CCAPI
retStruct = Application.ptPoll.csContent.populateContent(CCAPIName, arguments.dataValues);
}
else
{
Request.User.enableApprovedPrivileges(Request);
// save the custom element record ceRecordAPI
retStruct = Application.ptPoll.gceRecord.saveRecord(ceName=elementName,dataValues=arguments.dataValues);
Request.User.disableApprovedPrivileges();
}
/* retStruct RETURNS: CONTENTUPDATED : true/false & CONTENTUPDATERESPONSE: Success:1 */
return retStruct;
var retData = ArrayNew(1);
// Check if the question ID is defined
if ( LEN(arguments.questionID) )
retData = application.ptPoll.cedata.getCEData(variables.voteElement, "questionID", arguments.questionID);
// Return the data
return retData;
SELECT *
FROM #pollTableName#
ORDER BY title, vote
SELECT *
FROM #pollTableName#
ORDER BY title, vote
SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = '#tableViewName#'
// Create the Poll Question View table
application.ptPoll.cedata.buildRealTypeView(elementName="Poll Question");
// Create the Poll Vote View table
application.ptPoll.cedata.buildRealTypeView(elementName="Poll Vote");
CREATE VIEW #tableViewName#
AS
SELECT TOP (100) PERCENT dbo.ce_Poll_QuestionView.title, dbo.ce_Poll_QuestionView.question,
dbo.ce_Poll_VoteView.vote, dbo.ce_Poll_VoteView.date, dbo.ce_Poll_QuestionView.active
FROM dbo.ce_Poll_QuestionView INNER JOIN
dbo.ce_Poll_VoteView ON dbo.ce_Poll_QuestionView.ID = dbo.ce_Poll_VoteView.questionID
ORDER BY dbo.ce_Poll_QuestionView.title, dbo.ce_Poll_VoteView.vote
SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = '#tableViewName#'
CREATE VIEW #TableViewName#
AS
SELECT TOP (100) PERCENT title, question, vote, COUNT(vote) AS voteCount
FROM #srcTableViewName#
GROUP BY vote, title, question
ORDER BY title, vote