Archive for the ‘Development’ Category.

Sage CRM – Fiddler2

Our development team utilizes several tools to accelerate and enhance the development of customizations. Whether we use Firebug for Firefox to troubleshoot JavaScript errors/oddities or PSPad to quickly mockup code, each tool fills a nitch, and is essential to delivering solid customizations. One tool we use for “super fancy” customizations involving asynchronous callbacks is Fiddler2.

What is Fiddler2?

Fiddler2 is a web debugging proxy. Simply, Fiddler2 allows web based traffic (HTTP and HTTPS) to be monitored, debugged, replayed, and mangled for your pleasure! 

Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP(S) traffic, set breakpoints, and “fiddle” with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.

Fiddler is freeware and can debug traffic from virtually any application, including Internet Explorer, Mozilla Firefox, Opera, and thousands more.

In addition to the core features, Fiddler2, also has a 3rd party plug-in model, allowing users to extend the functionality of Fiddler2. All for FREE!

 

Why would I use Fiddler2?

A valid question. There are several tasks we perform with Fiddler2; here are a couple:

  • Find Hidden and Unhidden Form Values – Form values can be hard to find. Clicking on the “WebForms” tab reveals hidden and unhidden Form values.
  • Troubleshooting Asynchronous Calls – Asynchronous calls can’t be seen from the web browser. However, using Fiddler2, we are able to see the actual call to the backend page. We do this to a.) Ensure the call is being made and b.) Validate that the correct QueryString parameters are being appended.
  • Accelerate Development – When testing, the time spent clicking through 2-3 screens, to reach a button or hyperlink you want to test can, can add up. The “Replay” feature in Fiddler2 speeds this process up. Allowing you to resend a previous request and view the results right inside of Fiddler2!

Screenshot of Fiddler2

Use the right tool?

As with anything, using the right tool is essential. Although Fiddler2 may not be for everyone, we love it. In fact, in a post to come, we hope to show you how we used it to “work around” a bug in SageCRM.

Sage CRM – Tab is not selected when navigating multiple Custom ASP pages

 

The tab for a custom ASP page will not stay highlighted when you jump to another asp page within. For Example: The screen shot below shows a custom asp page called "Logins". The tab is selected within that custom asp page but when you hit new it calls another asp page.

Loginstabselected

loginstabnotselected

You will notice that the tab is not selected when the other asp page is called within the first asp page by pressing the new button.

There are a few ways to handle this problem.

  1. You can just create a tab group and just call it within get page so it goes to it’s own tab group like Marketing.
    Response.Write(eWare.GetPage("YourTabGroup");

    tabgroup

  2. You can handle multiple views within 1 asp page so the tab is selected amongst the other tabs. The code below is an example of using if statements to handle different views and actions.
    <!-- #Include file = "accpaccrm.js" -->
    <%
    if(Request.QueryString("mode") == 'new')
    {
        varCancelButton = eWare.Button("Cancel","cancel.gif",eWare.Url("login.asp"));
        if(eWare.Mode == View)
        {
            eWare.Mode = Edit;
        }
        varLoginNew=eWare.GetBlock("LoginEntry");
        varThisCompany = eWare.GetContextInfo("Company","comp_companyid");
        LoginNew.Title = eWare.GetTrans("tabnames","logins");
        LoginNew.AddButton(CancelButton);
        varmyRecord = eWare.CreateRecord("logins");
        myRecord.log_companyid=ThisCompany;
        eWare.AddContent(LoginNew.Execute(myRecord));
        if(eWare.Mode == Save)
        {
            Response.Redirect(eWare.URL("login.asp"));
        }
    }
    else if(parseInt(Request.QueryString("log_loginid")) > 0)
    {
        varCancelButton = eWare.Button("Cancel","cancel.gif",eWare.Url("login.asp"));
        LoginNew=eWare.GetBlock("LoginEntry");
        LoginNew.AddButton(CancelButton);
        LoginNew.Title = eWare.GetTrans("tabnames","logins");
        LoginNew.DisplayButton(Button_Default) = true;
        LoginNew.DisplayButton(Button_Delete) = true;
        varintRecordId = eWare.GetContextInfo("company","comp_companyid");
        ThisLoginId=Request.QueryString("log_loginid");
        varmyRecord = eWare.FindRecord("logins","log_loginid="+ThisLoginId);
        eWare.AddContent(LoginNew.Execute(myRecord));
        if(eWare.Mode == PostDelete)
        {
            Response.Redirect(eWare.URL("login.asp"))
        }
        if(eWare.Mode == Save)
        {
            Response.Redirect(eWare.URL("login.asp")+"&log_loginid="+myRecord.intRecordId);
        }
    }
    else
    {
        varThisCompany = eWare.GetContextInfo("Company","comp_companyid");
        varurl = eWare.Url("login.asp")+ "&mode=new";
        varnewButton = eWare.Button("New","new.gif", url);
        varLogins = eWare.GetBlock("LoginList");
        Logins.AddButton(newButton);
        varArg = "log_companyid="+ThisCompany;
        eWare.AddContent(Logins.Execute(Arg));
    }
    Response.Write(eWare.GetPage());
    %>