I need to create a copy of a an existing custom ro...
# general
j
I need to create a copy of a an existing custom role, but using a different custom centre. I cannot edit the centre on an existing role, as it’s not editable, and there’s no “make copy” on role, only “save as” which still doesn’t give me the option to set the center before saving. I really REALLY don’t want to have to manually add in all the permissions to the new role. Thoughts?
a
might be possible in create mode to use nlapiSetFieldValue in the console to set the center you want?
r
Unfortunately I don't think you have any other options. They don't seem to want to add functionality to make life easier on Admins. Which I get, but is still annoying. Maybe you could use one of the out of the box roles with that centre that's close-ish to the same and then adjust it to where it needs to be? Then at least you wouldn't be starting completely from scratch.
a
FYI I just tried the console approach and it does work, shockingly
Basically do a save-as to create your new role, then go back in and edit, and use this command
nlapiSetFieldValue('centertype', 'SALESCENTER')
👍 1
(I somewhat guessed as to what the value should be for the enum)
you could use field explorer plugin or view XML to see what values are used for other roles and copy that
a
I tried that too and it worked!
r
That's good to know. I'm kind of shocked that worked too
a
I'm VERY shocked. I feel like when I try that on read-only fields on other objects, my success rate is less than 10%
j
Yeah I’ve used this trick before
will be handy because:
message has been deleted
r
I mean who can be expected to get anything accomplished in 16 years?
a
Ha!
j
turns out you can use the console to change the center on existing roles too
bwa hah hahh
take that NS
stanley 1
a
Yep! I'm definitely going to tuck this one away for later, I'm sure I've had someone ask me to do this in the past and I told them it couldn't be done
a
Now I'm gonna try this on the many fields I thought it couldn't be done too!
a
Report back @Abdul Ali if you find any that work!
a
Will do
j
I do this all the time for fields that are read only for our team, lol.
a
@jen
j
wait, we have history in Slack now?
It’s funny, I remembered trying this before and tried it again today but it didn’t work the first time I tried so I figured I was remembering wrong
lol
thank you, past me
a
ha, i've definitely been there
i suppose it could also be that it worked 7 months ago, but doesn't now - we are in a different version of NS presumably
j
nah, it’s working, just doesn’t SHOW that it worked till you actually save
a
ahh