Copy link to clipboard
Copied
Hi, im just a newbie in this and hoping someone can help me.
How to add a rule or what script could do,
1. if i enter a value in amount column currency feild will be automatically populated with default currency which is SGD - though the user can change it if the amount is in other currency but the default should be sgd.
2. if the currency column is SGD, fx rate will automatically be 1.00 otherwise, it should require a manual input of fx rate.
Thanks in advance 🙂
Copy link to clipboard
Copied
Why not set SGD and 1 as default values or you want fields to be empty if Amount is empty?
Copy link to clipboard
Copied
yes
Copy link to clipboard
Copied
It's a bit tricky, but possible. I will do it using the Validation event of the Amount field, using this code:
if (event.value) {
if (this.getField("Currency").valueAsString=="") {
this.getField("Currency").value = "SGD";
this.getField("FX Rate").value = "1";
}
}