Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Clone Event - change field access

Questions related to using nuBuilder Forte.
Locked
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Clone Event - change field access

Unread post by toms »

Hi,

How do I detect a clone action? What I'd like to do is to change the Access of an object from Readonly to Editable after the record has been cloned.
E.g. a field "employee number" is normally readonly and not changeable unless the record is cloned.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Clone Event - change field access

Unread post by admin »

toms,

I have now added nuIsClone(). http://wiki.nubuilder.net/nubuilderfort ... #nuIsClone

Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: Clone Event - change field access

Unread post by toms »

Thanks, now I can change the visibility with this piece of code:

Code: Select all

if (nuIsClone()) {nuEnable('myfield');} else {nuDisable('myfield');};
Now I just need to figure out how to trigger it. As soon as the "Clone'-button is clicked, the code should be executed.


Edit: I attached another click handler to the clone button:

Code: Select all

$("#nuCloneButton").click(function() {
    if (nuIsClone()) {nuEnable('myfield');} else {nuDisable('myfield');};
});
On second thought I wouldn't need the nuIsClone() with this solution. Or is there a better way to do it?
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Clone Event - change field access

Unread post by admin »

toms,

That is now done in Github.

http://wiki.nubuilder.net/nubuilderfort ... #nuOnClone

nuIsClone() will still be useful.

Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: Clone Event - change field access

Unread post by toms »

Thank you, that's exactly what I need.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Clone Event - change field access

Unread post by admin »

.
Locked