AutoPopulate Project manager tagged to project
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-25-2023 09:58 PM
I want to auto populate project manager tagged to particular project. When Project manager is selected a choice field should have all the list of project tagged to that project manager.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-25-2023 10:20 PM - edited ‎12-25-2023 10:21 PM
Hi,
You can use the advance reference qualifier on project variables. Sample screenshot attached.
C |
If the provided solution meets your needs, kindly consider marking it as helpful and accepting it as the solution. This helps others who may have similar questions. |
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-25-2023 10:27 PM
Hi Mehar,
- If the data type of project is a 'Lookup select box' you can use reference qualifier to like with backend names of your variable as below-
javascript; "u_project_manager="+current. variables.project_manager;​
- If you are using select box you have to write on change client script for the list value autopopulation.
Please mark my answer helpful if it solved your issue.
Thanks,
Pankaj Kumar
you can learn more here: KB Article
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-25-2023 10:33 PM
Yes its type is select. I have written these Catalog client script and script include. But it is giving NULL value.
var fetch_delivery_manager = Class.create();
fetch_delivery_manager.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
deliveryManager: function() {
var projectName = this.getParameter('sysparm_prjName');
// var projectList = [];
var x = '';
var prj = new GlideRecord('pm_project');
//prj.addQuery('short_description', projectName);
prj.addEncodedQuery('short_description=' + 'Acme Workday to Payroll Automation'); //'Acme Workday to Payroll Automation'
prj.query();
gs.log('prj1:' + prj);
if (prj.next()) {
gs.log('prj2:' + prj);
//x= prj.getValue('u_delivery_manager');
x = prj.u_delivery_manager;
gs.log('prj3:' + x);
}
return x;
//short_description=Acme Workday to Payroll Automation
},
type: 'fetch_delivery_manager'
});
---------------------------------------------------------------------------------------------------------------------------------
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//var a=g_form.getValue('project');
//g_form.addInfoMessage(a);
var ga = new GlideAjax('sn_bcm.fetch_delivery_manager');
ga.addParam('syaparm_name', 'deliveryManager');
// ga.addParam('sysparm_prjName', g_form.getValue('project'));
ga.getXML(projectDetails);
alert('hi');
function projectDetails(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer);
//if(answer== true){
//var result = JSON.parse(answer);
g_form.setValue('bcp_approver', answer);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-25-2023 10:51 PM
HI Mehar,
It is better to use lookup select box in this place and go to type specification tab and do the following-
Lookup from table: pm_project
javascript: "your_lookup_table_field_name="+current. variables.project_manager;​
javascript: "your_lookup_table_field_name="+current. variables.project_manager+ "^your_lookup_table_2ndfield_name="+current. variables.other_variable_name;​
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-25-2023 11:11 PM
I tried your approach. Right now it is populating Project manager without any project selected.
The requirement is whenever a project is selected the project manager tagged to that project should populate in below field.