If you associate a new record in MVG field (i.e. if associating an account to a contact) the last updated field is not updated for the contact.
Hence, it is difficult to know who is associated with the account.
The updated field is only changed if the Primary account is changed.
The solution is simple. Just write a server script in event WebApplet_InvokeMethod in the applet, which is invoked.
In this case, it is Account Mvg Applet. Here is the code
Sub WebApplet_InvokeMethod (MethodName As String)
if MethodName = "NewRecord" Then
Dim ActiveBusComp As BusComp
Dim parentBC As BusComp
Set ActiveBusComp=me.BusComp
Set parentBC = ActiveBusComp.ParentBusComp
If parentBC.Name="Contact" Then
OldValue = parentBC.GetFieldValue("Comment")
If len(OldValue)=0 Then
dateTime=date()
OldValue=" Account Association was added for this contact on :" & dateTime
End If
parentBC.SetFieldValue "Comment", "blah"
parentBC.WriteRecord
parentBC.SetFieldValue "Comment", OldValue
parentBC.WriteRecord
Set parentBC=Nothing
End If
End Sub
No comments:
Post a Comment