7/4/2025 9:31:22 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
|
|
|
|
Calling the onDialogClosing Event
Posted: 18 Sep 09 10:44 AM
|
I am working on the Insert Account page. I have written some code against the save button that will update the newly created account's owner depending on selections made to some of the picklists on the Insert Account page.
The problem that I am running into is that if the owner is changed to a team that the logged on user isn't a member of SalesLogix shows the error that the Account cannot be found.
I am attempting to circumvent this with my own pop-up message and redirect if the user is not in the team that's been assigned. My code for this currently looks like this:
. . . else { Sage.Platform.WebPortal.Services.IWebDialogService messageBox = this.DialogService; messageBox.onDialogClosing += new Sage.Platform.WebPortal.Services.dlgClosing(messageBox_onDialogClosing); messageBox.ShowMessage("You have entered an account that you do not have access to view!"); } }
void messageBox_onDialogClosing(object from, Sage.Platform.WebPortal.Services.WebDialogClosingEventArgs e) {
Response.Redirect("Account.aspx?"); }
Now the message box appears for the correct users, however, when the user closes the message box it doesn't seem to call the messageBox_onDialogClosing event, and thus doesn't redirect the user. Can anyone help point out where I am going wrong?
Thanks |
|
|
|
Re: Calling the onDialogClosing Event
Posted: 18 Sep 09 10:59 AM
|
You are adding Dialog Events, but not displaying a Dialog, rather a Message. I am not quite sure what the difference is, but that may be playing into it.
Wouldn't a better approach be to validate the filter the Team options based on the Current user, or to Validate the message before they hit Save? |
|
|
|
Re: Calling the onDialogClosing Event
Posted: 18 Sep 09 11:22 AM
|
I'm not trying to prevent the user from adding an account that they cannot view. In fact it's the complete opposite. The reason I went for the on save, is because when I tried updating the owner on the fly as soon as the user hit on an owner that they weren't a member of, the fields went blank and were disabled so they couldn't continue.
This seemed like the best approach to allow them to add the account but make them aware that the account they were adding had been saved but they weren't able to view.
Your idea "to validate the message before they hit Save" is a good one. Using the same logic that I have on the Save button, I can put onchange events on the relevant picklists and when they hit on a match that will eventually cause the update to the owner that they cannot see on the save I can show them a message and remove it if they change them back to something else.
Thanks for the inspiration. |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|