Community
Showing results for 
Search instead for 
Do you mean 
Reply

Updating Opportunity via SDK

Accepted Solution Solved
Tuned Listener
Posts: 23
Country: United Kingdom
Accepted Solution

Updating Opportunity via SDK

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

 


Accepted Solutions
Solution
Accepted by topic author JoeBo
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Updating Opportunity via SDK

Looks like the only problem is that you need to call the update method on the note itself. So, nvalue.Update() should do it.

Matthew Wood
Act! SDK Support
Community Moderator

View solution in original post


All Replies
Solution
Accepted by topic author JoeBo
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Updating Opportunity via SDK

Looks like the only problem is that you need to call the update method on the note itself. So, nvalue.Update() should do it.

Matthew Wood
Act! SDK Support
Community Moderator
Tuned Listener
Posts: 23
Country: United Kingdom

Re: Updating Opportunity via SDK

Hi Matthew,

 

Thanks again!