Solved

How to create a view with creation method as Template

  • 2 September 2022
  • 2 replies
  • 70 views

Userlevel 2
Badge +3

Hello, 

We are trying to create a View with columns from three different tables. 

Created a view with whatever columns we needed:

Following code has been written as Views code group template.

select     ed.first_name                 as employee_name
         , ed.employee_detail_id     as employee_id
         , jd.manager_id             as manager_id
         , ts.project_id             as project_id
         , ts.project_activity_id    as project_activity
         , ts.iso_week_number        as week_number
         , ts.monday                 as monday
         , ts.tuesday                as tuesday
         ,ts.wednesday               as wednesday
         ,ts.thursday                as thursday
         ,ts.friday                  as friday
 from employee_detail ed  
 join time_sheet ts
      on ts.employee_detail_id = ed.employee_detail_id
 join job_detail jd 
      on jd.employee_detail_id=ed.employee_detail_id

 

 

But it shows following error while executing. 

Error message while executing view code group template

Tried as per the source available in  documentation. Why do i get this error, could someone help me out here?

Thank you

icon

Best answer by Mark Jongeling 2 September 2022, 21:17

View original

This topic has been closed for comments

2 replies

Userlevel 7
Badge +23

Hi Usha,

Have you tried to regenerate the code group and then generate and execute the code again? This should do the trick. As explained here: 

 

Also, make sure the order of the data model columns are the same as you have specified in your View code. It looks like your first data model column is "employee_detail_id" while your code column is "employee_name".

Userlevel 2
Badge +3

Thanks Mark!

It works after changing the order of columns and regenerating the code group.