04-18-2012 07:30 AM
Hi,
I am attempting to update an opportunity and add a note via the SDK, when debugging everything appears fine the opportunity values are changed but they do not propagate onto ACT! Can anyone give me some advice on how to do this?
Regards,
Joe
Code:
Private Function ACTUpdate(ByVal OppID As String)
Try
Dim txt As String = OppID
Dim ccontact As Contact
Dim cOpp As Act.Framework.Opportunities.Opportunity
Dim oppGuid As New Guid(txt)
Dim Guids(0) As Guid
Guids(0) = oppGuid
Dim sortCriteria() As Act.Shared.Collections.SortCriteria = Nothing
Dim value As OpportunityList
value = HostFramework.Opportunities.GetOpportunities(Guids, sortCriteria)
cOpp = value(0)
cOpp.Name = "Test1"
cOpp.Fields("TBL_OPPORTUNITY.CUST_JobNo_120430133", True) = "99999/1"
Dim cT As ContactList = value(0).GetContacts(sortCriteria)
ccontact = cT(0)
Dim noteType As Act.Framework.Notes.NoteType
Dim noteText As String = "Quote coverted to Transport Job by " & Environ("username").ToUpper
Dim displayDate As Date = DateTime.Now
Dim isPrivate As Boolean = False
noteType = New Act.Framework.Notes.NoteType(Act.Framework.Notes.SystemNoteType.Note)
Dim nvalue As Act.Framework.Notes.Note
nvalue = HostFramework.Notes.CreateNote(noteType, noteText, displayDate, isPrivate, ccontact)
If nvalue.CreateDate > DateTime.Now Then
End If
'ActApplication.Update()
Return True
Catch ex As Exception
Return False
Finally
End Try
End Function
04-18-2012 07:57 AM
Looks like the only problem is that you need to call the update method on the note itself. So, nvalue.Update() should do it.
04-18-2012 07:57 AM
Looks like the only problem is that you need to call the update method on the note itself. So, nvalue.Update() should do it.
04-18-2012 08:15 AM
Hi Matthew,
Thanks again!