Lookup fields population based on the combination of other fields

Hi Team,

 

 

Based on the values of  location(lookup) and category(lookup) I want to auto populate Approval Budget, Budget Code & Budget Amount.

 

I need to perform this on frontend by writing code on Edit page.

 

I have tried setValidationConfig but it didn't worked.

 

Is there any other base method which I should used to acheive this ?

 

 

Many thanks!

Like 0

Like

1 comments

Hi Akshit,

 

Please try using this code for your purposes:

 

if (this.get("Location").value == 'YOUR_VALUE' && this.get("Category").value == 'YOUR_VALUE') {
    this.set("UsrApprovedBudget", id_here);
this.set("UsrBudgetCode", id_here);
this.set("UsrBudgetAmount", id_here);
 }

Where id_here is a lookup value id or a string if you have a hard-coded value.

 

Regards, 

Anastasiia

Show all comments