Trigger not reacting to entities created via SuperOffice for Outlook?

It is so that when using SuperOffice for Outlook, a sale for instance is created some other way than what a trigger reacts on?

I have a trigger "Sales: After saving sale" and traced it, created a sale from an email using SuperOffice for Outlook and I did not get a trace (yes, the trigger was activitated). A customer asked if it was possible to set the sale to some other status, hence me trying this setup.

RE: Trigger not reacting to entities created via SuperOffice for Outlook?

CRMScript triggers are only activated for things done in the web GUI, not when done from the API, this includes Mobile CRM, SuperOffice for Outlook, Maillink, and other external integrations.

If you want to execute some business logic that is also triggered outside the web GUI, you will need to use webhooks. You can still use CRMScript for that, see: https://docs.superoffice.com/api/netserver/webhooks/crmscript-handlers.html

By: David Hollegien 30 Jun 2021

RE: Trigger not reacting to entities created via SuperOffice for Outlook?

I understand. But then form submissions are considered "via web GUI" then I assume, I thought it used the API as well.

By: Patrik Larsson 30 Jun 2021

RE: Trigger not reacting to entities created via SuperOffice for Outlook?

Hi Patrik,

David's answer should be marked as Answered, as he correctly answered your question.

SuperOffice for Outlook, despite having a GUI in a web browser, is a different product than the SuperOffice Web Client - which is the only product that triggers CRMScript triggers. No API today triggers CRMScript triggers.

Perhaps we need to be explicit about this point in the trigger docs.

Best regards

By: Tony Yates 30 Jun 2021

RE: Trigger not reacting to entities created via SuperOffice for Outlook?

Of course it should be marked as Answer!  Thanks David for that answer :)

 

Thanks for clarifying this Tony! And yes, please clarify the documentation.

By: Patrik Larsson 30 Jun 2021

RE: Trigger not reacting to entities created via SuperOffice for Outlook?

Hi Patrik,

Do remember that you also have webhooks that could trigger a CRMScript. Webhooks should get triggered when entities connected to the webhooks get, for example, updated, which would include changes via SuperOffice for Outlook as well as SO Mobile, imports, bulk updates, etc (correct me if I'm wrong Tony :)).

Though, do keep in mind that:

- They are server side, for real. And if used for internal usage as opposed to external usage (which might have been the main intent with webhooks), some care is necessary.

- Webhooks could be bombarded with events, e g, when doing an import or a bulk update. Therefore it is a necessity to execute a consequence analysis of potential workflows before an implementation is made. Also keep in mind that additions of external apps and other changes in the environment, or not initially identified workflows, could also affect webhook implementations in unexpected ways. These facts should be taken into consideration as they make the system more susceptible for unexpected or uncontrolled changes. So, such solutions should have a more strict process for how changes are allowed to the implementation. 

- Depending on potential workflows, certain state handling might be necessary to ensure both performance in the environment as well as avoiding circular behaviours.

- It is quite easy to get into circular behaviours if you involve editing entities connected to active WebHooks. So for those workflows, you will have to add some code that checks different states and avoids changes if not expected, etc.

- Webhooks could be automatically deactivated. This means that you should also have a scheduled script that checks the status of expected enabled webhooks and reports via email (or other chosen method) if a webhook has been deactivated. You could also add functionality to automatically try to enable disabled webhooks. But this should also be handled with some care as the webhooks has been disabled due to a reason.

Just wanted to add this as a possibility, but also point out that it is not always as simple as it looks to implement in a safe and controlled way. :)

 

By: Marcus Svenningsson 1 Jul 2021