Adding list of records to “User” section

15 posts by 3 authors in: Forums > CMS Builder
Last Post: September 21, 2011   (RSS)

Is it permissible to add a list of records from another section to the “User” section without corrupting it? [/#000000]

[/#000000]

I would like to setup a listing page that will list records based on a choice from this list![/#000000]
nmsinc

Re: [nmsinc] Adding list of records to “User” section

Hi nmsinc,

Could you be a little more specific about what you're actually trying to do?

Thanks.

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Adding list of records to “User” section

By nmsinc - September 19, 2011 - edited: September 19, 2011

Hi Jerry,[/#000000]

[/#000000]

I have a listing page that I want to sort records based on a preference that I will set up in the USER section if it is permissible to do so. My concern is, I do not want to set this preference up if it will cause problems to the USER section![/#000000]

[/#000000]

Thanks[/#000000]

Ray[/#000000]
nmsinc

Re: [nmsinc] Adding list of records to “User” section

Hi Ray,

That shouldn't be a problem.

Do you mean sort ( which group of records displays first) or filter (Show different records for different groups of users)?

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Adding list of records to “User” section

Filter!
nmsinc

Re: [gkornbluth] Adding list of records to “User” section

Hi Jerry,[/#000000]

[/#000000]

I have created a new field within the User Section and will populate it from values (num) from another multi-record table – see below:[/#000000]



Table(1) = records of “users” that now includes a choice from Table(2) value(num)



Table(2) = records of “company names and addresses”



Table(3) = records that include a choice from Table(2) value(num)



Using a listing page, how would I use the “Membership” plugin to restrict listing of records in Table(3) to those that only match the new field value(num) in Table(1)?[/#000000]



Thanks

Ray
nmsinc

Re: [nmsinc] Adding list of records to “User” section

Not sure, but have a look at this post

http://www.interactivetools.com/forum/gforum.cgi?post=61466#61466

It might give you some ideas.

There have been many posts on searches searches in multiple tables

There's also relatedRecords that are worth searching through.

Good luck,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Adding list of records to “User” section

By nmsinc - September 19, 2011 - edited: September 19, 2011

Hi Jerry,

That thread did not help - anyone else with any ideas?
nmsinc

Re: [nmsinc] Adding list of records to “User” section

By Jason - September 20, 2011

Hi,

So to make sure I understand, your "Table 1" is the user accounts table. It has a field that takes a value from Table 2 (company table). And Table 3 also has a field that takes its value from the company table. You want to then get all the records in table 3 where the table 3 field has the same value as the field in the accounts table. Does that sound right?

If so, once the website membership plugin is installed and the user is logged in we can use the $CURRENT_USER array to find the value of the field in accounts table. Here is an example of what we can do.

Because I don't know the names of all your fields/tables, I'll have to make some assumptions. Let's assume that table 3 is called "listings". Let's also assume that the field that is in both the accounts and listings tables that comes from the company table (table 2) is called "company".

Assuming this, we can get a list of all listings where the company field matches the company field in the accounts table like this:

list($listingsRecords, $listingsMetaData) = getRecords(array(
'tableName' => 'listings',
'allowSearch' => false,
'where' => "company = '".intval($CURRENT_USER['company'])."'",
));


Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/