Field Value in Dialog Box

I have a dialog box that has 3 fields for an “Amount”. The first is an editable field that is hidden/not hidden based on another field’s value. The 2nd is a computed field hidden/not hidden based on another field’s value, and the 3rd holds either one of the first 2 fields and it’s hidden all the time. The fields hide/unhide correctly and everything works great until I open the dialog box again. The dialog box comes up via a button. When I call it to edit what may be in the table the Amount field is blank. It doesn’t hold the value I put in it the first time. I hope this makes sense. What could cause this??

Subject: Field Value in Dialog Box

Yes that makes sense. Are you using LS or Formula in your button? Plz post code. You need to parse the curent value to the dialog box form.

Subject: RE: Field Value in Dialog Box

The button formula is:@DialogBox( “dlg3GenericNotes” ; [AutoHorzFit] : [AutoVertFit] : [NoNewFields] : [SizeToTable] ; “New Expense”);

@Command([ViewRefreshFields])

Thanks

Subject: RE: Field Value in Dialog Box

U need to parse the value to the pop-upm screen…not sure in @ lang. try @SetField. in LS

dim session as new notesSession

dim db as notesDatabase

dim ws as new notesUiWorkspace

dim dlgDoc as notesDocument

dim uiDoc as notesUiDocument 'Current document

set uiDoc = ws.currentDocument

set db = session.currentDatabase

set dlgDoc = db.createDocument

dlgDoc. = yourvalue

Call ws.DialogBox(“dlg3GenericNotes”, True, True, False, False, False,False, “Dialog Box”, dlgDoc).

This will need some fine tuning ofcourse. good luck

Subject: RE: Field Value in Dialog Box

This doesn’t make since to me since the value in the “Amount” field will constantly change. I need to actually fill in the amount when the dialog box is called up because the “Expense Amount” will be different for each document. That’s where my problem is…when I enter the amount in the dialog box, it doesn’t retain the value.

Subject: Field Value in Dialog Box

The first line in the help document for @dialogbox explains all confusion, IMO:

“Brings up a dialog box that displays the current document”

(Although the R5 version was slightly better: "Brings up a dialog box that displays the current document using a form you specify. ")

From your post, it sounds like you’re expecting the dialog box to persistently remember the values it displayed the last time it opened. It won’t, because it displays the values of the fields in the current document instead.

To achieve what you want, you simply need to take the [NoNewFields] option out of your code. This will add the two conditionally-hidden fields, with their current values, to the document, and they will therefore be populated again in the dialog box next time it’s opened.

Subject: RE: Field Value in Dialog Box

Thank you very much Bruce…it now works