Finding and inserting value into field in repeating subform using javascript
Hi,
I'm trying to use to Identify a field and insert a value in a repeating form -
to each line created with a script, I want the system to find the field, and insert a value that I need.
I've tried to use GetSubformData method, but I get [object object] response.
Any Help?
the subform is named "SubFormQuarters", and the field is a drop down field named "Quarter".
Any idea how to do that?
In addition, I've tried to use GetFieldValue script to check if it works,, but the system doesn't return the values in the designated field
var options = {};
options.fieldId = 'SubFormQuarters/Quarter: [i]'; //I'm using it in a loop, i being the current loop counter
eFormHelper.getFieldValue (options, function (result)
{
if (result.isSuccess) //check if is success
{
console.log(result.data); //logs the data holds the found control's value
}
else
{
console.log(result.error); //logs the error
}
});
Help with that will also be appreciated.
Thanks,
Nitai
-
There seems to be a syntactical error in your code for GetFieldValue . Try the below code
var options = {};
options.fieldId = 'SubFormQuarters/Quarter:[' + i + ']'; //I'm using it in a loop, i being the current loop counter
eFormHelper.getFieldValue (options, function (result)
{
if (result.isSuccess) //check if is success
{
console.log(result.data); //logs the data holds the found control's value
}
else
{
console.log(result.error); //logs the error
}
});
Please sign in to leave a comment.
Comments
1 comment