Set the active company and contact when creating a new appointment in CRMscript

lock
push_pin
done
Answered
4

Hi

I have made a new screen in SuperOffice Service, that the users of SuperOffice uses to create a new project.

On the screen the user writes a text (which is the name of the project) and finds a contact. This contact is then made a project member. Then the screen exits back to SuperOffice on the newly created project.

The above works as it should, but when the users create a new appointment, the “default” company and contact is the one they used last time in SuperOffice CRM.

I would like this company and contact to be the one they selected as the project member.

Does anyone know if it is possible to set the “active” company and contact name, and how it is done in scripting?

/Thomas

16 May 2023 | 06:31 AM

All Replies (4)

Hi Thomas,

How are you sending the user back to the project? With a redirect to a specific url?

16 May 2023 | 06:49 AM
Hi David
I am using the following code (where the urlUrl is a String with the URL with a direct link to the Project):
setVariable("url", urlUrl);
flushCaches();
16 May 2023 | 06:55 AM

If you just redirect the user to the project using a url, you can include the contact_id and person_id in the url, to make that the 'active' contact and person in the user's (super)state.

Example:

../default.aspx?project.main?project_id=123&contact_id=456&person_id=789

16 May 2023 | 06:59 AM

Thank you so much David. That worked like a charm.

 

16 May 2023 | 02:46 PM

Add reply