Set different values for follow up task

By | September 2, 2011

Some days ago I came across this requirement. Follow up task is the great tool to create follow up communications immediately, however sometimes it might be the case where in you may want Action or other values of the follow up task to be automatically populated. Below is how you can achieve the same. This blog considers changing the Action of follow up task.

Basically whenever we create new task the page URL will be something like below.

http://localhost/crm61/eware.dll/Do?SID=188485680731732&Act=361&Mode=1&CLk=T&T=newactivity&Key0=4&Key4=1

Now if we create follow up task for this task then the URL will be something like below.

http://localhost/crm61/eware.dll/Do?SID=188485680731732&Act=361&Mode=3&CLk=&Key0=4&Key4=1

In both of the above cases the action value will be the same, but by observation you can find that in first URL you will see “T=newactivity” and this is probably the area of our concern. This is where we get the distinguishing factor to write our scripts on custom content. The script is as follows.

Script

< script for=window event=onload >

lc_url = document.location.href;

lc_url = new String(lc_url)

var flg_act=””;

var flg_newact=””;

//’Check whether action is 361 and it is not a new activity

if(lc_url.search(“Act=361”) > 0)

{

flg_act = ‘Y’;

}

if(lc_url.search(“T=newactivity”) > 0)

{

flg_newact=’Y’

}

else

{

flg_newact=’N’

}

if(flg_act==’Y’ && flg_newact==’N’)

{

if(document.EntryForm)

{

document.EntryForm.comm_action.value=’Meeting’;

}

}

< /script >