Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Updating record with new Organization
#16
I went on and looked at the code of the pop-up page. Once I searched for the organization I wished, I looked at the code and here is what I see:

Code:
<html><head><script>
var image_pth = '';

function showAllRecords()
{
        modname = document.getElementById("relmod").name;
        idname= document.getElementById("relrecord_id").name;
        var locate = location.href;
        url_arr = locate.split("?");
        emp_url = url_arr[1].split("&");
        for(i=0;i< emp_url.length;i++)
        {
                if(emp_url[i] != '')
                {
                        split_value = emp_url[i].split("=");
                        if(split_value[0] == modname || split_value[0] == idname )
                                emp_url[i]='';
                        else if(split_value[0] == "fromPotential" || split_value[0] == "acc_id")
                                emp_url[i]='';

                }
        }
        correctUrl =emp_url.join("&");
        Url = "index.php?"+correctUrl;
        return Url;
}

//function added to get all the records when parent record doesn't relate with the selection module records while opening/loading popup.
function redirectWhenNoRelatedRecordsFound()
{
        var loadUrl = showAllRecords();
        window.location.href = loadUrl;
}
</script>
<link rel="stylesheet" type="text/css" href="themes/softed/style.css">
<script language="JavaScript" type="text/javascript" src="include/js/ListView.js"></script>
<script language="JavaScript" type="text/javascript" src="include/js/general.js"></script>
<script language="JavaScript" type="text/javascript" src="include/js/Inventory.js"></script>
<script language="JavaScript" type="text/javascript" src="include/js/json.js"></script>
<!-- vtlib customization: Javascript hook -->
<script language="JavaScript" type="text/javascript" src="include/js/vtlib.js"></script>
<!-- END -->
<script language="JavaScript" type="text/javascript" src="include/js/en_us.lang.js?"></script>
<script language="JavaScript" type="text/javascript" src="modules/Emails/Emails.js"></script>
<script language="JavaScript" type="text/javascript" src="modules/Accounts/Accounts.js"></script><script type="text/javascript" src="include/js/Inventory.js"></script><script type="text/javascript" src="include/js/Mail.js"></script><script type="text/javascript" src="include/js/Merge.js"></script>
<script language="javascript" type="text/javascript" src="include/scriptaculous/prototype.js"></script>
<script type="text/javascript" src="modules/com_vtiger_workflow/resources/jquery-1.2.6.js"></script>
<script type="text/javascript">
    jQuery.noConflict();
</script>
<script type="text/javascript">

function add_data_to_relatedlist(entity_id,recordid,mod, popupmode, callback) {
    var return_module = document.getElementById('return_module').value;
    if(popupmode == 'ajax') {
        VtigerJS_DialogBox.block();
        new Ajax.Request(
            'index.php',
            {queue: {position: 'end', scope: 'command'},
             method: 'post',
             postBody: "module="+return_module+"&action="+return_module+"Ajax&file=updateRelations&destination_module="+mod+"&entityid="+entity_id+"&parentid="+recordid+"&mode=Ajax",
             onComplete: function(response) {
                    VtigerJS_DialogBox.unblock();
                    var res = JSON.parse(response.responseText);
                    if(typeof callback == 'function') {
                        callback(res);
                    }
                }
            }
        );
        return false;
    } else {
        
        opener.document.location.href="index.php?module=Emails&action=updateRelations&destination_module="+mod+"&entityid="+entity_id+"&parentid="+recordid+"&return_module=Emails&return_action=&parenttab=Marketing";
        window.close();
        
    }
}

function set_focus() {
    $('search_txt').focus();
}
</script>

