Skip to Content
author's profile photo Former Member
Former Member

Link Contacts with Sales Oportunities

Hi SDK Developers,

Since the Id sSalesOpportunities_Id Opportunity Sales, how do I tie the activity (oContacts object) to the Sales Opportunity? In the end, the field oContacts.ParentId = sSalesOpportunities_Id, but can not perform the update, because the field is read-only ParentId.

private void SBO_Application_DataEvent(ref SAPbouiCOM.BusinessObjectInfo pVal, out bool BubbleEvent)

{

BubbleEvent = true;

if ((pVal.FormTypeEx == "651" & pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD) & (pVal.BeforeAction == false))

{

// Begin Update

SAPbouiCOM.Form oFormAtividades = SBO_Application.Forms.Item(pVal.FormUID);

SAPbouiCOM.BusinessObject oBusinessObject = oFormAtividades.BusinessObject;

string sUId = oBusinessObject.Key;

SAPbobsCOM.Contacts oContacts;

oContacts = (SAPbobsCOM.Contacts)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oContacts);

oContacts.Browser.GetByKeys(sUId);

//oContacts.ParentId = sSalesOpportunities_Id; // impossible -> read-only

if (oContacts.Update() == 0)

SBO_Application.MessageBox("Update contact Ok.");

else

SBO_Application.MessageBox("Update contact does not exist.");

// End Update

}

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 07, 2011 at 03:20 PM

    Hi,

    Welcome you post on the forum.

    Try If oContacts.ParentId = sSalesOpportunities_Id THEN oContacts.Update()

    Thanks,

    Gordon

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2012 at 06:55 PM

    Hi Silvio, did you solved the problem, I got the same problem, if you check on SDK just read only? Olá Silvio, você conseguiu resolver seu problema, estou com o mesmo problema e não consigo solucionar, a unica solução foi criar um campo de usuário, mas não foi o correto porque tenho problema quando o usuário tenta abrir fora da minha aplicação.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.