- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2024 07:02 AM
Hi Team,
I am using DB view for showing combined value in variable of type reference. It works as expected and I am able to select appropriate value for the reference field.
But, the issue I am facing is, selected value is not being displayed while viewing the RITM variables. Variable being displayed has one of the sys_id from the DB view (either table1 or table 2 sys_id) but there is not display value being shown like normal reference field. Any suggestions will be appreciated.
As you see in the screenshot below, you can see DOB and Personal email address being fetched and shown properly but not cost code.
Thanks in advance!
Krishna
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 05:28 AM
Found a solution. Since DB view part is working just fine while submitting the request from catalog item, I created the Display Business rule on sc_req_item table to fetch the display value from the DB view and then created the catalog client script (applicable only to Requested Item) to set the value on load to the variable. Solution is bit twisted, but works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2024 09:09 AM
A database view combines data from two or more tables, but it is not a table itself. It does not store any records and doesn't have any attributes, not even sys_id. Consequently, there is no way to have reference fields or variables to point to "records" in a database view.
Your reference variable has to reference actual records from the actual table that is the source of data for the database view. However, your variable can only reference one table, not both at the same time.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 05:21 AM
I found solution. I am using Display Business rules to query the vie and send the Display value of the view to client side and then use the catalog client script (applicable only to Request Item) to set the value of the variable. It's twisted approach a bit, but works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 05:28 AM
Found a solution. Since DB view part is working just fine while submitting the request from catalog item, I created the Display Business rule on sc_req_item table to fetch the display value from the DB view and then created the catalog client script (applicable only to Requested Item) to set the value on load to the variable. Solution is bit twisted, but works.