07-23-2010 11:57 AM
I'm using ACT Version 12.0.0.401
I'm writing in vb.net (a visual studio 2005 app)
I've been able to create contacts, create opportunities, update field values for opportunities all through the SDK.
How do I delete a single opportunity if I know the opportunityID?
I thought it would be something like:
Dim ids(1) As Guid
ids(0) = moppGUID <--- a GUID variable
Dim oppByID As Act.Framework.Opportunities.OpportunityList = actfwk.Opportunities.GetOpportunitiesByID(Nothing
, ids)
Dim id As Guid = oppByID.Item(0).ID
Dim
opp.delete <--- doesn't exist
Thanks in advance!
opp As Act.Framework.Opportunities.Opportunity = oppByID.Item(0)07-23-2010 12:20 PM
I think this is the correct way.
Opportunity o = ActApp.ApplicationState.CurrentOpportunity;
ActApp.ActFramework.Opportunities.DeleteEntity(o);
07-23-2010 01:16 PM
Thanks for the quick reply Matt!
I'd like to delete the opportunity from an application that uses the SDK outside of the ACT! program.
When I see ".applicationstate.currentopportunity" and "Actapp." in your example I think those are meant to be used when writing plugins or otherwise from within ACT!.
I'd like to delete the opportunity record from a .net application that stands apart from ACT!
Thanks in advance!
07-26-2010 02:26 AM
Hi John,
You could try this (sorry its in C# I have completely forgotten my VB syntax), assuming you have your Opportunity by ID as opp and an instance of the ActFramework as oFram:
oFram.Opportunities.DeleteEntity(opp);
HTH
07-26-2010 04:10 AM
I only included the first line where I retrieve the opportunity so the variable 'o' had some context, that could have been done a number of ways. Additionally in my second line, if you were using a stand alone .net application with only framework level access you can simply omit the ActApp and replace ActFramework with your instance of this object.