</head><body onload="set_focus()" class="small" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" bottommargin="0" rightmargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="mailClient mailClientBg">
    <tbody><tr>
        <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tbody><tr>
                                                                                <td class="moduleName" width="80%" style="padding-left:10px;">Organizations</td>
                                                                    <td width="30%" nowrap="" class="componentName" align="right">coreBOS</td>
                </tr>
            </tbody></table>
            <div id="status" style="position: absolute; display: none; right: 135px; top: 15px; height: 27px; white-space: nowrap;"><img src="themes/softed/images/status.gif"></div>
            <table width="100%" cellpadding="5" cellspacing="0" border="0" class="homePageMatrixHdr">
                <tbody><tr>
                    <td style="padding:10px;">
                        <form name="basicSearch" action="index.php" onsubmit="callSearch('Basic');return false;">
                        <table width="100%" cellpadding="5" cellspacing="0">
                        <tbody><tr>
                            <td width="20%" class="dvtCellLabel"><img src="themes/images/basicSearchLens.gif"></td>
                            <td width="30%" class="dvtCellLabel"><input type="text" name="search_text" id="search_txt" class="txtBox"> </td>
                            <td width="30%" class="dvtCellLabel"><b>In</b>&nbsp;
                                <select name="search_field" class="txtBox">
                                             <option label="Organization Name" value="accountname">Organization Name</option>
<option label="Website" value="website">Website</option>
<option label="Phone" value="phone">Phone</option>
<option label="Assigned To" value="assigned_user_id">Assigned To</option>

                                </select>
                                <input type="hidden" name="searchtype" value="BasicSearch">
                                <input type="hidden" name="module" value="Accounts">
                                <input type="hidden" name="action" value="Popup">
                                <input type="hidden" name="query" value="true">
                                <input type="hidden" name="select_enable" id="select_enable" value="">
                                <input type="hidden" name="curr_row" id="curr_row" value="">
                                <input type="hidden" name="fldname_pb" value="">
                                <input type="hidden" name="productid_pb" value="">
                                <input name="popuptype" id="popup_type" type="hidden" value="specific_contact_account_address">
                                <input name="recordid" id="recordid" type="hidden" value="4845">
                                <input name="record_id" id="record_id" type="hidden" value="">
                                <input name="return_module" id="return_module" type="hidden" value="Emails">
                                <input name="from_link" id="from_link" type="hidden" value="">
                                <input name="maintab" id="maintab" type="hidden" value="">
                                <input type="hidden" id="relmod" name="" value="">
                                <input type="hidden" id="relrecord_id" name="" value="">
                                <input name="form" id="popupform" type="hidden" value="TasksEditView">
                                                                                                                                                            </td>
                            <td width="20%" class="dvtCellLabel">
                                <input type="button" name="search" value=" &nbsp;Search Now&nbsp; " onclick="callSearch('Basic');" class="crmbutton small create">
                            </td>
                        </tr>
                         <tr>
                            <td colspan="4" align="center">
                                <table width="100%" class="small">
                                <tbody><tr>    
                                    <td class="searchAlph" id="alpha_1" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=A&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_1&quot;)">A</td><td class="searchAlph" id="alpha_2" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=B&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_2&quot;)">B</td><td class="searchAlph" id="alpha_3" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=C&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_3&quot;)">C</td><td class="searchAlph" id="alpha_4" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=D&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_4&quot;)">D</td><td class="searchAlph" id="alpha_5" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=E&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_5&quot;)">E</td><td class="searchAlph" id="alpha_6" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=F&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_6&quot;)">F</td><td class="searchAlph" id="alpha_7" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=G&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_7&quot;)">G</td><td class="searchAlph" id="alpha_8" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=H&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_8&quot;)">H</td><td class="searchAlph" id="alpha_9" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=I&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_9&quot;)">I</td><td class="searchAlph" id="alpha_10" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=J&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_10&quot;)">J</td><td class="searchAlph" id="alpha_11" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=K&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_11&quot;)">K</td><td class="searchAlph" id="alpha_12" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=L&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_12&quot;)">L</td><td class="searchAlph" id="alpha_13" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=M&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_13&quot;)">M</td><td class="searchAlph" id="alpha_14" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=N&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_14&quot;)">N</td><td class="searchAlph" id="alpha_15" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=O&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_15&quot;)">O</td><td class="searchAlph" id="alpha_16" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=P&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_16&quot;)">P</td><td class="searchAlph" id="alpha_17" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=Q&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_17&quot;)">Q</td><td class="searchAlph" id="alpha_18" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=R&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_18&quot;)">R</td><td class="searchAlph" id="alpha_19" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=S&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_19&quot;)">S</td><td class="searchAlph" id="alpha_20" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=T&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_20&quot;)">T</td><td class="searchAlph" id="alpha_21" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=U&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_21&quot;)">U</td><td class="searchAlph" id="alpha_22" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=V&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_22&quot;)">V</td><td class="searchAlph" id="alpha_23" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=W&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_23&quot;)">W</td><td class="searchAlph" id="alpha_24" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=X&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_24&quot;)">X</td><td class="searchAlph" id="alpha_25" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=Y&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_25&quot;)">Y</td><td class="searchAlph" id="alpha_26" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=Z&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_26&quot;)">Z</td>
                                </tr>
                                </tbody></table>
                            </td>
                        </tr>
                        </tbody></table>
                        </form>
                    </td>
                </tr>
                            </tbody></table>

            <div id="ListViewContents"><!-- BEGIN: main -->
