SuperOfficeDocs / superoffice-docs

Contains docs about SuperOffice products.
MIT License
6 stars 19 forks source link

Feedback for Process form submissions #1079

Closed xt1 closed 6 months ago

xt1 commented 7 months ago

CrmScript Forms processing

Form fields are added as input data to the script, where the key is the name of the field.

This script updates the company name with the form value.

EventData ed = getEventData();
Map m = ed.getInputValues();
String contactId = m.get("contactId");
String companyName = m.get("Company - Name");

NSContactAgent agent;
NSContactEntity contact = agent.GetContactEntity(contactId.toInteger());
contact.Name = companyName;
agent.SaveContactEntity(contact);

The fields are added using their labels as the key - so if you form field is labeled foo, you will find it in the input values under "foo". If you have company or contact fields, these will trigger matching against the database - and the input values will also contain contactId and personId values.


Document Details

Do not edit this section. It is required for docs.superOffice.com ➟ Docs Team processing.

digitaldiina commented 7 months ago

@xt1 is this a new feature coming, an omission of a previously released feature, or something else? Could you please give more context and possibly a version number?

xt1 commented 7 months ago

This is documentation for an existing feature. Forms can run a CRMscript as an action, but there is no documentation on how the script should use the form data.

image

After the form submission is processed, the CRMScript is run.

digitaldiina commented 7 months ago

Thanks for clarifying :) I'll add it to the backlog.