+ Start a Discussion
Tulasiram ChippalaTulasiram Chippala 

How to populate field values in lightning for contact creation

if(contact_number != 'UnKnown'){
    window.open('/003/e?name_firstcon2='+firstname+'&name_lastcon2='+lastname+'&con10='+contact_number, '_parent');
        } else {
            window.open('/003/e', '_parent'); 
        }
It is populating field values in classic. But in lightning it is not populating values, Only contact creation page is poping up.
 
bhanu_prakashbhanu_prakash
Hi Ram,

Try to add Lightning Events - Force:createRecord into your application . May reslove your problem.
check out below url 
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_createRecord.htm

let us know if it helps you and mark it best if it helps you

Thanks, 
Bhanu Prakash
visit ForceLearn (https://www.forcelearn.com)for salesforce Latest Updates and development tips
 
Tulasiram ChippalaTulasiram Chippala
No Bhanu, you are talking about lightning components. What i required is, we are using CTI Dialer, in this dialer pages there is a Link called add_Contact. So when we get call then it will display some info of a user. When i click on that link it will redirect to contact page for new contact.  For this we used visualforce pages along with javascript remoting. The problem here is, it is populating some contact fields in classic but not working in lightning. Lighning popup is not getting those field values.
bhanu_prakashbhanu_prakash
Hi Ram,
Issue is Lightning does not support Javascript button to you need to use, you need to wrote custom logic for lightning. Check out below trailhead 
https://trailhead.salesforce.com/en/modules/lex_javascript_button_migration
https://partners.salesforce.com/partnerNews?id=a033A00000F2uEEQAZ

let us know if it helps you and mark it best if it helps you

Thanks, 
Bhanu Prakash
visit ForceLearn (https://www.forcelearn.com) for salesforce Latest Updates and development tips
Tulasiram ChippalaTulasiram Chippala
I am defining Lex theme using uiThemeDiaplayed 
if(contact_number != 'UnKnown'&& inLightningExperience()){
		
		sforce.one.navigateToURL('/003/e?172:1519;a='+firstname+'182:1519;a='+lastname+'40:1519;a='+contact_number, true);
	 
	} else if(contact_number != 'UnKnown'&& !inLightningExperience()) { 
	    
	    window.open('/003/e?name_firstcon2='+firstname+'&name_lastcon2='+lastname+'&con10='+contact_number, '_parent');
        } else {
            window.open('/003/e', '_parent'); 
        }
I think the url i am using in sforce.one is wrong, do you suggest me the url that i need