Extarnal fields shown in newTicket.html

I have some field configured as External aka should e displayed when viewing newTicket.html at Customer centre.

Is there anyway to hide some of these field depending on a criteria ?

One field is called ticket_x_postal_address how would I hide this ?

 

RE: Extarnal fields shown in newTicket.html

Hi,

This is sort of similar to what you have asked in this post.

But you could probably do something simple like this to hide it:

<script>

var item = $("#ticket_x_postal_address");
item.prev("label").hide();
item.hide();

</script>
By: Michel Krohn-Dale 26 Feb 2021

RE: Extarnal fields shown in newTicket.html

Hi Michael,

Thanks I now have them hidden and shown as intended but no data is saved in the new ticket taht we add in Customer center. See below what ID/names has been used in the inputs:

 

The javascript works now in regards of seeing correct field depending on category but when a new request is sent from Customer centre the filled in data is not saved.

 

These IDs have been used all IDs and names like ‘ticket_xxxxxx

This nameconvention is the one seen if we check one of the fields in Customer center

 

______________________________________________________________________________________

<label id="label_maskinnr">Maskinnr</label>

<input id="ticket_x_maskinnr" type="text" name="ticket_x_maskinnr" size="50" maxlength="10" value=""><br>

 

<label id="label_deliverydate">Önskad leverans</label>

<input id="ticket_x_deliverydate" type="date" name="ticket_x_deliverydate" size="50" maxlength="10" value=""><br>

 

<label id="label_delivered_volume">Best volum (liter)</label>

<input id="ticket_x_delivered_volume" type="text" name="ticket_x_delivered_volume" size="10" maxlength="10" value=""><br>

 

<label id="label_postal_address">Leverans address</label>

<input id="ticket_x_postal_address" type="text" name="ticket_x_postal_address" size="50" maxlength="10" value=""><br>

 

<label id="label_zipcode">Postnr</label>

<input id="ticket_x_zipcode" type="text" name="ticket_x_zipcode" size="10" maxlength="10" value=""><br>

 

<label id="label_city">Ort</label>

<input id="ticket_x_city" type="text" name="ticket_x_city" size="50" maxlength="10" value=""><br>

 

______________________________________________________________________________________

 

By: Henrik Laitinen 1 Mar 2021

RE: Extarnal fields shown in newTicket.html

Hi Henrik,


you need to update ticketPosted.html file with a script. 


Example for ticket_x_maskinnr field

%EJSCRIPT_START%
<%

String x_maskinnr = getCgiVariable("x_maskinnr");

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

%>
%EJSCRIPT_END%
By: Donatas Sasnauskas 1 Mar 2021

RE: Extarnal fields shown in newTicket.html

To add on Donatas' reply, this is only required if you haven't configured the extra fields to be shown on the customer centre.

If you've configured the extra fields with these settings:

It should happen automatically.

 

If you still want to add them manually, just remove this section:

%ROWSTART%
<label>%extra_label%</label>
%IF:extra_error="invalid"%<span class='errorText'>Error: the value is invalid.</span>%ENDIF%
%extra_field%
%ROWEND%
By: Simen Mostuen Iversen 1 Mar 2021

RE: Extarnal fields shown in newTicket.html

Thanks it worked nicely

By: Henrik Laitinen 2 Mar 2021