Saturday, February 02, 2008

Convert Quick Campaign Response




Hello, Microsoft CRM 3.0 can be a useful tool when you create campaigns and everything you need, but quick campaigns, cool one activity, but when you make a campagin response in a letter you say huuuummm.... what "Template letter" i have to response?...

Well to answer that question i just create this simples steps

1 Step:
Go to your "isv.config.xml"
<entity name="letter">
<toolbar>
<button title="Quick Campaign Response" tooltip="Quick Campaign Response" icon="/_imgs/ico_18_4401.gif">
</toolbar>
</entity>

2 Step:
Go to customize Letter Entity Form and select OnLoad():

try
{
document.getElementById("ISV_New_1_2_QuickCampaignResponse").onclick=FnOpenWindow;
}
catch(err)
{
}

function FnOpenWindow()
{
window.open('http://[server]/ma/campaignresponse/edit.aspx?_CreateFromType=4207&_CreateFromId='+gup( 'id' ),'Campanha','width=800,height=1024,top=30,left=30,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=1');
}

function gup( name ){ name = name.replace(/[\[]/,'\\\[').replace(/[\]]/,'\\\]'); var regexS = '[\\?&]'+name+'=([^&#]*)'; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ''; else return results[1];}

3 Step:
Go to customize Campaign Response Entity Form and select OnLoad


var CRM_FORM_TYPE_CREATE = 1;

var Qcampaign = new Array;
var lookupItem = new Array;

switch (crmForm.FormType)
{
case CRM_FORM_TYPE_CREATE:
try
{
lookupItem = window.opener.document.all['to'].DataValue;
Qcampaign= window.opener.document.all['regardingobjectid'].DataValue;

if (Qcampaign[0].type == 4406)
{
if (lookupItem[0] != null)
{
crmForm.all.customer.DataValue =lookupItem;
}
}
}
catch(err)
{}
break;
}
Post a Comment