Asset tag, serial number is null in database view

Nithin21
Tera Expert

Why are some fields empty in the data generated by Database view. 

Note: This is done on OOB instance without any customizations

Example:

Configure Database view on alm_hardware table 

find_real_file.png

Select below mentioned 3 fields under "View Fileds" menu

find_real_file.png

View the data using "Try it" menu. All the records have Asset Tag and Serial number as empty

find_real_file.png

 

 

 

 

 

1 ACCEPTED SOLUTION

Deepak Ingale1
Mega Sage

Interesting !!!

 

I tried that in my personal instance and got same result !!!

 

When debugged, found that access to serail_number and asset_tag field dependent of "quantity" field

 

So, please add quantity field as another field in view fields related list and see the magic !!!

 

Note: Please mark reply as correct if it answers your question

View solution in original post

9 REPLIES 9

Hi Nithin , 

Did you get any solution for the issue ? I am facing the same issue.

Hi @Oli Sarkar  @Nithin & @Deepak Ingale,

 

 

We are also facing exactly the same issue.

 

In a customer instance, Even when the quantity is 1 for the asset record , the asset tag is not getting displayed on the database view. If we disable the ACL  on the asset tag field it is getting displayed.

 

 

Thanks in advance!

Nikesh

Hi Nikesh, 

I got this resolved by creating ACLs on database view.

Unlike ordinary base tables in a relational database, a view does not form part of the physical schema. As a result set, it is a virtual table dynamically computed or collated from data in the database when access to that view is requested.

It is important to understand that table level ACL is not applicable on database views. Assuming that the underlying table ACL will be applicable to Views is not correct. To safeguard the underlying table information as exposed through a View, a user needs to create an ACL on views.

The Field level ACLs(e.g. table.field, table.*) will still be applicable in viewing the result of join since the fields in Database view are actually a dynamic link to the physical fields. 

Please find the summary of the ACL behavior in the following list:

  • Table-level ACL for database view (e.g. Incident SLA.None) is checked when a database view is viewed 
  • Table-level ACL for physical table (e.g. Incident.None) is NOT checked when a database view is viewed 
  • Field-level ACL for physical table (e.g. Incident.Number) is checked when a database view is viewed 
  • Field-level ACL for database view (e.g. Incident SLA.Number) is NOT checked when a database view is viewed 

This capability is provided by the ServiceNow instance through the following steps:

  1. Elevate your role to security_admin.
  2. Go to System Definition > Database Views.
  3. Open any database view from the list.
  4. Right-click and select Configure > Security Rules.

 

Please refer the link for more details : https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0535471

 

 

Hi,

 

Can you please give a snapshot of ACL that you have created?

 

Even after creating an ACL it is not working for me.

 

 

Thanks in advance!!

Nikesh

Thank you SO much!!!