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.

Command is invalid:

Featured Replies

Hi there,

I have just created a simple search, list and form.

The search form has a few input fields and a preset hidden field.

the format file is List.html

the error file is Search.html which is the search form as well.

Everything works fine. I can do a find and goto the list and form.

The problem occurs when the database failed to return any records

and it redirects to the search form again (I display a red color text showing there was no records found) . Then I tried to enter some other texts for the search. It gave me the following error:

[color:"red"]

Command is invalid:

Unable to to process your because the server encountered and invalid command. Please correct your request and try again.

Please shed some lights on my issue.

Thanks a lot,

Hameed

Hong Kong

I guess we would need to see some of your 'Search.html' to see what is happening.

All the best.

Garry

  • Author

Hi,

I have attached my search.html here please have look.

Hameed

Search.txt

I wonder if this line:

<input type="hidden" name="-max"       value="[FMP-Field:g_Max_Show_Record_List]">

Causes a problem when submitted after an error because it may not have been replaced!

Does the Valuelist have entries when the page has been returned after an error?

All the best.

Garry

  • Author

Yes it can show the value list perfectly after it returned a no records error.

Yes your clue is right. After the db returned no records this tags

<input type="hidden" name="-max" value="[FMP-Field:g_Max_Show_Record_List]">

becomes

<input type="hidden" name="-max" value=""> (obviously there is an invalid command)

[FMP-Field:g_Max_Show_Record_List] is a global field. I assumed that the global field shows up even the db returned no records.

If I change my above tag to <input type="hidden" name="-max" value="5">

something like this everything works fine.

Any idea why the global field is not showing up??

Many thanks

Hameed

As a workaround, you may want to assign the -max value to a Token. Then test if an error condition exists with [FMP-If] tags.

All the best.

Garry

Hameed writes,

>Yes it can show the value list perfectly after it returned a no records error.

>Yes your clue is right. After the db returned no records this tags

...

>Any idea why the global field is not showing up??

I've recently experimented with the fmp-includefield tag, which prefers a global. Seeing your question I went to this test folder and ran a -find which returned error 401 on the error.htm. Also on the error.htm was the tag to display the global field. Needless to say, that global was not displayed. When I looked at the db file, I could clearly see the global field. However, because the status bar revealed "Found: 0", it was obvious that there was no record from which the cdml tag could access the data.

  • Author

Thanks Keith & Garry for your advice.

I would hard code the max no of records within the HTML to solve this issue. That's fine for me now.

Thank you all again for your assistance.

Hameed

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.