Page 1 of 1

Redirect to another form. Uncaught Error

Posted: Thu May 16, 2024 1:54 pm
by Giu
I have this code on a Custom Code's Edit Form.

Code: Select all

function nuAfterSave(){
    nuForm('PRM_MIS_ENFRENTAMIENTOS', '', '', '', 0) ;
}
What I want to achieve, is once the record is created and all event cycle finish, just redirects to a browser form.

My issue is I get an Uncaught error.
ScjrSKapRJ.png
If change last parameter same error. If I remove the function it works.

Some idea?

EDITED:
Web Console empty. Debug window empty.

Re: Redirect to another form. Uncaught Error

Posted: Thu May 16, 2024 2:53 pm
by kev1n
Pass the form ID (Primary Key) to the function nuForm() and not the Form Code.

Re: Redirect to another form. Uncaught Error

Posted: Thu May 16, 2024 3:07 pm
by Giu
ok, I'm stu##d. Thanks, works like a charm

Re: Redirect to another form. Uncaught Error

Posted: Wed Jul 10, 2024 4:07 pm
by Giu
Sorry for bump this, but I noticed this stopped working, and I have no idea why.

I have this code:

Code: Select all

function nuAfterSave(){
   console.log("After save disparado");
    nuForm('code:GRM_MIS_ENFRENTAMIENTOS', '', '', '', '1') ;
}
Nothing is shown in the console, and obviously, redirection is not working either. Page is refreshed and the PHP code on AS is done too.
I tested nuForm function manually and it works as expected.

Re: Redirect to another form. Uncaught Error

Posted: Wed Jul 17, 2024 7:30 am
by kev1n
Does it work when you pass the form ID as first parameter?

Re: Redirect to another form. Uncaught Error

Posted: Wed Jul 17, 2024 8:43 pm
by Giu
kev1n wrote: Wed Jul 17, 2024 7:30 am Does it work when you pass the form ID as first parameter?
Will test, had to stop working on the project some days, but AFAIR failed with ID and code, but again, will test.