The new Dialog functionality not working on the Document Dialog

lock
push_pin
done
Besvart
11

Hi All,

Are we aware of the issue where the new dialogs not working on the Document Dialog.  The following sample piece of code works on the Before and After Save or the Appointment, Sale and Project entites (I am sure it would work on Company and Contact, but I have not tested this).  However when using this script on the Document Before and After Save events, the dialog just does not show.  The script fires, and can see it in the trace, but the dialog is not displayed.

#setLanguageLevel 3;
EventData ev = getEventData();

EventDataDialogDefinition dialog;
dialog.setTitle("Update Active Documents");
dialog.setType("yesno");
dialog.setIcon("question");
dialog.setPrefix("confirmUpdActDocuments_");
dialog.setText("There is already an active document for this document type and project.  Do you want to make remove the active document status from the previous documents?");
ev.showDialog(dialog);

The only dialog I can get to show for the document is the ev.setMessage,  I have tested this on the latest on site release of SuperOffice, and with SuperOffice online.  Does anyone know when this will be available, I have a script to write for a customer that requires this, and at the moment I cannot get this to work.

Many thanks,

Trevor

 

19. mai 2023 | 11:04 a.m.

Alle Svar (11)

I have noticed the same issue with the quote dialog, seems like the dialog functionality doesn't work everwhere in the CRM client (yet)

19. mai 2023 | 11:36 a.m.

Hi David,

That is interesting, it would be good if we can get an idea from SuperOffice as to where adding the dialogs to these screens is in the roadmap.

Trevor

22. mai 2023 | 09:03 a.m.

Hello,

First of all; script triggered dialog are not supported on BeforeSave and AfterSave triggers on Document and Quoteline dialogs.

There are two reasons for this:

  1. They are both written in the PageBuilder framework. This causes quite an effort and a need for custom code to solve. All SCIL based UI behaves the same way, but PageBuilder UI that will be ported to SCIL at some point requires individual customizations for each dialog. We took that investment on some PageBuilder dialogs (like appointment) because the use cases/requirements demanded it.
  2. The document dialog is very challenging to solve because it is actually “several dialogs”. Do you use webtools or not? Do you use SharePoint documents or not. When is save? When document record is created or updated or when the document is updated? Create document without webtools creates an empty document and then opens the document dialog where you can edit properties (open etc.) This does not happen if you have WebTools or SharePoint.

To make a long story short, we postponed this problem to be able to release script triggered dialogs as soon as possible. We are planning to address these challenges when we move these dialogs to SCIL.

At the moment, we do not know when this will happen.

For now a possible solution would be for the user to trigger these scripts from the task menu in the Document or Quote dialog.

30. mai 2023 | 12:05 p.m.
Thank you for the explanation Erik - this makes sense. 🙂 However it would have been useful to have this information available on release of the dialogs. Forgive me if I'm wrong here, but I don't think the documentation states anywhere that dialogs are not supported in some triggers. I know we have had several developers at our team (including me) using time and effort to figure which triggers support dialogs and which do not, and I can see from this thread we are not the only ones. If we knew this from the beginning it would have saved a few of us the time. 🙂
30. mai 2023 | 12:35 p.m.

Hi Erik,

Thanks for the update, definitley helps us by understanding why this is not working in the document dialog box, and to know that it will eventually be included in there, even if we do not yet have a date for this.

Many thanks,

Trevor

30. mai 2023 | 12:26 p.m.
A little more info on the TaskMenu item Erik is referring to: https://community.superoffice.com/en/technical/forums/general-forums/announcements/breaking-taskmenu-item-webpanel-changes-coming/
30. mai 2023 | 12:28 p.m.

Thanks Tony, I have started using the new task menu's and I have to say they are really useful.  The only thing I don't seem to be able to do is refresh SuperOffice after the script has run, I even tried adding "ev.setNavigateTo("soprotocol:refresh");", but that didn't refresh SuperOffice, at the moment, I show have an OK dialog at the end of the script asking the user to refresh their browser to see the changes made by the script.

Trevor

30. mai 2023 | 12:35 p.m.
You can refresh like this: eventData.setNavigateTo("soprotocol:main[refresh=true]");
30. mai 2023 | 02:17 p.m.
Perfect, thanks David, I will give this a go.
30. mai 2023 | 02:54 p.m.

@Espen Steen, have created an issue to add a warning about this in docs.

https://github.com/SuperOfficeDocs/feedback/issues/124

Best regards.

EDIT: This issue has been addressed, and a warning will appear in the next docs release.

30. mai 2023 | 12:56 p.m.
Perfect, thanks!
30. mai 2023 | 01:30 p.m.

Legg til svar