Issue in the update table

Dear all,

I have a code in the modified method table level of the ProjExtCatMap . Here if a user selected the category id Then automatically a enum field mapping has to be updated as true for the respective categoryid and projid.in the PrjExtCat Table.

public void modifiedField(fieldId _fieldId)
{

Object formDataSource;
CaeProjExtCat caeprojextcat;
;

super(_fieldId);

if(this.ExtCategoryId)
{
ttsbegin;
select forupdate projextcat where projextcat.CategoryID == this.CategoryID && projextcat.ProjId == this.ProjId && projextcat.Mapping == NoYes::No;
{
print projextcat.Mapping;
projextcat.Mapping = NoYes::Yes;
projextcat.update();
print projextcat.Mapping;
}
ttscommit;
}
}

when I run this code I get an error saying that projextcat cannot be updated. Please let me know if there is any other solution

Hi I am trying the same code in the update method. I think now its getting update.

Thanks