Rebuild - Replace URL for a Redirect ASP for a Case Workflow Summary Screen

Hello,

I am having a hard time with redirecting to a summary screen in asp. The redirect is being called from a list page under User My CRM and it uses the custom jump with the asp page name (redirect.asp?) and the case_caseid,case_workflowid as the id fields passing to the redirect.asp page.

This redirects to a asp page which calls up an entryblock for a new screen required for a different workflow within cases.

I have built the redirect URL using different methods found on here but the redirect page doesn't want to behave at all.

My custom screen asp page works as a custom jump too except, it requires: Key8=case_caseid, Key0=8 (case) and to strip out: Key0=4 to show up in the correct workflow and display the case tabs at the top of the screen.

Can anyone see where the code would be failing? The error I am seeing isn't helpful as it is a standard system error advising that asp pages aren't able to display in IIS7 - which tells me the asp format is incorrect as all other asp pages are working with no errors.

redirect.asp as follows:

<code>

<!-- #include file = "../sagecrm.js"-->

<%

var strKeyID = "case_caseid";
var Id = new String(Request.Querystring(strKeyID));
var intRecordId = 0;
if (Id.indexOf(",") > 0) {
var Idarr = Id.split(",");
intRecordId = Idarr[0];
}
else if (Id != "") {
intRecordId = Id;
}

var strSID = new String(Request.QueryString("SID"));
var intDominateKey = 8; //case is the new target context
var fstring = Request.QueryString("F");
var intKey8 = intRecordId;
var intKey50 = Request.QueryString("case_workflowid"); //unique id of the instance (workflowid)
var intUse = Request.QueryString("Key4");
var strFileName = "complaints/complaintssummary.asp"; //target file
var strTabName = "Case"; //tabgroup name to be used.
var strTarget = "/" + sInstallName + "/eware.dll/Do?SID=" + strSID + "&F=" + fstring + "&J=" + strFileName + "&CLk=T&Mode=1&Key-1=4&Key4=" + intUse + "&Key8=" + intRecordId + "&Case_CaseId=" + intRecordId + "&Key50=" + intKey50 + "&T=" + strTabName;


Response.Redirect(strTarget);
%>

</code>

Thanks in advance for any insights.

Regards,

Penny

  • 0

    Penny:

    Unfortunately my javascript is not good enough for me to read your script and tell you if I can see an error! :-)

    However, I recently had to do a rebuild of the URL on a custom entity to get back to the summary page of my entity. Therefore, I am posting what worked for me and perhaps a difference will reveal itself to you. Hope this helps!

    //Get Context===========================

    var strKeyID= "Key58";

    var Id = new String(Request.Querystring(strKeyID));

    var intRecordId = 0;

    if (Id.indexOf(",") > 0)

    {

    var Idarr = Id.split(",");

    intRecordId = Idarr[0];

    }

    else if (Id != "")

    {

    intRecordId = Id;

    }

    var MyRecord = intRecordId;

    //Define strTarget============================

    var strSID = new String(Request.QueryString("SID"));

    var intDominateKey = 58;

    var intKey58 = MyRecord;

    var strFileName = "MyEntity/MyEntitySummary.asp";

    var strTabName = "MyEntity";

    var strEntity = "MyEntity";

    var strTarget = "MyEntity/MyEntitySummary.asp?SID="+strSID+

    "&Key0="

    +intDominateKey+

    "&Key58="

    +intKey58+

    "&J="

    +strFileName+

    "&T="

    +strTabName+

    "&E="

    +strEntity;

    //Add button to container=======================================

    Container.AddButton(CRM.Button("Cancel","Cancel.gif",CRM.Url(strTarget)));

  • 0

    Okay.. I have got somewhere but still an issue with the screen..

    I have managed to successfully rebuild the URL by stripping out the current context and replacing it with the Key8=case_caseid and Key0=8 and T=customCaseTab.

    It shows the right screen with the custom Case in the correct workflow but the Summary tab - is the default ACT=281 (&T=Case). So when I click on the Summary tab, it just takes you back to the default case detail tab.

    I don't have any detail on how to change this - is there any information I am not aware of to help me get the Summary screen to comply?

    This is what is working to get me to this point so I hope this helps someone trying to do a custom jump from a custom list and change the context on the way.

    This is the redirect to customcasesummaryscreen asp page:

    <%

    var strKeyID= "case_caseid";

    var Id = new String(Request.Querystring(strKeyID));

    var intRecordId = 0;

    if (Id.indexOf(",") > 0)

    {

    var Idarr = Id.split(",");

    intRecordId = Idarr[0];

    }

    else if (Id != "")

    {

    intRecordId = Id;

    }

    var strURL = (CRM.URL("customCaseSummary.asp")+"&T=customCaseTabs&Key8="+intRecordId+"&case_caseid="+intRecordId);

    var re = "&Key0=4&Key4=1";

    strURL = strURL.replace(re, "&Key0=8");

    Response.Redirect(strURL);

    %>

    Cheers.

  • 0

    The long and short of much determination to get this working - I gave up. Instead (yes, there is a silver lining!), I have resorted to adding a panel into the casedetailbox when the particular workflow has been created as it uses its own custom field for the id number.

    I used this post ( community.sagecrm.com/.../adding-a-new-panel-to-a-summary-screen-e-g-company-summary.aspx ) and this post ( community.sagecrm.com/.../9079.aspx ) to come up with a working screen for the customised case summary screen. This simply grabs a block (EntryGroup block) with my screen (custom entry screen) and displays it in the first rowgap above the Details panel, using the dummy field set to readonly. I only hide the dummy field if the custom id number is null so the block only displays if the case has the custom id number value and therefore meets my criteria to display for the custom case.

    Here is the on create script placed into the dummy field oncreate script on the casedetailbox screen:

    if (Values("Act") == 281 || Values("Act") == 284)

    {

    var custompl = CRM.GetContextInfo('cases','case_customid');

    if (custompl != "")

    {

    var intRecordId = CRM.GetContextInfo("cases", "case_caseid");

    var CustomPanel = CRM.GetBlock("CustomEntryGroup");

    CustomPanel.DisplayButton("1") = false;

    CustomPanel.DisplayForm = false;

    var myRecord = CRM.FindRecord("cases", "case_caseid=" + intRecordId);

    var strBlockHTML = CustomPanel.Execute(myRecord);

    Caption = CRM.GetTrans("scripttags", "scriptopen");

    Caption += "var strPanelHTML ='";

    Caption += strBlockHTML;

    Caption += "';";

    Caption +=CRM.GetTrans("scripttags", "scriptclose");

    }

    else

    {

    Hidden = true;

    }

    }

    and then the custom content for the same screen:

    crm.ready(function () {

    var customId = $("#case_customid").val();

    if(customId != "");

    {

    var myRowGaps = $("TD.ROWGap");

    myRowGaps[0].innerHTML +=strPanelHTML;

    $("#EntryForm > table > tbody > tr:nth-child(6)").hide();

    $("#EntryForm > table > tbody > tr:nth-child(7)").hide();

    }

    })

    I would like to have the block display without the extra cell at the left of it and the same size panel in length as the other two panels (webpicker and status), but it works.

    This is for 7.3 SP1 - the hiding of the rows is for hiding the Details screen so you might find this needs changing for your version of CRM.

    This isn't the ideal place for the code as it should go into the custom scripts folder but I had to ensure it would work first and I will use best practices and place it into a js file before the changes go live.

    If you have a better solution, please share. I like to refine and develop my scripting especially if it saves time.

    Cheers.