Database View - "invalid field" error with accurate field name

scwillson
Mega Guru

Hello, I am attempting to construct a database view in order to be able to report on variables from Record Producers (variables that don't necessarily cascade to the respective table).

I build a Database view containing Incident and Question Answer (question_answer is the table that contains all the Question and Answers from record producers). There is a field on question_answer that contains the sys_id of the record generated by the record producer, that it is related to; this field is called "table_sys_id".

I gave the Incident table a prefix of "inc" and the Question Answer table a prefix of "qa". The Where Clause fields were filled out as follows:

  • [question_answer] clause: qa_table_name = 'incident'
  • [incident] clause: inc_sys_id = qa_table_sys_id

For   both of these, I get the ERROR saying that the field name is an invalid field or not visible. This is for "qa_table_name" and "qa_table_sys_id"

I am unsure how to get this working. I am 100% sure that the field names are correct, so I'm assuming that the problem relates to them not being "visible". Any suggestions?

Here are my screenshot:

NOTE: only 1 of the 2 errors show at a time, it just depends which view table has a lower order. This screenshot is when "qa_table_name" is first.

find_real_file.png

1 ACCEPTED SOLUTION

scwillson
Mega Guru

Thanks for the dialog Jaspal, I've figured it out.



When it says that the field is not available or visible, I just added the specified field to the "view fields" under the appropriate "view table" record.



find_real_file.png


View solution in original post

7 REPLIES 7

Jaspal Singh
Mega Patron
Mega Patron

Hi Simon,



Try keeping only below where clause



inc_number=qa_table_sys_id



As for the incident records that you want can be filtered when a report will be created on the database view.


That doesn't change anything, I still get the error about the "qa_table_sys_id" being the issue.


"Where clause in view u_record_producer_view has an invalid field or a field that is not visible (qa_table_sys_id)"


Is there a particular ACL I need to check for, on the Question Answer table? or field?


I tested the same & it worked.



Kindly find it as below


find_real_file.png



Only thing is you need to replace hr_case table with incident table & rest remains the same.