
Question: I would like to open an unbound dialog in SalesLogix, and pass information to the dialog. How can I do this?
Answer: First add parameters before the call to ShowDialog(), an example:
DialogService.DialogParameters.Clear(); DialogService.DialogParameters.Add("MyParameter", MyVariable.ToString()); DialogService.SetSpecs(0, 0, 400, 400, "MyDialog", "My Dialog", true); DialogService.ShowDialog();
Next, retrieve the parameters in the load action of the dialog:
object o = null; DialogService.DialogParameters.TryGetValue("MyParameter", out o); if (o != null) { string myVariable = o.ToString(); }
If the parameter is found, the call to TryGetValue will return true, false if it isn’t found. It is possible to change behavior based on if a parameter is present:
object o = null; if (DialogService.DialogParameters.TryGetValue("MyParameter", out o)) { // Parameter is present, do something string myVariable = o.ToString(); } else { // Parameter not present - do something else }
Hi,
Thanks for your article but can i pass parameter to parent form. As I need some information from dialog. Appreciate your help.
Vivek,
While you can set values in the dialog using things like the session, the bigger problem in your scenario is that you do not receive any event in the parent form to let you know the dialog has closed. You’ll need to rethink what you’re attempting to do (such as setting values in the bound parent entity in the dialog before closing and then refreshing the parent form).
More info on getting the parent entity in the dialog
http://customerfx.com/article/finding-the-current-parent-record-id-in-saleslogix-web/
More info on refreshing workspaces
http://customerfx.com/article/refreshing-various-workspaces-in-the-saleslogix-web-client-using-the-ipanelrefreshservice-service/
Hi Ryan,
i am also tring something like this, to pass the parent entity to the dialog and set some of its property there and send the entity back to the parent page
You don’t need to pass the parent entity to the dialog. From the dialog you can get the parent entity using GetParentEntity(). See the link I mentioned before for more details: http://customerfx.com/article/finding-the-current-parent-record-id-in-saleslogix-web/
Hi ryan,
Thanks for ur previous suggestion.
i want to call my formload event when the dialog popup close on the page, its working on the InsertAccount and AccountDetails but same is not working on Insert Lead, lead Detail contacts…
please suggest how to proceed.
Set the LoadAction’s “Repaint Event” property to true