Hi - struggling with some of the differences in 4.0, specifically the clone
contact from 3.0.
I am creating a virtual directory in IIS, and have placed a button on the
account form (it's been renamed to Company). Instead of opening a similar
account entity - I'm opening a new custom entity. The new entity opens - but
no data maps over; instead the error: telephone1 is undefined.
This method works when I'm cloning to similar entity, but for some reason
not from one entity to another. Any suggestions?
<html>
<title>Create Client</title>
<style>
BODY, TD
{
font-family: arial;
font-size: 12px;
}
TD.body
{
border-bottom: solid 1px #cccccc;
text-align: center;
}
</style>
<script language="javascript">
// Set global variable for the cloned contact window
var oClonedContact;
function window.onload()
{
// Open a new contact form
oClonedContact =
window.open('/OrganizationName/userdefined/edit.aspx?etc=10000#','','menubar=0, status=1, width=1000, height=600');
// Set a timeout to wait for the new contact form to load
setTimeout('checkPageState()',100);
}
// Checks if the new contact form has completed loading
// When it completes, CloneContact will be called
// If it's not loaded, it will set a timeout and check again.
function checkPageState()
{
if (oClonedContact.document.readyState == 'complete')
{
CloneContact();
return;
}
setTimeout('checkPageState()',100);
}
function CloneContact()
{
// Get a pointer to the parent window
var oParent = dialogArguments;
var oSource = oParent.document.crmForm;
// With the target crmForm
with(oClonedContact.document.crmForm)
{
// Name fields
// name.DataValue = oSource.name.DataValue;
// accountnumber.DataValue = oSource.new_cunumber.DataValue;
// parentaccountid.DataValue = oSource.new_parentcompanyid.DataValue;
// primarycontactid.DataValue = oSource.new_primarycontactid.DataValue;
// customertypecode.DataValue = oSource.new_relationshiptype.DataValue;
// transactioncurrencyid.DataValue =
oSource.transactioncurrencyid.DataValue;
// new_companyid.DataValue = oSource.parentcustomerid.DataValue;
telephone1.DataValue = oSource.new_telephonelocal.DataValue;
telephone2.DataValue = oSource.new_telephoneld.DataValue;
telephone3.DataValue = oSource.new_telephone800.DataValue;
fax.DataValue = oSource.new_telephonefax.DataValue;
websiteurl.DataValue = oSource.websiteurl.DataValue;
// Address fields
address1_line1.DataValue = oSource.new_street1.DataValue;
address1_line2.DataValue = oSource.new_street2.DataValue;
address1_city.DataValue = oSource.new_city.DataValue;
// address1_stateorprovince.DataValue = oSource.new_state.DataValue;
// address1_postalcode.DataValue = oSource.new_zip.DataValue;
// address1_country.DataValue = oSource.new_countryregion.DataValue;
// Account Information
// territoryid.DataValue = oSource.address1_postalcode.DataValue;
accountcategorycode.DataValue = oSource.address1_country.DataValue;
new_mcaffiliate.DataValue = oSource.new_mcaffiliate.DataValue;
// new_newrep.DataValue = oSource.new_newrep.DataValue;
// new_visaid.DataValue = oSource.new_visaid.DataValue;
// new_mccirrus.DataValue = oSource.new_mccirrus.DataValue;
// new_charter.DataValue = oSource.new_charterno.DataValue;
// revenue.DataValue = oSource.new_revenue.DataValue;
// Client Information
// new_chartertypedesc.DataValue = oSource.new_chartertype.DataValue;
// new_newboardmember.DataValue = oSource.new_newboardmember.DataValue;
// new_settleviadesc.DataValue = oSource.new_settlevia.DataValue;
// new_new500acctno.DataValue = oSource.new_new500acctno.DataValue;
// new_new500date.DataValue = oSource.new_new500date.DataValue;
// new_swcacctno.DataValue = oSource.new_swcacctno.DataValue;
// new_new550acctno.DataValue = oSource.new_new550acctno.DataValue;
// new_new550date.DataValue = oSource.new_new550date.DataValue;
// new_new550balance.DataValue = oSource.new_new550balance.DataValue;
// Description
//description.DataValue = oSource.description.DataValue;
// Internal Information fields
ownerid.DataValue = oSource.ownerid.DataValue;
// Billing Information fields
// creditlimit.DataValue = oSource.creditlimit.DataValue;
// all.creditonhold.DataValue = oSource.all.creditonhold.DataValue;
// paymenttermscode.DataValue = oSource.paymenttermscode.DataValue;
// defaultpricelevelid.DataValue = oSource.defaultpricelevelid.DataValue;
// Contact Methods fields
// preferredcontactmethodcode.DataValue =
oSource.preferredcontactmethodcode.DataValue;
// all.donotemail.DataValue = oSource.all.new_donotemail.DataValue;
// all.donotbulkemail.DataValue = oSource.all.new_donotbulkemail.DataValue;
// all.donotphone.DataValue = oSource.all.new_donotphone.DataValue;
// all.donotfax.DataValue = oSource.all.new_donotfax.DataValue;
// all.donotpostalmail.DataValue = oSource.all.new_donotmail.DataValue;
// Marketing Information fields
// all.donotsendmm.DataValue = oSource.all.new_donotsendmm.DataValue;
// all.lastusedincampaign.DataValue =
oSource.all.lastusedincampaign.DataValue;
// Service Preferences fields
// preferredappointmenttimecode.DataValue =
oSource.preferredappointmenttimecode.DataValue;
// preferredappointmentdaycode.DataValue =
oSource.preferredappointmentdaycode.DataValue;
// preferredserviceid.DataValue = oSource.preferredserviceid.DataValue;
// preferredequipmentid.DataValue = oSource.preferredequipmentid.DataValue;
// preferredsystemuserid.DataValue =
oSource.preferredsystemuserid.DataValue;
}
// Finally, close the dialog
window.close();
}
</script>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"
align>
<tr valign="middle">
<td class="body" align="center">
<div style="font-size= 10pt; font-family= Tahoma;">Creating Client...</div>
</td>
</tr>
</table>
</body>
</html>