Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

using views in form wizard

Post Reply
ironoverload
Posts: 1
Joined: Mon Jun 09, 2014 4:29 pm

using views in form wizard

Unread post by ironoverload »

Hi There this is my first post,

I searched the forum for an answer but didn't find one.

I'm trying to create a form using the form wizard.

I'm receiving the following error "Form wizard can't detect primary key on selected table".
My first question is, does nubuilderpro v3 work with MySQL Views or just tables?
If it does work with views what am I doing wrong?

The underlying Table my View is based on has a PK on the ID field.
My View is here:-

Code: Select all

SELECT table.ID, Category_Code,
	SUM(CASE WHEN `PL_Status` LIKE 'Open' THEN 1 ELSE 0 END) AS 'PL Open',
	SUM(CASE WHEN `PL_Status` LIKE 'Closed' THEN 1 ELSE 0 END) AS 'PL Closed',
	SUM(CASE WHEN `PL_Number` LIKE '%' THEN 1 ELSE 0 END) AS 'Total of PL',
	ROUND(SUM(CASE WHEN `PL_Status` Like 'Closed' Then 1 ELSE 0 END) / COUNT(CASE WHEN `PL_Number` Like '%' Then 1 ELSE 0 END) * 100, 2) AS '% Closed'

FROM `table`

Group By table.Category_Code 
Regards,

I
admin
Site Admin
Posts: 2782
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 2 times

Re: using views in form wizard

Unread post by admin »

l,

I dont know why it wont work.

maybe change table.ID to ID

BTW I have used a view in the past like this in nuBuilder.

Code: Select all

select `par`.`nuhelp_id` AS `nuhelp_id`,`par`.`hel_order` AS `the_order`,`par`.`hel_title` AS `the_title`,`chi`.`hel_title` AS `the_parent`,`chi`.`hel_order` AS `the_parent_order` from (`nuhelp`.`nuhelp` `par` left join `nuhelp`.`nuhelp` `chi` on((`chi`.`nuhelp_id` = `par`.`hel_nuhelp_id`))) order by `chi`.`hel_order`
Steven
jlcsusara
Posts: 23
Joined: Wed Apr 07, 2010 10:32 am

Re: using views in form wizard

Unread post by jlcsusara »

ironoverload wrote:Hi There this is my first post,

I'm receiving the following error "Form wizard can't detect primary key on selected table".
My first question is, does nubuilderpro v3 work with MySQL Views or just tables?
If it does work with views what am I doing wrong?
Yes, Form Wizard, with my recent return to nuBuilderPro, works on tables but i haven't tried it for views.

I got that error too. The solution was to make sure that the table selected has a Primary Key already set. I sometimes forget to do this. :)

Good luck!
Post Reply