Jump 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.

Featured Replies

  • Newbies

Hi Guys,

I have only started working with FileMaker for the last 2 months or so, and I didn't like the way that the API is very procedural driven, so I decided to make a class which would help me.

I have got a function which I have made which interacts with the FM PHP API (Official) which I am trying to get sorted.

The idea to the whole class is to save time writing each function over and over again, but basically I have got this function which I am having problems with which is to get the FileMaker Layout Fields and Values of those fields and put them into an array.

Here is my code:


  /**

	 * Selects data from a FileMaker Layout from the given criteria

	 *

	 * @author  RichardC

	 * @since   1.0

	 *

	 * @version 1.2

	 *

	 * @param   string  $layout

	 * @param   array   $arrSearchCriteria

	 *

	 * @return  array

	 */

	public function select( $layout, $arrSearchCriteria ) {

		$arrOut = array( );

		if ( ( !is_array( $arrSearchCriteria ) ) ) {

			return false;

		}

		$findReq = $this->fm->newFindCommand( $layout );

		foreach ( $arrSearchCriteria as $field => $value ) {

			$findReq->addFindCriterion( $field, $value );

		}

		$results = $findReq->execute();

	  

		// Adds all the fields in the layout to the array

		$this->fields[] = $results->getFields();

		  

		if ( $this->isError( $results ) === 0 ) {

			$records = $results->getRecords();

		  

			//Set the last used layout and object

			$this->layout  = $layout;

			$this->lastObj = $records;

	

			//Loops through the records retrieved

			foreach ( $records as $record ) {

			  

				$arrOut[] = $record;

				//Here I want to Get the Layout FieldNames and Values into an array -> example : $arrOut['user'] = 'DarkMantis'			  

			}

		} else {

			$arrOut['errorCode'] = $this->isError( $results );

		}

		return $arrOut;

	}

As you can see there, I have commented in that I want to get the Details into my array.

If you have any ideas on how to do this it will be greatly appreciated.

[Edit]

I do apologise for the messy code, it was more of a PoC.

[/Edit]

Best Regards,

DarkMantis

  • 2 weeks later...

You might want to look at how FX.php does this... the FileMaker XML interface exposes this...

Create an account or sign in to comment

Important Information

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

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.