I was trying to get my project issue records more cleanly from the resultSet that I created. I had been using findAll({}) to get them all into an array for filtering. When I changed to duplicate() I got the below error from the following code.
Results in the following error.
What worked was the following, to which I will go back.
Is there a more direct way (i.e. without criteria) to get resultSet records in an Array? And, if you are up to it, can you explain what is a 'shallow copy'?
Thanks,
Rick
P.S. I am running SmartClient Version: v8.2p_2013-01-14/EVAL Development Only on Mozilla Firefox 12.0 with Firebug using Windows XP Pro 32 bit.
Code:
var issueCriteria = { }; if (!(typeof tRec.IssueTypeID === "undefined")) { issueCriteria.IssueTypeID = tRec.IssueTypeID; } if (!(typeof tRec.CategoryID === "undefined")) { issueCriteria.CategoryID = tRec.CategoryID; } if (!(typeof tRec.ImpactID === "undefined")) { issueCriteria.ImpactID = tRec.ImpactID; } Log.logDebug("************ filtering project issues with: " + this.echo(issueCriteria)); Log.logDebug("************ from " + Application.ProjectIssue.getLength() + " records"); //Log.logDebug("************ of which the first is " + this.echo(Application.ProjectIssue.get(0))); var issueResults = []; issueResults = Issue.applyFilter(Application.ProjectIssue.duplicate(), issueCriteria);
Code:
12:34:31.305:TMR2:DEBUG:Log:************ issueGrid isc_ListGrid_0 created for topic# 1 12:34:31.305:TMR2:DEBUG:Log:************ filtering project issues with: {ImpactID: 101} 12:34:31.305:TMR2:DEBUG:Log:************ from 9 records 12:34:31.321:TMR2:WARN:Log:TypeError: this.newInstance is not a function unnamed() getIssueGrid({Obj}) ListGrid.expandRecord(_1=>{Obj}) unnamed({Obj}, [object Array], {Obj}) [c]Class.fireCallback(_1=>function (dsResponse, data, dsRequest), _2=>"dsResponse,data,dsRequest", _3=>[object Array], _4=>{Obj}, _5=>undef) [c]Class.fireCallback(_1=>function (dsResponse, data, dsRequest), _2=>"dsResponse,data,dsRequest", _3=>[object Array]) DataSource.fireResponseCallbacks({Obj}, {Obj}, {Obj}, {Obj}) DataSource._completeResponseProcessing({Obj}, {Obj}, {Obj}, {Obj}, {Obj}) DataSource._handleClientOnlyReply({Obj}, {Obj}, {Obj}) [c]Class.fireCallback(_1=>{Obj}, _2=>"rpcResponse,data,rpcRequest", _3=>[object Array], _4=>{Obj}, _5=>undef) [c]Class.fireCallback(_1=>{Obj}, _2=>"rpcResponse,data,rpcRequest", _3=>[object Array]) [c]RPCManager.fireReplyCallback(_1=>{Obj}, _2=>{Obj}, _3=>{Obj}, _4=>{Obj}) [c]RPCManager.fireReplyCallbacks(_1=>{Obj}, _2=>{Obj}) [c]RPCManager.performOperationReply(_1=>{Obj}, _2=>{Obj}) RPCManager._performTransactionReply(29) [c]Class.fireCallback(_1=>{Obj}, _2=>undef, _3=>[object Array], _4=>{Obj}, _5=>true) Timer._fireTimeout("$ir676") unnamed() unnamed() @
Code:
var issueCriteria = { }; if (!(typeof tRec.IssueTypeID === "undefined")) { issueCriteria.IssueTypeID = tRec.IssueTypeID; } if (!(typeof tRec.CategoryID === "undefined")) { issueCriteria.CategoryID = tRec.CategoryID; } if (!(typeof tRec.ImpactID === "undefined")) { issueCriteria.ImpactID = tRec.ImpactID; } Log.logDebug("************ filtering project issues with: " + this.echo(issueCriteria)); Log.logDebug("************ from " + Application.ProjectIssue.getLength() + " records"); //Log.logDebug("************ of which the first is " + this.echo(Application.ProjectIssue.get(0))); var issueResults = []; issueResults = Issue.applyFilter(Application.ProjectIssue.findAll({}), issueCriteria);
Thanks,
Rick
P.S. I am running SmartClient Version: v8.2p_2013-01-14/EVAL Development Only on Mozilla Firefox 12.0 with Firebug using Windows XP Pro 32 bit.
Comment