Community
Showing results for 
Search instead for 
Do you mean 
Reply

Update product from existing opportunity

New Member
Posts: 9
Country: Philippines

Update product from existing opportunity

How can I update existing product from opportunity?

Copper Super Contributor
Posts: 86
Country: United_Kingdom

Re: Update product from existing opportunity

Hi,

 

Please could you provide more information, I'm not sure what exactly you're asking for.

 

Are you trying to do something through our development kit, or are you just using Act! as normal?

 

Kind regards,

 

Sam.

____________________________________________________________

Unfortunately I no longer work for Swiftpage International. Please do not send any queries to this account.
Copper Super Contributor
Posts: 478
Country: Australia

Re: Update product from existing opportunity

Hi Sam

 

I am trying to do this now as well, i have the code for an opportunity basic, looking to add to it product and company

 

 

            // This example creates an Opportunity and then populates several of the Opportunities fields.
            // The Opportunity Variables
            OpportunityStatus oStatus = OpportunityStatus.Open;
            int iProbability = 50;
            DateTime dEstCloseDate = System.DateTime.Now.AddDays(15);
            Boolean bMakeItPrivate = false;
            string sName = "TEST Annuity";


            ContactList cList = Act.UI.ActApplication.Instance.ActFramework.Contacts.GetContacts(null);
            Contact cContact = cList[0];

            Guid[] gArray = new Guid[1];
            gArray[0] = c.ID;


            //Process[] pProcess = StageManager.ActiveProcesses[];
            Stage[] sStages = Act.UI.ActApplication.Instance.ActFramework.StageManager.Processes[0].Stages;
            Stage oStage = sStages[5];

            // Opportunity Products
            ProductList pList = Act.UI.ActApplication.Instance.ActFramework.Products.GetProducts(null);
            Product pProduct = pList[0];

            // Opportunity Variables used after its ceated
            string sReason = "Annuity policy has been linked to " + c.FirstName + c.LastName + " at and linked to either an ASA or Code.";
            DateTime dOpenDate = System.DateTime.Now;

            // Call to create opportunity
            Opportunity oOpp = Act.UI.ActApplication.Instance.ActFramework.Opportunities.CreateOpportunity(sName, oStatus, oStage, dEstCloseDate, bMakeItPrivate);
            oOpp.Probability = iProbability;
            oOpp.Reason = sReason;
            oOpp.UpdateContacts(gArray, null);
            oOpp.UpdateProducts(pList[5], pList[0]);
            oOpp.Update();

            // Call to add Product
            // OpportunityProduct oProd = Act.UI.ActApplication.Instance.ActFramework.Products.OpportunityProductManager.CreateCustomEntity();
            // oProd.Name = "";
            // oProd.Quantity = 1;
            // oProd.Cost = 0;
            // oProd.Price = 1;
            // oProd.Discount = 0;
            // oProd.SetOpportunities(Act.UI.ActApplication.Instance.ActFramework.Opportunities.GetOpportunityAsOpportunityList(oOpp));
            // oProd.Update();

Jason Dawson Financial Planning
Brisbane | Australia - JDFP Home Page

Act Ver - Act! Premium Version 17.1.169.0, Hot Fix 3
OS - Windows 7 (stand alone machine)
MS Office - Enterprise 2007
Phone - Samsung Galaxy s6
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Update product from existing opportunity

//Associate newly instantiated OpportunityProduct CustomEntity to an existing Product
// This is only a guess I haven't tested this!
oProd.ProductID = pProduct.ID; .... //Associate Opportunity to Company. Long winded! Company c = oFram.Companies.GetCompanies(null)[0]; c.SetStaticOpportunities(oFram.Opportunities.GetOpportunityAsOpportunityList(oOpp);
Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Administrator
Posts: 221
Country: United States

Re: Update product from existing opportunity

Checking with my opps expert, get back soon.

Administrator
Posts: 221
Country: United States

Re: Update product from existing opportunity

Ok, it looks good, dev answered as follows:

 

"it will tie the opportunity product to the product from the master product list as desired"