Newbies skysceltis Posted May 11, 2010 Newbies Posted May 11, 2010 I am trying to set up a Find using a script. I cant' get the selected search field into the find. Some pseudo code... Set Variable [ $SearchFieldSelect , Value:"Field_Name" ] #--- Field_Name Set by Calc (not shown) Enter Find Mode[] Set Field By Name [ Get ( LayoutTableName ) & $SearchFieldSelect ] #--- This does not work New Record/Request[] #--- Other Find stuff... Perform Find[] I tried adding the colons for the Table name with: Get ( LayoutTableName ) & "::" & $SearchFieldSelect In the Set Field By Name step, but that didn't work either. What am I missing? Thanks, SC
bruceR Posted May 11, 2010 Posted May 11, 2010 You're not missing anything. The script works correctly as written, given proper values. tested ( "Value" is a field name in my table) Set Variable [ $fn; Value:"Value" ] Set Variable [ $tbl; Value:Get(LayoutTableName ) ] Enter Find Mode [ ] Set Field By Name [ $tbl & "::" & $fn; ">5000" ] Perform Find [ ] Result: proper found set for find request.
Newbies skysceltis Posted May 12, 2010 Author Newbies Posted May 12, 2010 Bruce, Thanks for your analysis. It helped me get unstuck. Below is what I got to work. ##--- More of IF and Find above... Else If [ System::gAccountSearchFieldSelect <> "ALL" ] #---- Set Up 1-Field Find Set Variable [ $SearchFieldSelect; Value:Case( System::gAccountSearchFieldSelect="Account Name";"Account"; System::gAccountSearchFieldSelect="Category";"Account_Category"; System::gAccountSearchFieldSelect="Type";"Account_Type"; System::gAccountSearchFieldSelect="ID";"ID_Account"; System::gAccountSearchFieldSelect="Shipping City";"Shipping_City"; System::gAccountSearchFieldSelect="Shipping State";"Shipping_State_Province"; System::gAccountSearchFieldSelect="Billing City";"Billing_City"; System::gAccountSearchFieldSelect="Billing State";"Billing_State_Province"; "") ] Set Variable [ $CurrentLayoutName; Value:Get ( LayoutTableName ) ] Enter Find Mode [ ] Set Field By Name [$CurrentLayoutName & "::" & $SearchFieldSelect; System::gAccountSearchTarget ] New Record/Request End If ###--- More of Find below... I used the Case statement for readability issues. SC
Recommended Posts
This topic is 5308 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now