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.

Searching using values obtained from Checkboxes

Featured Replies

I have a series of checkboxes that list many product lines. The user is being asked with the check boxes to check the product lines they wish to be a part of the Sales Quote they are creating.

Lets say for example I have these product lines.

Widgets

Gadgets

ThingaMaBobs

The user checks off Widgets and Gadgets.

I then want to switch to the view that the sales quote template is defined in and run a search.

However I want it to search based on products that are Widgets OR Gadgets.

I have the field defined as a variable $productsToQuote

The value obtained from the check box lists all fields checked, however I cannot figure how to search this way. Is there away to search a single field using multiple search parameters?

Right now I am doing:

Enter Find Mode[]

Set Field [Products::LineCode, $productsToQuote]

Perform Find []

This works just fine if there is only one product line checked off. However if there is more than one it filled the search field with all the product lines stacked one on top of another, and obviously returns no results...

Any help would be much appreciated.

You can use the New Record command whilst in Find mode to make an additional find request. Then you can use another set field...

The tow find requests are added together when you perform the find.

  • Author

Okay sounds great, checkbox fields contain the values of every variable checked so if the user checked the first three values the output of the field would look like this:

Value1

Value2

Value3

Is there an easy way to strip the first value, perform a search, strip the second perform a search, etc etc.

Have a look at "constrain found set".

The RECORDS menu changes to REQUESTS in find mode, then you get the options to CONSTRAIN or EXTEND.

If it's an "or" Find, as you first posted, then you would need a New Request for each value of the checkbox field (gCBX). I'm assuming the checkbox field for the choices is a global field. Psuedo code:

Enter Find Mode []

Set Field [ CBX; GetValue ( gCBX; 1) ]

If [ ValueCount ( gCBX ) > 1 ]

    Set Variable [ $count; ValueCount ( gCBX ) ]

    Set Variable [ $counter; 1 ]

    Loop

        Exit Loop If [ $counter > $count ]

        New Record/Request

        Set Field [ CBX; GetValue ( gCBX; $counter ) ]

        Set Variable [ $counter; $counter + 1 ]

    End Loop

End If

Perform Find

  • Author

Fenton,

Thanks for the help so far, I am still a little hung up. Do I need to pull the values in the checkboxes and store them as comma separated values first? I am still only retrieving the first checked value in the list...

Edited by Guest

  • Author

I cannot make the check box field a global field since each record may require different products to be quoted.

I have tried to define the variable before switching views and then using the variable instead of the field, but it does not seam to capture all of the checked values, just the first value checked. Here is what I am doing.

Sales Orders::collectionsToQuote Is the checkbox set residing in the Sales Order. The collections to display in the quote would be checked here.

Inventory::collectionCode Is the pull down menu field residing in the inventory file. Each piece of inventory can only be a part of one collection.

Set Variable [ $collections; Value:Sales Orders::collectionsToQuote ]

Set Variable [ $$logo; Value:Sales Orders::customerLogo ]

Allow User Abort [ Off ]

Go to Layout [ “SalesModelCreation” (Inventory) ]

Enter Find Mode [ ]

GetValue (Sales Orders::collectionsToQuote; 1) ]

Set Field [ Inventory::collectionCode; GetValue ($collections; 1) ]

If [ ($collections) > 1 ]

Set Variable [ $count; Value:ValueCount ($collections) ]

Set Variable [ $counter; Value:1 ]

Loop

Exit Loop If [ $counter > $count ]

New Record/Request

Set Field [ Inventory::collectionCode[GetValue ($collections; $counter)] ]

Set Variable [ $counter; Value:$counter + 1 ]

End Loop

End If

Perform Find [ ]

Does this make sense or am I way off base?

I don't really know if it makes sense, as I don't really know your data structure. But I can see a few minor problems in your script, so try this:

Set Variable [ $collections; Value:Sales Orders::collectionsToQuote ]

Go to Layout [ “SalesModelCreation” (Inventory) ]

Enter Find Mode [ ]

Set Variable [ $count; Value:ValueCount ($collections) ]

Set Field [ Inventory::collectionCode ; GetValue ($collections; 1) ]

If [ $count > 1 ]

Set Variable [ $counter; Value:1 ]

Loop

Exit Loop If [ $counter > $count ]

New Record/Request

Set Field [ Inventory::collectionCode [GetValue ($collections; $counter)] ]

Set Variable [ $counter; Value:$counter + 1 ]

End Loop

End If

Perform Find [ ]

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.