Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Correct way to limit Records in Privilege Set?

Featured Replies

I have a PHP web published site using a FMStudioPro built site and I am getting errors whenever I try to make its user have custom privileges limited to a field (called "On Web") that is a boolean.  I have tried

 

On Web = 1

and

On Web = "1"

and

On Web > 0

 

All I get is that every page on the site jumps to the error page - 404 No records match request

 

I am trying to limit the web results to just records that have the checkbox "On Web" checked.  If I remove Custom Privileges, the site works fine, but of course returns all the database's records.

 

thank you!

 

-- Don

I would control this by making sure the criteria is included in every search from the php, rather than via privileges...

  • Author

Hello - thank you for the reply -- only thing is I don't seem to be able to get the criteria to work -- I try to limit the results to just the field "On Web" to have a boolean value of 1 with this at the head of the search page - but it always returns everything...:

 

 

<?php

$found_records_find = $macusa->newFindCommand('Web Browse View');

$found_records_findCriterions = array('On Web'=>'=='.@($_REQUEST['On_Web']),);

foreach($found_records_findCriterions as $key=>$value) {

   $found_records_find->AddFindCriterion($key,$value);

}

 

fmsSetPage($found_records_find,'found_records',20); 

 

$found_records_result = $found_records_find->execute(); 

 

if(FileMaker::isError($found_records_result)) fmsTrapError($found_records_result,"error.php"); 

 

fmsSetLastPage($found_records_result,'found_records',20); 

 

$found_records_row = current($found_records_result->getRecords());

 

// FMStudio Pro - do not remove comment, needed for DreamWeaver support ?>

Is the value of 'On_Web' passed in a form or URL? If not, it will be null, so making the request for find everything...

 

Testing version:

<?php
$found_records_find = $macusa->newFindCommand('Web Browse View');
$onWeb = 1;
$found_records_findCriterions = array('On Web'=>'=='.$onWeb,);
foreach($found_records_findCriterions as $key=>$value) {
   $found_records_find->AddFindCriterion($key,$value);
}
fmsSetPage($found_records_find,'found_records',20); 
$found_records_result = $found_records_find->execute(); 
if(FileMaker::isError($found_records_result)) fmsTrapError($found_records_result,"error.php"); 
fmsSetLastPage($found_records_result,'found_records',20); 
$found_records_row = current($found_records_result->getRecords());
// FMStudio Pro - do not remove comment, needed for DreamWeaver support ?>
  • 3 weeks later...
  • Author

This is fantastic -- thank you -- saved the day.  What I realized I was doing wrong, is I was trying to limit it to "onWeb" from the search page, and what I needed to do was add a bit to my results page.  I added $onWeb = 1; ro my results page and then changed the array to match your ('On Web'=>'=='.$onWeb,) -- all works perfectly now.

 

My search is passed through a URL in the pages that FMstudioPro set up for me,  btw.

 

Thank you again

 

-- Don

It is worthwhile trying to work out how these things really work - FMStudio is a useful tool but not flexible enough or advanced enough for every situation. And I'm not sure it's really a live product anymore - been a long time since I've seen their dev team post anything...

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.