Page 1 of 1

redirect from browse form to edit form dep on userid or grp

Posted: Mon Dec 31, 2018 8:45 am
by diveguy
I have a few edit forms, and I have copies of all of them that are modified for mobile viewing. The browse forms are good enough to use in either case.
I would like to be able to redirect the user to the appropriate edit form based on their userid or group. Ie: browseForm.redirectTo = user.group == "mobile users" ? mobileEditForm : desktopEditForm
But I can't find a way of doing this. Is it possible?

Re: redirect from browse form to edit form dep on userid or

Posted: Mon Dec 31, 2018 9:24 am
by kev1n
Hi,

You can do that by implementing your own nuSelectBrowse() function and then open the corresponding form from there.

https://wiki.nubuilder.cloud/ ... lectBrowse


Something like this:

Code: Select all

function nuSelectBrowse(e) {

    var r = $('#' + e.target.id).attr('data-nu-primary-key');  // row id

    var alc = nuAccessLevelCode();
    if (alc == "mobile users") { 
        nuForm(mobileEditForm, r);  // replace with the form id 
    } else {
        nuForm(desktopEditForm, r);  // replace with the form id  or use nuGetProperty('form_id');
    }
}

Re: redirect from browse form to edit form dep on userid or

Posted: Tue Jan 01, 2019 8:21 am
by diveguy
Thank You!

Re: redirect from browse form to edit form dep on userid or

Posted: Tue Jan 01, 2019 9:29 pm
by admin
.