Record producer not adding look up field variable to the produced record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2024 08:04 AM
Hello!
I am having issues with a variable I created on a record producer for the "Standard Change Template Proposal" What I am trying to do is have that field simply populate the Assignment group based on that field in the record producer (which is a look up field on the sys_user_group field)
here is my script that I have written on the script field on teh record producer.
producer.redirect = current.getLink(true);
gs.addInfoMessage(gs.getMessage('A Standard Change Proposal was created successfully. You can review this proposal later via Change > Standard Change > My Proposals'));
if (producer.template_approval_manager_assignment_group != '') {
current.assignment_group = producer.template_approval_manager_assignment_group;
}
Any help will be awesome! Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2024 08:14 AM
producer.redirect = current.getLink(true);
gs.addInfoMessage(gs.getMessage('A Standard Change Proposal was created successfully. You can review this proposal later via Change > Standard Change > My Proposals'));
if (producer.template_approval_manager_assignment_group && producer.template_approval_manager_assignment_group.sys_id) {
current.assignment_group = producer.template_approval_manager_assignment_group.sys_id;
} else {
gs.addErrorMessage('Assignment group is not specified.');
}
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2024 08:26 AM
Thank you for the help. but it is giving me the error that you set up. Do you have an suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2024 08:30 AM
If you're receiving the "Assignment group is not specified" error message, it suggests that the condition producer.template_approval_manager_assignment_group && producer.template_approval_manager_assignment_group.sys_id is evaluating to false, indicating that either producer.template_approval_manager_assignment_group is not defined or it doesn't have a sys_id.
Check Field Configuration: Verify that template_approval_manager_assignment_group is correctly configured on your record producer. Ensure that it is a reference field to the sys_user_group table and that it allows the selection of a valid assignment group.
Check Field Value: Before the if condition, add a gs.info statement to print out the value of producer.template_approval_manager_assignment_group and producer.template_approval_manager_assignment_group.sys_id. This will help you debug and see what values are being passed.
Adding few more logs to debug:
producer.redirect = current.getLink(true);
gs.addInfoMessage(gs.getMessage('A Standard Change Proposal was created successfully. You can review this proposal later via Change > Standard Change > My Proposals'));
gs.info('template_approval_manager_assignment_group: ' + producer.template_approval_manager_assignment_group);
gs.info('template_approval_manager_assignment_group.sys_id: ' + producer.template_approval_manager_assignment_group.sys_id);
if (producer.template_approval_manager_assignment_group && producer.template_approval_manager_assignment_group.sys_id) {
current.assignment_group = producer.template_approval_manager_assignment_group.sys_id;
} else {
gs.addErrorMessage('Assignment group is not specified.');
}
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2024 08:39 AM
still getting the same issue. Any ideas?