Skip to main content
Known Participant
September 1, 2022
질문

Adjust value of field based on the value of another field

  • September 1, 2022
  • 2 답변들
  • 201 조회

In my field UnitPrice I wish to adjust the value based on the volume in the field PlatesOrdered. The values are:

Values of PlatesOrdered      Value of UnitPrice

10 - 19                                    171.99

20 - 49                                    167.96

50 - 99                                    162.87

100 - 249                               159.58

250 - 499                                154.67

500 - 999                                 151.40

1000 and greater                      148.27

이 주제는 답변이 닫혔습니다.

2 답변

Nick0128작성자
Known Participant
September 2, 2022

Got it working, but cannot get unit costs not to show till 10 units are obtained. Here is my code:

 

var v = Number(this.getField("PlatesOrdered").valueAsString);
if (v>=10) {
event.value = "131.99";if (v>19) {
event.value = "128.9";
if (v>49) {
event.value = "124.99";
if (v>99) {
event.value = "122.21";
if (v>249) {
event.value = "118.70"; if (v>449) {
event.value = "116.19"; if (v>999) {
event.value = "113.79";
}}}}}}}

Nick0128작성자
Known Participant
September 1, 2022

I should add, that I have several other UnitPrice fields that will change values based on the value of PlatesOrdered.