September 14, 200718 yr 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.
September 15, 200718 yr 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.
September 17, 200718 yr 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.
September 22, 200718 yr 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.
September 22, 200718 yr 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
September 25, 200718 yr 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 September 25, 200718 yr by Guest
September 25, 200718 yr 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?
September 25, 200718 yr 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