Skip to main content
Participant
May 29, 2024
Answered

Gestion de grille de prix et quantité via le formulaire intéractif

  • May 29, 2024
  • 1 reply
  • 771 views

Bonjour, 

 

Je n'arrive pas à lier une liste déroulante de quantité et une liste de prix pré-établie, pour que les clients sélectionnent une quantité et ça affiche le bon prix, puis calculer le total sur le document. En gros est-ce qu'on peux lier deux listes.

Je ne sais pas si c'est possible et malheureusement je ne peux vous fournir le doc en question. 

 

Bonne journée !

This topic has been closed for replies.
Correct answer try67

Yes, that makes more sense... You can simply apply the price as the export value of each item in your drop-down and then use this code as the calculation script of the price field:

 

event.value = this.getField("Quantity").value;

 

Make sure to set the option of the drop-down field to commit the selected value immediately (under Properties, Options tab), so that the text field will update as soon as you make a selection in the drop-down.

1 reply

try67
Community Expert
Community Expert
May 29, 2024

Yes, it's possible. As the custom validation script of the first field enter something like this (edit the field-name and values as needed, of course):

 

if (event.value=="Product 1") this.getField("PriceList").setItems(["", "1.22", "2.44", "5"]);
else if (event.value=="Product 2") this.getField("PriceList").setItems(["", "3.22", "12.44", "15"]); // etc.
else this.getField("PriceList").clearItems();
Participant
May 29, 2024

I don't know why it don't take it.  it stays on no validation.

I think i was misleading on linking two lists, now i know that i must define a value(price) to a field via the lists(quantity).

 

But why it stays on no validation field.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
May 29, 2024

Yes, that makes more sense... You can simply apply the price as the export value of each item in your drop-down and then use this code as the calculation script of the price field:

 

event.value = this.getField("Quantity").value;

 

Make sure to set the option of the drop-down field to commit the selected value immediately (under Properties, Options tab), so that the text field will update as soon as you make a selection in the drop-down.