How do I open an appointment with a crm-trigger in Online?

I want to open an appointment-prompt, after a sale has been saved, using a crm-trigger in SuperOffice Online.

I've tried to use the function setNavigateTo on the EventData-object, with the following soprotocol string:

EventData ed = getEventData();
ed.setNavigateTo("soprotocol:appointment.main?appointment_id=<some existing appointment ID>");
  1. By setting appointment ID to 0, I open a 'new appointment'. Is there a way to pre-set data on this appointment?

  2. This way of opening the appointment prompt is giving me an unintented bug. See this THREAD for details.
    Am I doing it all in the wrong way in general?

RE: How do I open an appointment with a crm-trigger in Online?

Hi Kasper,

  1. There is no way to pre-populate fields that I know of. Only thing I can think of is to create the appointment using CRMScript, and then edit it (instead of using id=0 to create a new one). Of course, this changes the behaviour a bit, since cancel will cancel editing, but leave the CRMScript created appointment in place.
  2. I was not aware of this bug. It probably requires some debugging in the Web client to figure out what it is. I can only suggest submitting it to the team and have them prioritize it.

Sverre

Av: Sverre Hjelm 2. sep 2019

RE: How do I open an appointment with a crm-trigger in Online?

Hi Kasper, 

Looking past the bug, soprotocol does support setting "current" properties for your situation. For example 

soprotocol:appointment.main?appointment_id=0&contact_id=1&person_id=2&project_id=3&sale_id=4

Have you sent this in to bug@superoffice.com?

Av: Tony Yates 2. sep 2019

RE: How do I open an appointment with a crm-trigger in Online?

@Tony.

This doesn't seem to work, if I do it from a trigger.

I just opens an appointment with default values.

@Sverre.

I've done some more testing, and it does't look like it runs the trigger-script several times It looks like the 'soprotocol' command is stuck in some memory.

Av: Kasper Rosenlund 2. sep 2019

RE: How do I open an appointment with a crm-trigger in Online?

Soprotocol is an idea that should function, i.e. have the same behavior, no matter where it is executing in the client. The fact that this doesn't work is unfortunate.

Av: Tony Yates 3. sep 2019

RE: How do I open an appointment with a crm-trigger in Online?

@Tony maybe this is related to the same behavior I'm descripting.

When adding sale from a Company panel, the sale is prefilled with data. Do you know which commando is used in such case for web? 

Anyway, I've send my original problem (pt. 2) to bug@, so time will tell if its getting fixed :).

Av: Kasper Rosenlund 3. sep 2019

RE: How do I open an appointment with a crm-trigger in Online?

Hi Kasper,

There is no easy fix to this scenario. SoProtocol should function as intended everywhere, however in this case you will unfortunately have to accept the existing behavior, or take the advice and create the appointment in CRMScript and suffer any of the potential side-effects of that flow.

This case flags the limited capabilities of triggers. The lack of support to seamlessly interact with users based on their actions is a real fact and pain.

 

Av: Tony Yates 3. sep 2019