Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Search in Custom table View modes: 
User avatar
Member
Member
gianglt3-fsoft.com - 2/17/2014 3:42:59 AM
   
Search in Custom table
Hi all!
I have a question:
Ex: I have a table (name: Student - field: ItemID, StudentName , Class)
I want add a feature search by StudentName in CMSSitemanager pages

How to add a feature search to custom table?


User avatar
Kentico Support
Kentico Support
kentico_romank - 2/17/2014 7:19:08 AM
   
RE:Search in Custom table
Hi,

To be able to search in custom tables you need to create a new index of type "custom tables", please see the following link for more information http://devnet.kentico.com/docs/devguide/index.html?smart_search_defining_ct_index_content.htm.

Is that what you want to achieve? If not could you please provide me detailed information about your scenario.

Best Regards,
Roman Konicek

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 2/17/2014 7:50:08 AM
   
RE:Search in Custom table
Go to the Alternative Forms for that custom table and add a new form called "filter" with "filter" as the code name and save it. Navigate back to the Data page for that custom table and if you have more than 25 records, your newly created filter form will show.

Most likely you will have to change some of the fields that are showing but you can also do this in your alternative form's fields.

User avatar
Member
Member
gianglt3-fsoft.com - 2/17/2014 10:47:18 PM
   
RE:Search in Custom table
Thank you for your reply!
I worked follow your step and successful, but i have a question:
Now i want add feature search in all table form Custom_Table list that how to do?
ex: i have three table
Student: ItemId,StudentName,SessionId
Class: ItemId,ClassName,SessionId
School:ItemId SchoolName , SessionId
I want find all item in all table have SessionId = 12 from Custom_Table list.

Thank and best regard!
GiangLT3

User avatar
Member
Member
gianglt3-fsoft.com - 2/18/2014 8:26:20 PM
   
RE:Search in Custom table
Sorry for my question above,i think feature search on Custom_table list is not necessary and very difficult to implement!
Thank.

User avatar
Member
Member
gianglt3-fsoft.com - 2/19/2014 9:48:56 PM
   
RE:Search in Custom table
FroggEye wrote: Go to the Alternative Forms for that custom table and add a new form called "filter" with "filter" as the code name and save it. Navigate back to the Data page for that custom table and if you have more than 25 records, your newly created filter form will show.

Most likely you will have to change some of the fields that are showing but you can also do this in your alternative form's fields.

when i have two "Alternative Forms" is "filter1" "filter2" for a custom table,why only "filter1" display.
where can i assigned "filter2" for this custom table?
What happen when i assign two Alternative Forms for a custom table?

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 2/20/2014 6:49:55 AM
   
RE:Search in Custom table
gianglt3-fsoft.com wrote: when i have two "Alternative Forms" is "filter1" "filter2" for a custom table,why only "filter1" display.
where can i assigned "filter2" for this custom table?
What happen when i assign two Alternative Forms for a custom table?
Technically you can't have to objects named with the same name, which is why only one shows.

If you want to display this on a different page outside of the CMSDesk or Site Manager, then create a custom query from the main table and use joins or unions in it to get your data. Then place a custom query repeater on your page and display your data. You may need to create a custom webpart to get the filter and repeater to play nice together.

User avatar
Member
Member
gianglt3-fsoft.com - 2/20/2014 8:47:57 PM
   
RE:Search in Custom table
FroggEye wrote:
gianglt3-fsoft.com wrote: when i have two "Alternative Forms" is "filter1" "filter2" for a custom table,why only "filter1" display.
where can i assigned "filter2" for this custom table?
What happen when i assign two Alternative Forms for a custom table?
Technically you can't have to objects named with the same name, which is why only one shows.

If you want to display this on a different page outside of the CMSDesk or Site Manager, then create a custom query from the main table and use joins or unions in it to get your data. Then place a custom query repeater on your page and display your data. You may need to create a custom webpart to get the filter and repeater to play nice together.

Thank you for your reply!
But i just want to ask you if i create two (or more) Alternative Forms for a custom table, what will i do with second form? Because Customs table only get first form to filter.
This is my question for discovery
Thank you very much!
GiangLT3

User avatar
Kentico Support
Kentico Support
kentico_romank - 3/3/2014 3:32:36 AM
   
RE:Search in Custom table
Hi,

As FroggEye mentioned you cannot have two alternative forms with the same name, and only alternative form with one of the reserved code names will be automatically used when performing the corresponding actions in the administration interface, in this case filter codename.

You can use other alternative forms of your custom table for example to replace a custom table's default form for adding or editing custom table items in the system's administration interface.

I would recommend you to check the following chapter in our Developer´s guide - http://devnet.kentico.com/docs/7_0/devguide/index.html?creating_filter_forms.htm

Best Regards,
Roman Konicek