I have a requirement in cti like when i am dialing existed contact number

  1. then it will open that contact using window.open(url) in javascript method else.
  2. open contact creation page and prepopulate phone, contact name(these phone and contact name coming from directory) using window.open(url) in javascript method.
    i dont know exactly how to form url using these parameters. Please help me

    function showContactForm(contact_number, contactName, callLogId)


    if(contactName && contactName !="UnKnown"){
        var tx=contactName.split(" ");
        var firstname;
        var lastname;
            firstname = tx[0];
            lastname = tx[1];
    if(contact_number != 'UnKnown'){
            window.open('/003/e?name_firstcon2='+firstname+'&name_lastcon2='+lastname+'&con10='+contact_number, '_parent'); 
        } else {
            window.open('/003/e', '_parent'); 

1 Answer 1


My method is to use the console of the browser to inspect form elements.

You have to copy the "id" attibute of the input tag and use it in your URL hack.

For example, I inspected this element in the HTML ofthe "new contact page" :

<input id="name_firstcon2" maxlength="40" name="name_firstcon2" size="20" tabindex="4" type="text">

This HTML element is used for the firstname input fields.

for your url hack, you have to add in the GET parameters "name_firstcon2" like this /003?name_firstcon2=YOUR_NAME

  • Hi @akram thanks a lot, its worked fine in classic. But its not showing predefined values in lightning. I used above code please see that once. Please any suggestions...
    – ApexCode
    Mar 8, 2018 at 6:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .