Highlighted
pbustin Outstanding Contributor.
Outstanding Contributor.
120 views

Can javascript write a values to a user field?

I have succeeded in writing a value to a single selection field in javascript.  Is there a way of writing a value to a user field?

Labels (3)
0 Likes
5 Replies
Micro Focus Expert
Micro Focus Expert

Re: Can javascript write a values to a user field?

Tell us more about what you are doing.  You can use JavaScript to set the value of a user field.  You should even be able to control what values appear in the user field drop down.  However, setting the value of the field requires that the value exists in the drop down which means that you likely do not want the field to have the allow field to be searchable value checked.

 

-David

0 Likes
pbustin Outstanding Contributor.
Outstanding Contributor.

Re: Can javascript write a values to a user field?

Thank you, David. I don't recall seeing examples in Composer > Help > javascript reference, etc.


0 Likes
pbustin Outstanding Contributor.
Outstanding Contributor.

Re: Can javascript write a values to a user field?

To answer your question: In general, I have several appscripts that in one manner or another write numeric values to user fields.  Instead, I simply want to write the name to the field in a javascript.

0 Likes
pbustin Outstanding Contributor.
Outstanding Contributor.

Re: Can javascript write a values to a user field?

To elaborate on my answer to your question: I recently learned that I could use javascript to write values to single selection fields, so I replaced an appscript that wrote numeric values to a field with a javascript that writes literals to the field.  Thus encouraged, I reasoned that I might be able to replace my appscripts that write numeric values to user fields, with a javascript that writes names to the fields.

0 Likes
pbustin Outstanding Contributor.
Outstanding Contributor.

Re: Can javascript write a values to a user field?

To elaborate even further, Daniel helped me see that in a different environment, the number values I was writing to a single selection field in an appscript would be different in the different environment, so the script was failing to write to the field--even though inexplicable, the Event Viewer displays sent by the appscript showed the correct value was being written to the field.  So I created a javascript that worked.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.