It seems that this should be simple to do, but I am too Javascript challenged to figure this out.
I want to construct a calculated field to show on a list form whose value is the value of another dataprovider in the same table where the dataprovider name is provided in a global field, rather than hard-coding the dataprovider name in the calculation method. Obviously returning the global field (eg. return scopes.globals.fieldName) doesn’t work. I gather that i need to return an object but not sure how to construct it? I also tried writing a form method that returns the value of getDataProviderValue() to the calculation, but this only gives the value of the first record of the foundset, rather than the value for each individual record as would be the case if the dataprovider was hardcoded into the method.
Thanks for your reply and suggestion, but it doesn’t seem to work. What is returned from the calculation is the value of “fieldName” for the first record in the foundset for all of the records, instead of the specific value of “fieldName” for each record. This is the same result I got when trying to pass a form method’s dataProviderValue to the calculation - it doesn’t recalculate for each row, Your code also throws the following warning: “Reference to undeclared variable or property foundset”, so apparently foundset is not understood in the context of a table calculation. Any other suggestions?