Does anyone know how can I send a mail in the moment that someone changes a value of a field ?
I’m new in development of Lotus Designer and I have a problem with this function.
To resolve this problem I have developed a form with a history with these changes but I was thinking in create a field with the last information of this list (It is separated by comma). But every modified field has been registred in a field and I can’t create any rule for this.
Can anybody help please with some solution about it ?
Thanks
Cibele
Subject: Notificate any change in a field
one way is to :
-
declare one form global variable for each field
-
on Querymodechange put value of these fields into their designated variables
-
on Querysave, compare variables with the value of the fields and if they are different prepare a mail send it
Subject: RE: Notificate any change in a field
Another way is in QuerySave, get a handle to the saved document (do a lookup by it’s UNID - don’t use UIDoc.Document, as that’s the modified version in memory) and do a field-by-field compare.
You would need to filter out fields like $Modified, but this is easier if you have a lot of fields, can be easily reused, and does not need to be updated as the form is modified.
Subject: RE: Notificate any change in a field
I have the follow code in my form that insert a line in the History field, but i need to notify the user when the fields DP_RecebPapel and DP_Data_Exped are modified. I don’t know how to develop a code in Lotus script, only using formulas.
How can I use this code to insert the lines code to send a mail when this field are change ? If you have another code to resolve my problem I’ll be so happy :o)
PostOpen event:
Sub Postopen(Source As Notesuidocument)
' The strItemsArray contains the field names you want to observe.
Dim strItemsArray(21) As String
strItemsArray(0) = "DP_RADP"
strItemsArray(1) = "DP_Cliente"
strItemsArray(2) = "DP_Contato"
strItemsArray(3) = "DP_Unidade"
strItemsArray(4) = "DP_TipoProd"
strItemsArray(5) = "DP_Fornecedor"
strItemsArray(6) = "DP_Email"
strItemsArray(7) = "DP_NomeFornec"
strItemsArray(8) = "DP_Abertura"
strItemsArray(9) = "DP_RecebPapel"
strItemsArray(10) = "DP_PrazoTestes"
strItemsArray(11) = "DP_RealTeste"
strItemsArray(12) = "DP_TestesResultados"
strItemsArray(13) = "DP_Data_Exped"
strItemsArray(14) = "DP_NNF"
strItemsArray(15) = "DP_TED"
strItemsArray(16) = "DP_PosicaoCliente"
strItemsArray(17) = "DP_MesAbertura"
strItemsArray(18) = "DP_MesFechamento"
strItemsArray(19) = "DP_NomeSatipel"
strItemsArray(20) = "DP_CodMP"
strItemsArray(21) = "DP_Obs"
' The strItemDspArray contains the field names that are displayed,
' if you do not want to use different display names, then just pass strItemsArray
' as 3rd parameter to the PostOpenStartObservation method.
Dim strItemDspArray(21) As String
strItemDspArray(0) = "RADP"
strItemDspArray(1) = "Cliente"
strItemDspArray(2) = "Contato"
strItemDspArray(3) = "Unidade"
strItemDspArray(4) = "Tipo de Produto"
strItemDspArray(5) = "Fornecedor"
strItemDspArray(6) = "E-mail do Fornecedor"
strItemDspArray(7) = "Nome Fornecedor (Provisório)"
strItemDspArray(8) = "Abertura (RADP)"
strItemDspArray(9) = "Recebimento do Papel"
strItemDspArray(10) = "Prazo do Teste"
strItemDspArray(11) = "Realização do Teste"
strItemDspArray(12) = "Testes Resultados"
strItemDspArray(13) = "Data Expedição"
strItemDspArray(14) = "Numero da NF"
strItemDspArray(15) = "TED (dias)"
strItemDspArray(16) = "Posição do Cliente"
strItemDspArray(17) = "Mês Abertura"
strItemDspArray(18) = "Mês Fechamento"
strItemDspArray(19) = "Nome Satipel"
strItemDspArray(20) = "Codigo MP"
strItemDspArray(21) = "Observações"
' intMaxLenEntryArray is the maximum length of each value being displayed.
' Provide an empty array if you do not want to limit this.
' Here we limit each value to 75 chars max.
Dim intMaxLenEntryArray(21) As Integer
Dim i As Integer
For i = 0 To 21
intMaxLenEntryArray(i) = 75
Next
' "History" is the name of the history field.
Set g_history = New History("fHistory")
' Now we call the initial method of this History object
Call g_history.PostopenStartObservation(Source, strItemsArray, strItemDspArray, intMaxLenEntryArray)
End Sub
Thanks
Cibele
Subject: RE: Notificate any change in a field
I put the code in query save event to compare the value of the two fields and It’s running now.
Thanks so much
Cibele