Validate write failing in form for number sequence


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(

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.

Could you please elaborate your actually problem, i.e. “when I try to exit from the form, the navigation is stopped”. It would be useful to know what exactly happens.

By the way, please use Insert > Insert Code to paste source code. It keeps indentation (and it event supports syntax highlighting), making your code easier to read.

Thanks, will do that. Also it seems had missed a call to super() in the close() method, hence was getting the error. It’s resolved now.