We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

Creating companies directly from Customer Centre (Online)

Hi all

has anyone had any experience with creating a company and contact at the same time directly from a customer centre/ webform via CRM Online?

We know we can adapt the on-prem version to do this with partner support, but if we can keep people in the cloud (using expander services or another app) then this is preferred of course ;)

Any help/ advice appreciated as it comes up almost as much as certain web-based ERP integrations!

Many thanks

Matt

RE: Creating companies directly from Customer Centre (Online)

Shouldn't be too hard?

Submit a form in your customer center that POSTs to an ejScript url which takes the parameters and then creates the data?

Av: Hans Wilhelmsen 19. mai 2017

RE: Creating companies directly from Customer Centre (Online)

Thanks Hans, do you have an example of what this might look like for the online environment that Chris in our office could investigate on his return from annual leave please? 

Our partners do not have great EJScript experience which means the onus is put on us with limited resource.

Many thanks

Matt

Av: Matt Cove 19. mai 2017

RE: Creating companies directly from Customer Centre (Online)

Will see if I can find one - if not I can create a -very- basic version so you can see. 

A proper one would obviously contain duplicate checks etc.

Av: Hans Wilhelmsen 19. mai 2017

RE: Creating companies directly from Customer Centre (Online)

In the ticketPosted.html you'll need to create logic that listens to a Company field (in this example <input name="company" />. Note that this needs to be tested thouroughly before executed.

 

%EJSCRIPT_START%
<%
  Integer ticketId = getParserVariable("ticket.id").toInteger();
  if(ticketId > 0)
  {
    String company = getCgiVariable("company");
    if(company != "")
    {
      Integer companyId;

      SearchEngine seCompany;
      seCompany.bypassNetServer(true); 
      seCompany.addField("contact.contact_id");
      seCompany.addCriteria("contact.name", "Equals", company);
      if(seCompany.select() > 0)
        companyId = seCompany.getField(0).toInteger();
      else
      {
        Company comp;
        comp.setValue("name", company);
        companyId = comp.save();   
      }

      Ticket t;
      t.load(ticketId);

      Customer c;
      c.load(t.getValue("custId").toInteger());
      c.setValue("company", companyId.toString());
      c.save();
    }
  }
%>
%EJSCRIPT_END%
Av: Simen Mostuen Iversen 19. mai 2017

RE: Creating companies directly from Customer Centre (Online)

Thanks both,  Chris returns on the 30th May, will get him to liaise on his return!

#Teamwork

Av: Matt Cove 19. mai 2017