Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > SQL usage in BizForm drop-down lists View modes: 
User avatar
Member
Member
jonas-asenmarketing - 6/2/2011 4:18:47 PM
   
SQL usage in BizForm drop-down lists
Hello,
I am pulling data into a bizform dropdown using the query below:

select top 1 null, '-- Choose Plan --' from custom_HomeDesign
union
select
custom_HomeDesign.HomeDesignName, custom_HomeDesign.HomeDesignName FROM custom_HomeDesign

I have multiple websites utilizing this same document type. Is there a way I can specify the website it pulls the data from? Like where sitename=???

Thanks!

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 6/2/2011 10:36:37 PM
   
RE:SQL usage in BizForm drop-down lists
Hello,

Regrettably, you won't be able to do that. If this is a custom table and you haven't created a custom field e.g. CustomSiteId where you would save the ID of the site, then you are not able to determine, which entry belongs to which table. Custom tables are global objects so no information about the site is saved unless insert the data by yourself if it's a bizform or custom table. You can still modify the table and add the mentioned fields afterwards, but you are not able to determine, for the entries which are already there, from which site they were created. I would suggest you to take a look into the mentioned database table what data is available.

Best regards,
Boris Pocatko

User avatar
Member
Member
jonas-asenmarketing - 6/3/2011 9:24:21 AM
   
RE:SQL usage in BizForm drop-down lists
Thanks Boris,

I added a field to the document called HomeDesignSiteID. Can you show me the syntax to filter the documents using this field?

Thanks,
Jonas

User avatar
Member
Member
lancetek - 6/3/2011 11:04:38 AM
   
RE:SQL usage in BizForm drop-down lists
in the sql:
where HomeDesignSiteId = 3

Replace '3' with whatever site Id you want to filter for.

But if you're putting this restriction on a control that has a 'content filter' section, just put
HomeDesignSiteId = 3

in the 'WHERE condition' field.

Cheers,
Lance

User avatar
Member
Member
jonas-asenmarketing - 6/3/2011 1:01:48 PM
   
RE:SQL usage in BizForm drop-down lists
Hi Lance,

Here is what I have and it is not throwing an error but is also doesn't filter the docs:

select top 1 null, '-- Choose Plan --' from custom_HomeDesign WHERE HomeDesignSiteID = 1
union
select
custom_HomeDesign.HomeDesignName, custom_HomeDesign.HomeDesignName FROM custom_HomeDesign

I am a novice to sql queries so any help is appreciated!!

Thanks,
Jonas

User avatar
Member
Member
jonas-asenmarketing - 6/3/2011 1:04:36 PM
   
RE:SQL usage in BizForm drop-down lists
Ahh, nevermind - had the where statement in the wrong place!

THANKS AGAIN!