<form name="selectall" method="POST">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="small">
    <tbody><tr>
            
        <td>&nbsp;</td>    
        <td style="padding-right:10px;" align="right"></td></tr>
       <tr>
        <td style="padding:10px;" colspan="3">

           <input name="module" type="hidden" value="Emails">
        <input name="action" type="hidden" value="">
        <input name="pmodule" type="hidden" value="Accounts">
        <input type="hidden" name="curr_row" value="">    
        <input name="entityid" type="hidden" value="">
        <input name="popuptype" id="popup_type" type="hidden" value="specific_contact_account_address">
        <input name="idlist" type="hidden" value="">
        <div style="overflow:auto;height:348px;">
        <table style="background-color: rgb(204, 204, 204);" class="small" border="0" cellpadding="5" cellspacing="1" width="100%">
        <tbody>
        <tr>
                                        <td class="lvtCol"><a href="javascript:;" onclick="getListViewSorted_js('Accounts','&amp;recordid=4845&amp;query=true&amp;search_field=accountname&amp;search_text=ORGANIZATION+NEW&amp;searchtype=BasicSearch&amp;popuptype=specific_contact_account_address&amp;return_module=Emails&amp;order_by=accountname&amp;sorder=DESC')" class="listFormHeaderLinks">Organization Name&nbsp;<img src="themes/images/arrow_down.gif" border="0"></a></td>
                            <td class="lvtCol"><a href="javascript:;" onclick="getListViewSorted_js('Accounts','&amp;recordid=4845&amp;query=true&amp;search_field=accountname&amp;search_text=ORGANIZATION+NEW&amp;searchtype=BasicSearch&amp;popuptype=specific_contact_account_address&amp;return_module=Emails&amp;order_by=smownerid&amp;sorder=DESC')" class="listFormHeaderLinks">Assigned To&nbsp;</a></td>
                                </tr>
                    <tr bgcolor="white" onmouseover="this.className='lvtColDataHover'" onmouseout="this.className='lvtColData'" class="lvtColData">
                                              <td><a href="javascript:window.close();" onclick="set_return_contact_address(&quot;4846&quot;, &quot;ORGANIZATION NEW&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;,&quot;&quot;, &quot;&quot;);" id="1">ORGANIZATION NEW</a></td>
                                   <td> Administrator</td>
                           </tr>
                      </tbody>
            </table>
            <div>
        </div></div></td>
    </tr>

</tbody></table>
<table width="100%" align="center" class="reportCreateBottom">
<tbody><tr>
    <td align="right" style="padding: 5px;"><img src="themes/images/start_disabled.gif" border="0" align="absmiddle">&nbsp;<img src="themes/images/previous_disabled.gif" border="0" align="absmiddle">&nbsp;<input class="small" name="pagenum" type="text" value="1" style="width: 3em;margin-right: 0.7em;" onchange="getListViewEntries_js('Accounts','parenttab=Marketing&amp;start='+this.value+'');" onkeypress="return VT_disableFormSubmit(event);"><span name="Accounts_listViewCountContainerName" class="small" style="white-space: nowrap;">of 1</span><img src="themes/images/next_disabled.gif" border="0" align="absmiddle">&nbsp;<img src="themes/images/end_disabled.gif" border="0" align="absmiddle">&nbsp;</td>    
