Radio button returns wrong value

Hi.Here in some form I have a radio button, by which user can choose his online status. In Domino Designer it has these parametres:

Type - RadioButton

Name - fldConnected

Choices - @GetProfileField(“StringTable”; “CONNECTED”; @UserName):

            @GetProfileField ("StringTable"; "UNAVAILABLE"; @UserName)

Default Value - @GetProfileField(“StringTable”; “CONNECTED”; @UserName) (This part doesn’t work I think)

The problem is that these buttons uninitialized at the first load and they return empty strings, but I get right behaviour after second load (if I tried to use it at the first time). The code for these is here:

Function NewStatus_Click(Source As Button)

Dim ws As New NotesUIWorkspace

Dim bOk As Boolean

Call g_thisForm.FieldSetText("fldConnected", GetString("CONNECTED")) 'This line doesn't work at the first load

Call g_thisForm.FieldSetText("fldNote", "")

bOk = ws.DialogBox("NewStatus", True, True, , , , , GetString("NEWSTATUS"), , True, , True)

If bOk = True Then

    'grab values from fldConnected and fldNote

    Dim Type As Long

    Dim Note As String

     If "" <> PresenceNote Then

        If GetString("UNAVAILABLE") = g_thisForm.FieldGetText("fldConnected") Then

'right in here FieldGetText(“fldConnected”) returns “” !!!

            PresenceType = UNAVAILABLE

        Else

            PresenceType = CONNECTED

        End If

Have you ever seen smth like? If yes, help me please, I’m stuck on this.

Thanks

Subject: Radio button returns wrong value

I suppose the profile documents are maybe not avialable at the first time? You have profile docs for each user (key is @Username). How and when are they populated? Maybe you have to make sure they exist, before loading your form.

In your Lotusscript code, there is a function GetString. I suppose this function also pulls values from profile doc for current user, so it’s the same issue.

Subject: RE: Radio button returns wrong value

The problem is I’m a begginer both in Lotus Software and in VB.

Is there a way to set that radio buttons in another way but @GetProfileField??

Subject: RE: Radio button returns wrong value

Depending on your application requirements, the first thing is if you think every user by default will have same choices so that they will select one, then you can remove the whole script mess and type in the 2 or 3 choices there. In Default, type in the value which you think should be default.

If you think the simplest way is not the case suitable for you, then have different choices depending on user or other factor, set the profile field in Dbscript 's PostOpen event. Then get those choices from the profile field directly into the radio button field.

Subject: RE: Radio button returns wrong value

Well the reason is that at the first load string tables are loading too, and maybe after my form, so you are right, it needs some redesign or at least hard coded strings…

I want to thank you all for your replies, especially Andre for his wrathful one ))) so, thanks… I’ll be back ))))

Subject: Radio button returns wrong value

You say you are a beginner. This is not a beginner problem. Whoever created this application made a mess of it. It doesn’t need a fix, it needs a redesign. You need a Notes expert to help you figure out what the intention was and find a sensible way to do it. Not by questions in this forum – by sitting down with the application and the documentation (if any) and the people who know how it’s supposed to work. If there is nobody like that in your organization, you might look at finding a consultant.

The application is getting lists of choices from a personal profile document. This is odd. Does every user have a different set of choices? What process is in place for putting the user’s initial list of choices into the personal profile document? When user A opens a document created by user B, should they see user B’s list of possible choices, or their own? Nothing here makes any sense.

I suggest you (or someone else) rethink the requirements and store the keyword data in a sensible place, such as a shared profile document, so that it is available for all users.