May 11, 201015 yr Newbies 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
May 11, 201015 yr 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.
May 12, 201015 yr Author Newbies 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
Create an account or sign in to comment