force edit a readonly field

hind
Tera Contributor

Hi all,

we want to give the possibility to Change Author of KB article and since this field is read-only (OOB), to do this, 

I created an ui action "Change author" which calls a ui page that lists the active users as shown below : 

find_real_file.png

the problem is that I can not modify the KB with Published Retired and Outdated status (the Save doesn't work), 

the operation works very well for the rest of the cases : Draft, Review, Sheduled for publish and Pending retirement 

 

my ui page Client script :

find_real_file.png

uBest regards,

1 ACCEPTED SOLUTION

@hind 

Thank you for marking my response as helpful.

If my response helped you please mark it correct to close the question so that it benefits future readers as well.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

since it is readonly you cannot set it unless you try to make it readonly false

g_form.setReadOnly('author', false);

// then set the value.

If this doesn't work then use GlideAjax and update the author using Script Include function which would definitely work

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi,

thank you for your reply
certainly the author field is read-only but I can modify it if the status is one of: Draft, Review, Sheduled for publish in this case my script works very well it changes the author and saves the modification

 

 

Best Regards,

try either of the approaches and it should work fine

If my response helped you please mark it correct to close the question so that it benefits future readers as well.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi,

More details for the GlideAjax?

thanks!