Formula field interfering with 2nd formula field | Community
Skip to main content
ReluctantProgrammer
Level 4
October 23, 2023
Solved

Formula field interfering with 2nd formula field

  • October 23, 2023
  • 2 replies
  • 1212 views

My form has a field at the beginning where the user defines "full time" or "part time".  If "part time" is selected a "drop down %" field appears and the user defines the %.  This % is then used in a calculation in a table at the bottom of the field, calculating the "Total Pro-Rated Amount" field.  

 

If the "Total Pro-rated Amount" field is less than the "Remaining FY Tuition Allotment" field, the "Final Total Approved Reimbursement" field equals the "Total Pro-Rated Amount" field.  If the "Remaining FY Tuition Allotment" is less than the "Total Pro-rated Amount" field, then the "Final Total Approved Reimbursement" field equals the "Remaining FY Tuition Allotment" field. 

 

To complicate it even more, if the user chooses "full time" then the "Total Pro-Rated Amount" field will be null and at that time, the "Total" field right above it should be compared to the "Remaining FY Tuition Allotment" field and the lesser of these two fields should appear in the "Final Total Approved Reimbursement" field.

 

Through help of Experience League it has been determined the formula in the "Final Total Approved Reimbursement" field is correct and should work.  The thought now is that perhaps the issue lies in the "part time %" field that helps to populate the "Total Pro-Rated Amount".   I feel I'm missing something.  Please review.

 

Form

Completed examples

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ReluctantProgrammer

This did not work for me.  What we did do which does work is the following...

 

min(tblCourse.row9.proRatedApproved[*], row3.tuitionRemaining[0], tblCourse.row8.reimbApproved[0])

in form1.page1.bottom.tblReimbRcvd.row4.finalTotalApproved::calculate - (FormCalc, client)

 

 

2 replies

radzmar
Level 10
October 23, 2023

I can't find the find the fields you're mentioned since they are not named as described. Please highlight them in the sample form with a diffent color. 

ReluctantProgrammer
Level 4
October 23, 2023

Hope this helps.

 

Color code 

radzmar
Level 10
October 24, 2023

Hi,

 

I guess a script as the following should to the trick.

var nPartTime = page1.subApplicant.ddPartTime.rawValue, //DDL nProRatedApproved = tblCourse.row9.proRatedApproved.isNull ? 0 : parseFloat(tblCourse.row9.proRatedApproved.rawValue), //green nReimbApproved = tblCourse.row8.reimbApproved.isNull ? 0 : parseFloat(tblCourse.row8.reimbApproved.rawValue), // red nCost2Dec = row3.cost2Dec.isNull ? 0 : parseInt(row3.cost2Dec.rawValue), //blue nResult = nCost2Dec; //yellow if (nPartTime.isNull) { if (nProRatedApproved <= nCost2Dec) { nResult = nProRatedApproved } } else { if (nReimbApproved <= nCost2Dec) { nResult = nReimbApproved } } this.rawValue = nResult;

 

Put it in the calculate event of form1.bottom.tblReimbRcvd.row4.cost2Dec.

ReluctantProgrammer
ReluctantProgrammerAuthorAccepted solution
Level 4
October 24, 2023

This did not work for me.  What we did do which does work is the following...

 

min(tblCourse.row9.proRatedApproved[*], row3.tuitionRemaining[0], tblCourse.row8.reimbApproved[0])

in form1.page1.bottom.tblReimbRcvd.row4.finalTotalApproved::calculate - (FormCalc, client)