register manual checks

Hi,

I have a script to add manualChecks to Sage100. It works.

I want to register the checks through in the code. I tried to do it with the code I used to register invoices:

invoice.nSelectBatch(batch);
invoice.nSetPostingDate("20270531");
invoice.nInitReportEngine();
invoice.nProcessReport("deferred");
invoice.nUpdateInit();
invoice.nUpdateMain();
invoice.nUpdateCleanup();

the code above works for invoices. when trying on manualChecks, it fails on the call "nUpdateMain()" with error 538.

Does anyone know why does it happen? Or how to do the correct register?