To set the value of a radio button you would use "Set Field" . I assume your field related to Active / Inactive Button is gShowActive. If not, just change the field in the code listed to the field related to your radio buttons. If you wanted to set the button to inactive you would sub "Inactive" for "Active".
Set Field[Members::gShowActive;"Active"] .
Right. The radio button for Member/Candidate is Members::GMem_Can and the radio button for Active/Inactive is Members::GShowActive.
In my code I AM using SET FIELD gMem_Can to set "Member" and SET FIELD gShowActive to set "Active". Do you see something different?
I think I am confused as to what you are saying I should try vs what I have coded.
S Chamblee suggested you set the field value to "Members". You are including a return on either end of the text.
The problem is that the button "Member" receives the text but does not act the same as if I had mouse clicked "Member".
I think it would be helpful if you posted the whole script. There are several steps in the part we can see that are redundant (although they shouldn't do any harm). For example the Refresh Window and the two last Go To Field steps. You are saying that if, after a script that returns an empty found set, you click on the field 'Member' and it shows you a found set, but if the script finds no records and sets the field to 'Member' it returns nothing? Even after a Commit Records?
When you click on a Radio button it set a value into a field related to that radio button. If you set the value manually by set field the Radio button will update to the same value (display). If you are running a Script Trigger on the radio button then I would copy that code and add it to the other script you are running to automate the click.
Thanks for the reply. Here is the latest.
First, FM was storing my radio button selections as " Active" (Additional Space) and " Member" (Additional space). Everything looked ok in Inspector so I added some trim() just to take care of it.
To simplify things, I added a "GO" button which runs the script. This is the error producing sequence:
Member / Active GO -> 1 of 55 correct.
Leaving Member chedkced but clicking Inactive GO -> 1 of 2 correct.
Clicking Candidate (Not clicking Inactive) GO -> 1 of 1 correct
Leaving Candidate selected but clicking Active GO -> INCORRECT 1 of 7
Leaving Active checked but clicking Candidate GO -> 1 of 6 correct.
Leaving Candidate selected but clicking Inactive GO -> 1 of 7 INCORRECT
This seems really tough to grind by just looking at my screen captures. Would you like me to send you a DL link for the whole file?
I think you are trying to achieve that if a find returns no records, a further find is performed. I'm getting rather confused; there seem to be a lot of steps to the script that I can't appreciate the value of. Go to Field, then immediately another Go to Field step. One will simply over-write the other's action. The 'Trim calculation at the start suggests to me that the data in the field itself should be purged - perhaps once, with the same Trim function. The Relookup step - what is the value that the script will exploit that is the result of a Lookup? You refer to sub-scripts that we can't de-bug. The Go To Related Records I can't follow, either. Sorry; I'm sure it's my limited intelligence.
Can you confirm that the script 'Show All Members and Candidates' works the way you want?
I donlt really understand this:
"Member / Active GO -> 1 of 55 correct." Do you mean that you have 55 records in total, and it correctly returns that 1 is an Active Member?
"Leaving Member checked but clicking Inactive GO -> 1 of 2 correct." Why is it one of two? Is it not 1 of 55? But if 1 of the 55 members is Active, does that not mean the other 54 are Inactive? Or is there a 3rd category of Active Status?
I can appreciate your confusison. I too get confused with this code!
Seriously, here is a youtube video that might explain somewhat how the code works:
Attached is a .jpg of the script that only 'sometimes' works...
Thanks for your thoughts and help.
I've narrowed the current problem down to the fact that my script: RadioBtnObjectMod (2) If statement DOES NOT RECOGNIZE the variables evident in the debug variables window. ??// How can that be?
I should point out that the script SKIPS the IF for Active Candidate (even though Debug Watch clearly shows the variables present.
However, IF I MANUALLY CLICK ON CANDIDATE AND ACTIVE THEN RUN THE SCRIPT, EVERYTHING WORKS AS EXPECTED.
So the question is, "What is wrong with my code that I can set a radio button but it won't get 'pushed' in code? Surely this isn't a new problem.
You keep adding return characters to either end of the variable, then you check in the If Statement for the exact text, without any return characters, so the If Statemment will evaluate to be false, and then look as if it is 'ignoring' it.
Great idea. But, I changed the IF statement to reflect the presence of the return character and it still won't work... ???
Don't use the ¶ here at all. There's no need for it and it complicates your expression needlessly.
That may not solve the whole problem given your last post here, so you may need to check the field data types of your two fields to make sure that they are text and not number. If they are of type number, they'll display data correctly, but your = expressions here will not evaluate as expected.