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.
var formContext = executionContext.getFormContext();
//Collecting Subgrid Context.
var DecisiongridContext = formContext.getControl("Subgrid_Decisions");
//Collecting Subgrid Rows.
var myRows = DecisiongridContext.getGrid().getRows();
//Obtaining Total Row Count.
var RowCount = myRows.getLength();
alert('Decision Grid RowCount: '+RowCount);
//loop through each row to get values of each column
myRows.forEach(function (row, i)
{
var gridColumns = row.getData().getEntity().getAttributes();
//loop through each column in row
gridColumns.forEach(function (column, j)
{
var atrName = column.getName();
var atrValue = column.getValue();
});
});
try2:
var formContext=executionContext.getFormContext();
var Decisionmonth=[],i;
var DecisiongridContext = formContext.getControl("Subgrid_Decisions");
//Collecting Subgrid Rows.
var myRows = DecisiongridContext.getGrid().getRows();
//Obtaining Total Row Count.
var RowCount = myRows.getLength();
alert('Decision Grid RowCount: '+RowCount);
if(RowCount==0)
{
setTimeout (DecisionSubGridExecution(),2000)
return;
}
for(i=0;i<RowCount; i++)
{
var rowEntity=myRows.get(i).getData().getEntity();
alert(rowEntity.attributes.get("durationofdeferralinmonths").getValue());
Decisionmonth[i]=rowEntity.attributes.get("durationofdeferralinmonths").getValue();
}