Database view clause help

pramn
Tera Guru

Hi Team , 

 

we are adding 3 tables 

pramn_0-1757300504641.png

based on demand no  i need to find project number  and based on project we need to find project task number .

here , the first is working fine , (demand based project ) however (project based task is not working )

getting below error .

pramn_1-1757300667836.png

in all 3 tables we have number is common between them , 

any help/suggestion will be much appreciated 

 

Many thanks !

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@pramn 

your where clause should be like this

Ensure you add the fields you used in where clause under View fields for respective tables

1) update where clause as this

AnkurBawiskar_0-1757303924199.png

 

2) add these fields as view fields under the view tables

a) Project Task -> add parent field as View field

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

3 REPLIES 3

RaghavSh
Kilo Patron

In the second query you have not used the variable pro, you have directly used pm_project_task.

you need to find the common field on project and project task and do a query like:

 

pro_number = ptask_number  // this is for reference, use actual fields


Raghav
MVP 2023

Hi Raghav , thanks for coming back 

I tried that  but  now no data showing up , 

pramn_0-1757302747760.png

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@pramn 

your where clause should be like this

Ensure you add the fields you used in where clause under View fields for respective tables

1) update where clause as this

AnkurBawiskar_0-1757303924199.png

 

2) add these fields as view fields under the view tables

a) Project Task -> add parent field as View field

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader