Validate write failing in form for number sequence

Hi,

I am creating a new number sequence and using it in my custom form, the number sequence is generated fine eg USMF-000060 However when I try to exit from the form, the navigation is stopped. I have written the code at my form level as follows: 

public NumberSeqFormHandler numberSeqFormHandler()
{
if (!numberSeqFormHandler)
{
numberSeqFormHandler = NumberSeqFormHandler::newForm(
ProjParameters::numRefPMAContractId().NumberSequenceId,
element,TOAPMAProjContractHeader_ds,fieldNum(TOAPMAProjContractHeader,PMAContractId));

}
return numberSeqFormHandler;
}

and validateWrite at the datasource of the form:

public boolean validateWrite()
{
boolean ret;
ret = super();
ret = element.numberSeqFormHandler().formMethodDataSourceValidateWrite(ret);

return ret;
}

Any help would be much appreciated. Thanks.

Related
Recommended