SalesLogix 8 – Dialog Action on Form Load
Posted By: Alex.Cottner on June 25th, 2013 in Dojo, Javascript, Saleslogix
No Gravatar

I ran into an issue last week where I needed to load a dialog window in a quickform load action in SalesLogix 8.0 web. In 7.5.4 this wasn’t an issue and it worked fine using the normal method or a C# code snippet. However in 8.0 the dialog windows were never showing up, probably because it was trying to load them before dojo was finished initializing. Solving this was pretty simple but may not be straight forward for anybody who isn’t familiar with Dojo, so I thought it would be nice to post an example.

In the sample below I am popping up the account product dialog window from a quickform load action (c# code snippet) to display a specific account product.
var script = @"require(['dojo/ready', 'Sage/Utility'], // require dojo ready and sage utility as we will need them both
function(ready, utility){ ready(function() { // run this onready so we know that dojo is done loading
utility.loadDetailsDialog({ entityType: 'Sage.Entity.Interfaces.IAccountProduct, Sage.Entity.Interfaces', smartPart: 'AddEditAccountProduct', entityId: '" + myAccountProductId + @"', dialogTitle: 'Edit Products', isCentered:true, dialogTop:0, dialogLeft:0, dialogHeight:400, dialogWidth:750 }); // this is how you popup a dialog via javascript in SLX8
}); });";
ScriptManager.RegisterStartupScript(this, GetType(), new Guid().ToString(), script, true); // register our script to run

Leave a Reply