I have a button on a form that adds a note to a memo field on the form using the following code:
We started receiving an error when attempting to add a note to one specific error and could not figure out why. It was generating an error stating incorrect data type pointing to the line above - If alltrim(tbl.Notes) = ""
When viewing the memo field on the form, it appears fine, however if I view the table from the control panel, find that record and inspect the notes field, I see an odd character. I've attached a picture of this character.
I have no idea what this character is, how it got there, how to prevent it from showing up again, or how to make my code above ignore it.
If I delete the character while viewing the table from the control panel, we quit receiving the error when running script.
Any suggestions?
char.jpg
Code:
DIM SHARED NotesVar as C DIM SHARED DialBox as C ok_button_label = "&OK" cancel_button_label = "&Cancel" DialBox = ui_dlg_box("Enter Notes",<<%dlg% {region} Notes:| [%mw%.40,5NotesVar]; {endregion}; {line=1,0}; {region} <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL> {endregion}; %dlg%) If Var->NotesVar="" end ELSE Dim P as P DIM SHARED Test AS C vMode = parentform.mode_get() IF vMode = "CHANGE" .or. vMode = "ENTER" parentform.commit() END IF tbl = table.current() p.text=tbl.Notes tbl.change_begin() If alltrim(tbl.Notes) = "" tbl.Notes = tbl.Notes + date_format(date(),"MM-dd-yy") +" (" + word(api_getusername(),1) +"): " + var->NotesVar ELSE tbl.Notes = tbl.Notes + crlf() +date_format(date(),"MM-dd-yy") +" (" + word(api_getusername(),1) +"): " + var->NotesVar END IF tbl.change_end(.t.) Notes.refresh() topparent.commit() tc = table.current() tc.change_begin() tc.change_dtf = now() tc.change_by = api_getusername() tc.change_end(.t.) change_dtf.refresh() NotesVar = "" END IF
When viewing the memo field on the form, it appears fine, however if I view the table from the control panel, find that record and inspect the notes field, I see an odd character. I've attached a picture of this character.
I have no idea what this character is, how it got there, how to prevent it from showing up again, or how to make my code above ignore it.
If I delete the character while viewing the table from the control panel, we quit receiving the error when running script.
Any suggestions?
char.jpg
Comment