function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sachin HatvalneSachin Hatvalne 

I want to convert lead in to opportunity using my hybrid app. Please help me out to know that if there is any standard method in forcetkClient to achieve the same.

Gaurav KheterpalGaurav Kheterpal
If your hybrid app is pointing to VF pages and therefore using Apex controllers, you can do it using the approach mentioned in this (http://blogatsalesforce.blogspot.in/2013/05/salesforce-mobile-sdk.html) tutorial.

Something along these lines
 
//Get and show the details of new Opportunity created by convet Lead process           
        function getOpportunity(result){
            var newacctId = result.Id;
            //Invoke JavaScript Remoting function getOpportunity in Apex controller to get the details of new Opportunity created by convet Lead process
            SalesforceDevMeetupKarachiCtrl.getOpportunity(newacctId,
            //Show the details of new Opportunity created by convet Lead process
            function(result, e){
                $j.mobile.showPageLoadingMsg("b", "Converting Lead ...", true);
                $j('#opptyName').val(result.Name);
                $j('#opptyStageName').val(result.StageName);
                $j('#opptyCloseDate').val(result.Close_Date__c);
                $j('#opptyAmount').val(result.Amount);
                $j('#opptyId').val(result.Id);
                $j.mobile.hidePageLoadingMsg();             
                $j.mobile.changePage('#newconvertedaccountcontactopportunity', {changeHash: true});
            });                                       
        }
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.

Gaurav Kheterpal
Certified Force.com Developer| Salesforce Mobile Evangelist| Developer Forums Moderator| Dreamforce Speaker

 
Saurabh Kukreja 13Saurabh Kukreja 13
Hi Gaurav,
I have a different question but scenario is same.
I am creating a local hybrid app( Have html pages residing on phone ) and in one of page I have to convert a lea(to Opportunity, Account and contact) But I am not getting how to convert a lead or as your answer said, Is it possible that one of my page of local hybrid app points to visualforce page and other local html pages

Please guide