Page 1 of 1

using views in form wizard

Posted: Mon Jun 09, 2014 4:43 pm
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

Re: using views in form wizard

Posted: Thu Jun 12, 2014 5:35 am
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

Re: using views in form wizard

Posted: Thu Jun 19, 2014 7:59 am
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!