setSubmitMode method behaving differently between users

Go To StackoverFlow.com

2

I have two custom picklists: types and duration. The types pick list has two options and the duration has three. Based on what he picks in the types picklist, one of two variables will pass to the OOTB description text box. And based on what he picks in both of the picklists, one of six variables will pass to a custom warranty text box. Both of the text boxes are editable so he can tweak the paragraph-long variables as needed.

Problem 1: The setSubmitMode method was not present at first. When it was not present, he could not revise a quote. Solution 1: I set the setSubmitMode to 'always' on the OnChange events.

Problem 2: When he tried to revise the quote it would throw a Read-Only error but still would allow him to revise and save the quote. Solution 2: I set the setSubmitMode to 'dirty' on the OnChange events and added an OnSave event with a setSubmitMode to 'always'.

Problem 3: When he tries to revise the quote he gets a "Do you want to save your changes" dialog box. When he click "yes" it wipes out his changes and when he click "no" the Quote allows him to revise it... I can not produce the dialog box that a user is getting.

We've tried this in CRM for Outlook and in the browser.

If it helps to know, in both of our set-ups, it looks like it opens a new Quote window. In mine, however, the new window immediately closes without the dialog box in Outlook. But in the browser, it closes the original form too. (This isn't ideal but still is better than what he's getting.)

Thanks & Regards, M

2012-04-05 17:49
by user1315918


0

I'm not sure to exactly understand your issue but for those kinds of problem, I always used the same solution. On the OnSave event, i've this code to save read-only fields edited by the javascript :

 if (Xrm.Page.getAttribute("my_field").getIsDirty()) {
    Xrm.Page.getAttribute("my_field").setSubmitMode("always");
 }

No setSubmitMode("dirty"), or anything else. Even on the onChange event.

I hope it helps, otherwise don't hesitate to add more infos about your process.

Kévin

2012-08-01 13:11
by Kévin Rapaille
Ads