<td width="35%">&nbsp;</td>
</tr>
</tbody></table>
</form>
</div>
        </td>
    </tr>
    
</tbody></table>

<script>
var gPopupAlphaSearchUrl = '';
var gsorder ='';
var gstart ='';
function callSearch(searchtype)
{
    gstart='';
    for(i=1;i<=26;i++)
    {
        var data_td_id = 'alpha_'+ eval(i);
        getObj(data_td_id).className = 'searchAlph';
    }
    gPopupAlphaSearchUrl = '';
    search_fld_val= document.basicSearch.search_field[document.basicSearch.search_field.selectedIndex].value;
    search_txt_val= encodeURIComponent(document.basicSearch.search_text.value.replace(/\'/,"\\'"));
    var urlstring = '';
    if(searchtype == 'Basic')
    {
    urlstring = 'search_field='+search_fld_val+'&searchtype=BasicSearch&search_text='+search_txt_val;
    }
    popuptype = $('popup_type').value;
    act_tab = $('maintab').value;
    urlstring += '&popuptype='+popuptype;
    urlstring += '&maintab='+act_tab;
    urlstring = urlstring +'&query=true&file=Popup&module=Accounts&action=AccountsAjax&ajax=true&search=true';
    urlstring +=gethiddenelements();
    record_id = document.basicSearch.record_id.value;

    //support for popupmode and callback
    urlstring += "&popupmode=";
    urlstring += "&callback=";

    if(record_id!='')
        urlstring += '&record_id='+record_id;
    $("status").style.display="inline";
    new Ajax.Request(
        'index.php',
        {queue: {position: 'end', scope: 'command'},
                method: 'post',
                postBody: urlstring,
                onComplete: function(response) {
                    $("status").style.display="none";
                    $("ListViewContents").innerHTML= response.responseText;
                }
            }
        );
}    
function alphabetic(module,url,dataid)
{
    gstart='';
    document.basicSearch.search_text.value = '';    
    for(i=1;i<=26;i++)
    {
    var data_td_id = 'alpha_'+ eval(i);
    getObj(data_td_id).className = 'searchAlph';
    }
    getObj(dataid).className = 'searchAlphselected';
    gPopupAlphaSearchUrl = '&'+url;    
    var urlstring ="module="+module+"&action="+module+"Ajax&file=Popup&ajax=true&search=true&"+url;
    urlstring +=gethiddenelements();
    record_id = document.basicSearch.record_id.value;
    if(record_id!='')
        urlstring += '&record_id='+record_id;
    $("status").style.display="inline";
    new Ajax.Request(
                'index.php',
                {queue: {position: 'end', scope: 'command'},
                                method: 'post',
                                postBody: urlstring,
                                onComplete: function(response) {
                                    $("status").style.display="none";
                                    $("ListViewContents").innerHTML= response.responseText;
                }
            }
        );
}
function gethiddenelements()
{
    gstart='';
    var urlstring=''    
    if(getObj('select_enable').value != '')
        urlstring +='&select=enable';    
    if(document.getElementById('curr_row').value != '')
        urlstring +='&curr_row='+document.getElementById('curr_row').value;    
    if(getObj('fldname_pb').value != '')
        urlstring +='&fldname='+getObj('fldname_pb').value;    
    if(getObj('productid_pb').value != '')
        urlstring +='&productid='+getObj('productid_pb').value;    
    if(getObj('recordid').value != '')
        urlstring +='&recordid='+getObj('recordid').value;
    if(getObj('relmod').value != '')
                urlstring +='&'+getObj('relmod').name+'='+getObj('relmod').value;
    if(getObj('relrecord_id').value != '')
            urlstring +='&'+getObj('relrecord_id').name+'='+getObj('relrecord_id').value;
    
    // vtlib customization: For uitype 10 popup during paging
    if(document.getElementById('popupform'))
        urlstring +='&form='+encodeURIComponent(getObj('popupform').value);
    if(document.getElementById('forfield'))
        urlstring +='&forfield='+encodeURIComponent(getObj('forfield').value);
    if(document.getElementById('srcmodule'))
        urlstring +='&srcmodule='+encodeURIComponent(getObj('srcmodule').value);
    if(document.getElementById('forrecord'))
        urlstring +='&forrecord='+encodeURIComponent(getObj('forrecord').value);
    // END
        
    if(document.getElementById('currencyid') != null && document.getElementById('currencyid').value != '')
        urlstring +='&currencyid='+document.getElementById('currencyid').value;

    var return_module = document.getElementById('return_module').value;
    if(return_module != '')
        urlstring += '&return_module='+return_module;
    return urlstring;
}
                                                                                                    
function getListViewEntries_js(module,url)
{
    gstart="&"+url;

    popuptype = document.getElementById('popup_type').value;
        var urlstring ="module="+module+"&action="+module+"Ajax&file=Popup&ajax=true&"+url;
        urlstring +=gethiddenelements();
    
            search_fld_val= document.basicSearch.search_field[document.basicSearch.search_field.selectedIndex].value;
        search_txt_val=document.basicSearch.search_text.value;
        if(search_txt_val != '')
            urlstring += '&query=true&search_field='+search_fld_val+'&searchtype=BasicSearch&search_text='+search_txt_val;
        if(gPopupAlphaSearchUrl != '')
        urlstring += gPopupAlphaSearchUrl;    
    else
        urlstring += '&popuptype='+popuptype;    
    
    record_id = document.basicSearch.record_id.value;
    if(record_id!='')
        urlstring += '&record_id='+record_id;

    urlstring += (gsorder !='') ? gsorder : '';
    var return_module = document.getElementById('return_module').value;
    if(module == 'Documents' && return_module == 'MailManager')
    {
        urlstring += '&callback=MailManager.add_data_to_relatedlist';
        urlstring += '&popupmode=ajax';
        urlstring += '&srcmodule=MailManager';
    }

    $("status").style.display = "";
    new Ajax.Request(
                'index.php',
                {queue: {position: 'end', scope: 'command'},
                                method: 'post',
                                postBody: urlstring,
                                onComplete: function(response) {
                                        $("ListViewContents").innerHTML= response.responseText;
                                    $("status").style.display = "none";
                }
            }
        );
}

function getListViewSorted_js(module,url)
{
    gsorder=url;
        var urlstring ="module="+module+"&action="+module+"Ajax&file=Popup&ajax=true"+url;
    record_id = document.basicSearch.record_id.value;
    if(record_id!='')
        urlstring += '&record_id='+record_id;
    urlstring += (gstart !='') ? gstart : '';
    $("status").style.display = "";
    new Ajax.Request(
                'index.php',
                {queue: {position: 'end', scope: 'command'},
                                method: 'post',
                                postBody: urlstring,
                                onComplete: function(response) {
                                        $("ListViewContents").innerHTML= response.responseText;
                                    $("status").style.display = "none";
                }
            }
        );
}

var product_labelarr = {
    CLEAR_COMMENT:'Clear Comment',
    DISCOUNT:'Discount',
    TOTAL_AFTER_DISCOUNT:'Total After Discount',
    TAX:'Tax',
    ZERO_DISCOUNT:'Zero Discount',
    PERCENT_OF_PRICE:'of Price',
    DIRECT_PRICE_REDUCTION:'Direct Price Reduction'
};

</script><!-- stopscrmprint -->        <script type="text/javascript">
            var userDateFormat = "dd-mm-yyyy";
            var default_charset = "UTF-8";
            var userCurrencySeparator = ",";
            var userDecimalSeparator = ".";
        </script>
</body></html>
Pay close attention to this part:

Code:
<td><a href="javascript:window.close();" onclick="set_return_contact_address(&quot;4846&quot;, &quot;ORGANIZATION NEW&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;,&quot;&quot;, &quot;&quot;);" id="1">ORGANIZATION NEW</a></td>
As you can see the scrypt is basically saying that all address fields should be replaced with empty data (&quot;&quot). What's up with that?
For testing purposes, I replaced within the html code of the page the first 2 quotes (&quot;&quot) with some text and once I clicked "Yes" it indeed filled the address field with the text.
Reply


Messages In This Thread
Re: Updating record with new Organization - polanskiman - 06-11-2014, 06:13 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)