Illegal Reference to: FieldSetText
Written by WishBoNe on June 15, 2007 – 1:47 pmAfter working for 3 days, the code decided to fail today. I don’t even want to know why. I just want it to work. It worked for the other database using the same code. It’s valid. It’s available in the library. So, why doesn’t it work? I need to give a quick demo to my superior. However, it seems to be scared and I don’t why. It just throws me the error “Illegal reference to: FIELDSETTEXT”. *takes a deep breath*
Where did it go wrong? I don’t know. The prompts that I put in never came up. The LotusScript Debugger never came up with anything useful either. I’m just tearing my hair out. No, wait, I can’t tear any hair because I don’t want to be bald.
So, what is wrong with the code? First start with the form itself. In the PostOpen I put:
Sub Postopen(Source As Notesuidocument)
If Source.EditMode Then
Call Source.FieldSetText(“Form”, “frmMtnCatFNo”)
End If
End Sub
In the QueryClose. I put:
Sub Queryclose(Source As Notesuidocument, Continue As Variant)
If Source.FieldGetText(“NoClose”) = “1″ And Source.EditMode = True Then
Msgbox “Please use the ‘Close’ button provided.”
Continue = False
End If
End Sub
Both worked, no errors. Next, I put a “Close” button. That will check if there are any changes made in the form and prompt the user. That’s where I use FieldSetText to change the status of the form:
Call uidoc.FieldSetText(“NoClose”, “0″)
So, what’s wrong with the code? Perhaps I need a break.
Posted in Career, Domino, IBM, Life, Lotus Notes, LotusScript, Programming, Software, Technology, Work |

















June 15th, 2007 at 7:01 pm
Do both files Form & NoClose exist on the form. I mean, did you create both fields view designer?
June 15th, 2007 at 7:19 pm
Form and NoClose are computed text fields that are shared. They are placed in a subform. I’ve used this method in another database and it works. Not sure why this time it doesn’t work.
June 15th, 2007 at 7:30 pm
[...] Wishlist « Illegal Reference to: FieldSetText [...]
August 9th, 2007 at 3:47 am
Although this isn’t a direct answer to your question, you could use JavaScript in the client to set fields/check if the are available in UI.
Button - Client - JavaScript:
=====================
var f = document.forms[0];
//check to see if NoClose is available
if( f.NoClose ){
f.NoClose.value = “0″;
}
else{
alert(’Could not find “NoClose” field in the form’);
}
=================================
August 11th, 2007 at 8:23 am
@Tommy
It was caught in the spam. Sorry about that. Thanks for the alternative