- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 08:36 PM
Hi Everyone,
I am trying to display the value on stakeholders table that is currently related list into Project.
Which i want to display the value using client script on this below field.
Can you check this below code ?
function onLoad() {
var PO = new GlideRecord('pm_m2m_project_stakeholder');
PO.addQuery('project');
PO.addQuery('expectationINproject_owner');
PO.query();
if (PO.next()){
g_form.setDisplay('u_project_owner' , PO.stakeholder.user.name.getDisplayValue() );
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2024 12:31 AM
Hi @Jeck Manalo
Yeah....Its best practice now a days to use flow designer instead of business rule on table....indeed.
Fix script : It is server side script similar to business rule to update records in bulk manner which you can run on demand.
E.g., If you want to update the state of incident to closed which are older that 6 months like wise...
another example with screenshot :
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2024 01:36 AM
I figured out that I just need to reconfigure my works on flow designer.
its now working 🙂 but thank you for those idea it's help a lot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 10:20 PM
You can indicate condition(s) for BR to run under When to Run tab. No need to run Query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 10:54 PM
I think if I create BR it's just the same on my flow designer. When someone update the record then it will show on the field.
But as per requirement .
The record on stakeholders is just tranferred from demand into project. So no need to insert/update the record on the stakeholders since its already there. Which is not showing using flow designer since its need to create/update the record before it will appear on the field and I think this is similar on your suggestion for BR.
That is why I want to populate the record using client script. Any ideas ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 11:29 PM
Hello @Jeck Manalo
If my understanding is correct then ,
1. There is custom 'u_project_owner' field on 'pm_project' table (what is the type of this custom field ..??)
2. In related list of there is tab for stakeholders (pm_m2m_project_stakeholder)
like below --
So you need to populate name of stakeholders related to Project to be displayed on 'u_product_owner' field which is present on 'pm_project' form...??
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 11:34 PM
yes, you are correct its a custom field created by me.
all i need is to get the record on stakeholders that function is Project Owner.
type is "reference" for u_product_owner.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 11:36 PM
So you need to populate name of stakeholders related to Project to be displayed on 'u_product_owner' field which is present on 'pm_project' form...?? - yes correct, there is a different view that will show the 'u_project_owner'.
