Dynamic Table in Reference Field in Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2017 10:29 AM
Hi,
Here is a bit of background information of what we are trying to achieve. I created a record producer which will create a Project once it is submitted. The catalog form contains many fields so I created a custom formatter on the project table in order for the variable editor to show. Everything is working quite well until I noticed the Catalog Client Script and Catalog UI Policies are not running.
From what I read, there is no way to run Catalog Client Script and Catalog UI Policies out side of the RITM and Catalog Task table. Here is the reason why i need the scripts to run on project table. We have a "Client Type" field on the catalog form. It contains the values "Employee" and 'Vendor". Then there is a Reference field right next to it. Depends on the value selected in Client Type, "Emplyee" will show all the records from the sys_user table. Vendor will show records from the vendor table. I am struggling to find the best way to achieve this. The biggest challenge is that I have rouougly 10 sets of combo like this one on the catalog form. I don't mind creating the UI policies for the catalog form, but I don't want to create another set of the same UI policies on the Project table for the reason I mentioned in the first paragraph.
I have tried to few ways but none is an ideal solution. Here is what I tried and why they failed:
- Hacked the table value in Reference Field using client script. I was able to do it. The table changes dynamically but after the table is changed and a value is selected. I cannot see the value in the reference field in the variable editor in the Project atable because it is still using the original table for the reference field.
- Tried to create user and vendor reference field and use UI policies to show and hide them based on the Client Type. It failed because UI Policies don't run on Project table.
- Use method #1, but once the value is selected from the reference field, the name will be entered in a plain textbox and the reference field is hidden. The problem with it is that if the user wants to change to another user of the same Client Type, there is no way to achieve it because the reference field is now hidden.
I apologize for the long description of my problem and it can't be pretty confusing. For those of you who understand my problem, please let me know if you have better solution to my problem.
Thanks,
Sam
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2017 10:24 AM
I'm not sure how else you would do it. Perhaps others might chime in?
However, please note that Catalog UI Policies are different from UI Policies that run on a table. Catalog UI Policies apply "to either a specific catalog item or any item that uses a specific variable set" [0]. In contrast, UI Policies "dynamically change information on a form" [1]. So you can still use UI Policies on the project form/table to set fields visible, mandatory, or read only but they would have to be created separately from the Catalog UI Policies that you've created on the record producer. I'm also not sure that using a formatter on the project table is a great idea, I'd personally lean towards using UI Policies to show/hide the fields on the form as needed.
[0] http://wiki.servicenow.com/index.php?title=Service_Catalog_UI_Policy#gsc.tab=0
[1] http://wiki.servicenow.com/index.php?title=Creating_a_UI_Policy#gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2017 10:44 AM
i understand the difference between the Catalog UI Policies and UI Policies. Since I have about 10 set of those fields (Client Type and the Reference Field) on the catalog form, there will be a lot of scripts to maintain if i have to create them on both record producer and project table, even they are simple. That's why I am hesitant to replicate the UI Policies on the Project form.
You brought up using formatter is not a good idea, do you mind to explain further? I created a formatter so the variable editor can show in the Project table. I have over 50 fields on the catalog form (or in the variable set). Is there a better way to show that many fields on the form? I don't think I want to create those 50 fields on the Project table since this is for just a small area in our company and they are not the only one using Project in ServiceNow.
Thanks again
Sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2017 09:24 AM
Samuel,
Glad to see that you are using the Community to learn more.
The Customer Experience team is striving to ensure that customer queries posted from the HI Service Portal are answered in timely and accurate fashion.
If you feel your question has been resolved, please mark the appropriate reply in the thread as being the Correct Answer.
This enables other customers to learn from your thread.
Thank you in advance.
If you are viewing this from the community inbox you will not see the correct answer button. If so, please review How to Mark Answers Correct From Inbox View.
Regards,
Teena Singh
Customer Experience: UX Strategy and Customer Insights
teena.singh@servicenow.com
ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2017 10:24 AM
I can appreciate that the Customer Experience team is trying to provide more accurate and complete answers to Community posts. However, even just a cursory scan of this thread makes it pretty evident that his question is not yet answered. It was also posted just 24 hours ago.
Rather than blindly posting responses like this to unanswered threads, I feel it would further improve the customer experience if these types of posts were only made when it is fairly evident that a suitable solution has been suggested, but not yet marked as 'answered'. Just my two cents