Hi,
I am using the solution model to add a column to table view. I am assigning a method to the onAction event using the following code:
var columnField = thisForm.newField(recCaseActionCategory.category_name.replace(" ", "_") + "_icon", JSField.IMAGE_MEDIA, currentX, colHeight, colWidth, colHeight);
columnField.name = recCaseActionCategory.category_name;
columnField.scrollbars = SM_SCROLLBAR.HORIZONTAL_SCROLLBAR_NEVER | SM_SCROLLBAR.VERTICAL_SCROLLBAR_NEVER;
columnField.toolTipText = recCaseActionCategory.category_name;
columnField.onAction = solutionModel.wrapMethodWithArguments(solutionModel.getGlobalMethod("myScopeName", "myMethodName"), [null, recCaseActionCategory.case_action_category_id]);
So far this has worked fine but the requirements have changed and I now need to add an additional argument to the function which is the primary key of the record that is selected when the column field is clicked. My problem is I cannot find a way to pass this as an argument. I have tried the following code:
var columnField = thisForm.newField(recCaseActionCategory.category_name.replace(" ", "_") + "_icon", JSField.IMAGE_MEDIA, currentX, colHeight, colWidth, colHeight);
columnField.name = recCaseActionCategory.category_name;
columnField.scrollbars = SM_SCROLLBAR.HORIZONTAL_SCROLLBAR_NEVER | SM_SCROLLBAR.VERTICAL_SCROLLBAR_NEVER;
columnField.toolTipText = recCaseActionCategory.category_name;columnField.onAction = solutionModel.wrapMethodWithArguments(solutionModel.getGlobalMethod("myScopeName", "myMethodName"), [null, recCaseActionCategory.case_action_category_id, forms[formName].foundset.getSelectedRecord().getPKs()]);
but this just results in the error:
Stale form(s) detected, form(s) were altered by the solution model without destroying them first
Can anyone let me know how I need to specify my argument such that the called method receives the primary key of the currently selected record when the column field is clicked please?
Thanks
Steve