lotus notes - Error type mismatch with replaceitemvalue -
I have a problem with subtotin, I want to convert one value of one field to another in the same database, my Code run is fine if I put it in a butt, but I want to do a sub because I want to use it more often. The
So, I think this code:
Public Sub actualizarContador (contadorId string, integer ContadorTmp, contadorActual integer as, contadorNuevo as as integer) as in as dim ws new NotesUIWorkspace dim db NotesDatabase dim uidoc NotesUIDocument dim odoc NotesDocument dim Estado string set uidoc = ws.Currentdocument Estado = uidoc. Fieldgettext ("Estado") If Estado = "Borrador" set again odoc = db.GetDocumentByUNID (uidoc.FieldGetText (contadorId) contadorTmp = Cint (contadorActual) + 1 call odoc As. Then in a buttom I use this line:
call actualizarContador (doc.TempoIDContador (0 ), doc.TempoContadorTmp (0), doc.TempoContadorActual (0), "ContadorUnicoTempo") I should name an error, because the object of a field with ContadorUnictoTempo I think, but this field has numerical format.
Any suggestions?
Thanks all.
Edit: I fixed the problem, thanks to two problems, the first area was 'ContadorTmp', it was not worth it, now in 0 is defaulted. This type was the first error of mismatch.
The second error class was uidoc, this id field was not found. I just finished the code and it runs fine.
public sub actualizarContador (contadorId string, as contadorTmp integer, as contadorActual integer dim ws as as contadorNuevo string) New NotesUIWorkspace dim Ns New NotesSession dim db NotesDatabase dim uidoc NotesUIDocument dim odoc NotesDocument dim Estado string idle id as set as as as string set db = ns.CurrentDatabase uidoc = Ws.CurrentDocument Estado = uidoc.Fieldgettext ("Estado") ID = con tadorId then Estado = "Borrador" odoc resets = db.GetDocumentByUNID (ID) contadorTmp = CInt (contadorActual) + 1 calls odoc.ReplaceItemValue (contadorNuevo, contadorTmp) calls odoc.Save (True, True) End If End Sub
define contadorNevo parameter as string And then it will work. public sub-actualizarContador (contadorId string, integer like contadorTmp, contadorActual you should know that's what got odoc
set odoc = db .GetDocumentByUNID (uidoc.FieldGetText (contadorId)) If Odok nothing error 1000 " Could not find the document "...
Comments
Post a Comment