- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Custom Object to Set User/Group Popup Field
I am having trouble setting a user/group field value in 5.1 with Javascript.
I'm able to make the correct user appear in the user/group box, but when I click Save and Close, then reopen the record, the field is blank again.
Is there a way to set a user/group field if I am able to obtain the user account id?
- Tags:
- 5x_javascript
- Archer
- Community Thread
- custom_objects
- Discussion
- Forum Thread
- javascript
- RSA Archer
- RSA Archer Suite
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
James see if this works.
<script type="text/javascript">
Sys.Application.add_load(function() {
var fldId = 1234
var userId = 4567
ArcherTech.UI.GenericContent.GetInstance().setFieldValue(fldID, userId, '')
});
</script>
Advisory Consultant - Archer, an RSA Business
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
David,
The function you gave me in the other thread works great to GET the current value:
ArcherTech.UI.GenericContent.GetInstance().getFieldValue(fldId, false)
This is giving me a value of 230:1
When I try to set the field to 240:1 (a different user), it does nothing (in edit or view mode).
I also tried passing simply 240 instead of the colon 1, as well as used an array to pass. Still no luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
If its possible to get the field, it should be possible to set, wouldn't you think?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
One would think
The following code will return the users' name instead of the users' id.
<script type="text/javascript">
Sys.Application.add_load(function() {
var fldId = '14939';
var userParentElement = ArcherTech.UI.GenericContent.GetInstance()._fieldsControls["f"+fldId];
var vUser = JSON.parse(document.getElementById(userParentElement+'_shf').value);
$.each(vUser, function(i, item) {
alert(item.name);
});
});
</script>
Advisory Consultant - Archer, an RSA Business
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I'm getting a Javascript error that "JSON is undefined"
Will I be able to set the value for each element using this script?
i.e.:
item.name = "Smith, Jane"
item.value = "Smith, Jane"
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Using Firefox, I was able to trigger this. item.name is the user's name and item.value is their user account ID#.
Now I need to change this value to something else, but setting item.name and item.value doesn't work.
Thoughts?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I've been able to set the HTML correctly to update the user, but when I click Save and Close, the change is not saved.
If I set the HTML and click on the ... elipses to popup the user window, the correct user is there and if I click OK, then save the record, the change is saved.
Is there a method I can call to mark this field as changed so it saves correctly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi James,
I did something similar in V4.5. Once you set the users you had to call another couple of functions:
fieldEvent(xxxxx);
RefreshUserText("fldxxxxx", false);
ShowUserPicker(event, 'fldxxxxx');
Where xxxxx is the field ID. Maybe there's something similar for V5.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thanks Neil!
This is exactly what I need.
Anyone from Archer know what the v5 call is for RefreshUserText?
Maybe:
ArcherTech.UI.GenericContent.GetInstance()
.RefreshUserText("fldxxxxx", false);
