Calculate A Price Based On Customer Income

  • 1
  • Question
  • Updated 3 years ago
  • Answered
We are trying to create a fee entry for a customer, and we need to base that fee on a % of the customer income.   For example... Product A costs 1% of the Monthly Customer Income, so if the customer income is $1000, we would charge $10.00 in the fee table.  

The process right now: 
1) Present the employee a list of fees (Fixed, Adjustable, % of Income) via Pop-up
2) Employee selects the fee to charge
3) Create New Record in Customer Fee Table
4) Copy in all the Fee Schedule Values to the Customer Fee Table (no reference, in case the fee changes later)
4) Save The Customer Fee Table
5) Close Pop-Up

We are trying to use: 
(({{Cost_Amount__c}}/100) * {{$Model.CustomerFees.data.0.Customer_Income__c}})

However this will only display the formula out...  1/100 * 1000  

Is there a way of doing this when we are inserting the records?   All our other scenarios have been able to be addressed with the Actions, but this is the last one.

Thanks!
Photo of Joseph Schreurs

Joseph Schreurs

  • 372 Points 250 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Joseph.  You can't currently perform calculations using the Skuid Merge Syntax.  The field value has to be set before the merge occurs.  So there are two ways you can do this. 

1. A formula field on the salesforce object  - this will only work if the inputs are saved before you want the formula to display,  which might be possible in a wizard step...

2. Javascript.  I believe it would be pretty simple to create a custom renderer on the fee entry table that loaded the cost ammount and customer Income values,  performed the calculation, and let the user save that result back to the database. 

Good luck!