LIST RECORDS ASSIGNED TO CURRENT USER ONLY - Aug 6th, 2010


S2media wanted to create a page where a project manager can log in to see only the projects that they’re assigned to.

He went on to say, ”When a project is created in a section called “Projects”, I have a drop down of project
managers that I can assign it to. The drop down pulls in a field "id" which is a field I added to the Accounts section.
There’s also a field called project_status which can be Quote, Active, Hold or Completed.

Both Jason Sauchuk and Dave Edis from Interactive Tools got involved in this one and they came up with the following:



list($projectsRecords, $projectsMetaData) = getRecords(array(
'tableName' => 'projects',
,
'where' => 'project_status="Active" AND project_manager= "'. $CURRENT_USER['id'] .'"' ,



While testing, you can add these to the code:



'debugSql' => true,
));

<?php showme($projectsRecords); ?>




The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service