Skip to Content
avatar image
Former Member

Add Create New Lead Button to Opportunity Details TI Screen

Hello,

I'm working on a project to be able to add a new lead directly from the Overview Tab in the Opportunity TI Screen. Currently there is an existing Embedded Component on the Overview Tab that lists the Leads for that Opportunity, I just want to be able to add a button to that to directly add more leads, but since the EC is Default, the property to add the integrated toolbar is inaccessible for me.

I was thinking of trying to re-create a new Embedded Component for the Leads and then add the button to that, is that the correct approach here, I've been messing with doing so and having a difficult time getting the leads to show up properly.

Please let me know if this is a doable option, or if there is something else that I've just not figured out.

Thanks,
Paul

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Nov 04, 2016 at 05:41 AM

    Hi Paul,

    You could add a button like:

    https://archive.sap.com/discussions/thread/3928022

    Thanks, Pradeep.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 06, 2016 at 07:12 PM

    I have taken Pradeeps advice and am trying to add a button to an Embedded Component. First I have created a new Business Object, that will store the Opportunity ID, which is passed in from the Opportunity. There is a field to add/search for a Lead ID, so I want to add a button that when you put an a Lead ID, it will search for the Lead, then assign the Opportunity ID to that Lead.

    I have created the Embedded Component that accepts the Opportunity ID, but I'm not sure how to go about adding the button that will search for the Lead ID and apply the Opportunity ID.

    Any help on this would be greatly appreciated.

    Edit 1: I think doing a QueryByElements on the Lead is the correct way, and trying to update the BusinessTransactionDocumentReference ID field, but getting an error and not sure what to do now, here is the code:

    import ABSL;
    import AP.CRM.Global;
    
    
    var LeadOppID = this.OpportunityID;
    var LeadID = this.LeadID;
    var TypeCode = this.TypeCode;
    var valQuery;
    var valParam;
    var valResults;
    var instLead;
    
    
    valQuery = Lead.QueryByElements;
    valParam = valQuery.CreateSelectionParams();
    valParam.Add(valQuery.ID.content, "I", "EQ", LeadID);
    valResults = valQuery.Execute(valParam);
    
    
    foreach (instLead in valResults)
    {
    	Lead.BusinessTransactionDocumentReference.BusinessTransactionDocumentReference.ID.content = LeadOppID;
    	break;
    }
    

    Let me know if this looks somewhat right, or if I'm way off base.

    Thanks,
    Paul

    Add comment
    10|10000 characters needed characters exceeded