Adding a new field to the customer portal screen

Hi All,

We have a drop down udef field on the Reguest screen, and we would like to be able to add it to the Add ticket screen on the customer portal.

I know HTML the code is now available to edit in the Admin client, but is it possible to merge it with CRMScript to add a custom drop down field, which would then update the user defined field on the request once created.

Many thanks,

Trevor

RE: Adding a new field to the customer portal screen

Hi,

Yes - it is possible to merge CRMScript into the HTML files of customer portal. This can be done by using the following syntax directly in the .HTML files:

%EJSCRIPT_START%
<%

// Code 

%>
%EJSCRIPT_END%

After the new ticket form has been submitted, it passed through "ticketPosted.html", so here you will be able to update  the newly registered ticket based on the inserted value. Below is an example showing how ticketPosted.html could look like in order to achieve this.

<h3>%lang("lang_customer_framework_newTicket")%</h3>
Your inquiry has been registered with request ID no. %ticket.id%


%EJSCRIPT_START%
<%

String x_endcustomer = getCgiVariable("x_endcustomer");

Ticket t;
t.load(getParserVariable("ticket.id").toInteger());
t.setValue("x_endcustomer", x_endcustomer);
t.save();

%>
%EJSCRIPT_END%

Here is another thread that might be helpful as well:

New customer portal functionality - adapting the ticket registration form

Af: Petter Näslund 19. nov 2020