Method for Save button

Hi ,

Could you please tell me the method for the save button.I designed a grid in the employee details form.In that there is a field called assignment drop down which has Office and Site as fields.This is saving in a table called TAbleB.When the user selects the assignment dropdown with a selection of office then the checkbox field which is from Table A nees to be updated as 1 on saving.And when the user selects Project as dropdown then checkbox from the tableA has to be updated as 0 on save.Please let me know in which method shoul i write the code.I already wrote a code in modified field method but its very very slow.

public void modifiedField(fieldId _fieldId)
{
CaeEmpl1 _caeempl1;
EmplTable _emplTable;
super(_fieldId);
While select _caeempl1
{
ttsbegin;
Select forupdate _emplTable where _emplTable.EmplId == this.EmplId;
{
if (this.Assignment == 1)
{
_emplTable.caeWebTS = 1;

_emplTable.update();
}
else
{
_emplTable.caeWebTS = 0;

_emplTable.update();
}
}
ttscommit;

}
}

You need to place code in the update/insert(depending on the situation) method, as the modify/changing a field value does mean the save, the final record save may be skipped. Not sure about the requirement, but your while select will loop all the records as no criteria has been included in the where clause, modify your query so that you fetch only the required record(as primary step of optimization). Your query is basically not correct you are looping through the caeempl1 table records, but not doing any action with that selected table record, so that while statement can be removed.

Ya Kranthi i found the solution.I wrote in the modifield method itslf and it worked.I pasted a wrong code with a while.It was not saved in my server as well…Anyway thanks…