Including custom javascript in SalesLogix
Posted By: nicocrm on January 30th, 2013 in General
No Gravatar

When I need to include a custom javascript in the web client, the quickest way is to simply add the <script> tag to the base.master file. However this complicates upgrades because the base.master file is often modified in Sage’s web updates, and it prevents me from making a clean bundle. So I wanted to share another way which does not require modifying any of the Sage’s stock files. You can create a module, register it on the portal as a global module, and use code such as:

public void Load()
    Page page = HttpContext.Current.Handler as Page;
    if (page == null)
    ScriptManager.RegisterClientScriptInclude(page, page.GetType(), "SSS_SharedScript", 
        HttpContext.Current.Request.ApplicationPath + "/SSS/js/common.js");

Now this module can be added to the bundle and installed on the customer database without interfering with their existing customizations.

Adding a Change Owner link to a Visualforce page
Posted By: Alex.Cottner on January 4th, 2013 in General
No Gravatar

We ran into an interesting limitation with VisualForce. It looks like when you use an apex:outputField on an owner field, the “Change” link doesn’t show up correctly. After searching through the SalesForce forums and some other blog posts I couldn’t find any solution that would work exactly like the standard Owner control works on a normal SalesForce page. The other solutions I found required having a separate “Change Owner” button, or using an output field. I wanted to keep this as close to stock as possible, so I figured the easiest thing to do would be to inject a “Change” link and park it right inside the outputField’s span.

Since this page already has some dojo code on it, I figured that would be the easiest route.