Hi,
i facing issue in fetching all subgrid rows values(looping through) via jscript. eg i m having 3 rows on subgrid(decison) on case form and i need to check three fields(panel decision(option set) , date of sumission(date), durationofdeferralinmonths( numeric) values as condition in any one of row records. in javascript i m unable to fetch all 3 rows also i m unable to fecth option set field, date field , etc value from records.
i m trying following methods not getting expected result. someone please suggest me on it.
varformContext=executionContext.getFormContext();
//Collecting Subgrid Context.
varDecisiongridContext=formContext.getControl("Subgrid_Decisions");
//Collecting Subgrid Rows.
varmyRows=DecisiongridContext.getGrid().getRows();
//Obtaining Total Row Count.
varRowCount=myRows.getLength();
alert('Decision Grid RowCount: '+RowCount);
//loop through each row to get values of each column
myRows.forEach(function (row, i)
{
vargridColumns=row.getData().getEntity().getAttributes();
//loop through each column in row
gridColumns.forEach(function (column, j)
{
varatrName=column.getName();
varatrValue=column.getValue();
});
});
try2:
varformContext=executionContext.getFormContext();
varDecisionmonth=[],i;
varDecisiongridContext=formContext.getControl("Subgrid_Decisions");
//Collecting Subgrid Rows.
varmyRows=DecisiongridContext.getGrid().getRows();
//Obtaining Total Row Count.
varRowCount=myRows.getLength();
alert('Decision Grid RowCount: '+RowCount);
if(RowCount==0)
{
setTimeout (DecisionSubGridExecution(),2000)
return;
}
for(i=0;i<RowCount; i++)
{
varrowEntity=myRows.get(i).getData().getEntity();
alert(rowEntity.attributes.get("durationofdeferralinmonths").getValue());
Decisionmonth[i]=rowEntity.attributes.get("durationofdeferralinmonths").getValue();
}






