script for related fields in a portal - Holiday allowance calculation
I need some help writing a script that'll calculate holiday allowance. Ive created a database in Filemaker that shows Holiday Allowance,Holiday Taken, and Remaining Holiday. This is all displayed in a portal. Ive written a script with help from a colleage that also omit weekend days. so the holiday only calculates weekdays, though havent been as clever to also omit public holidays...but ill figure that out later.
You can see this script attached to this post. I have created a submit button which also runs a script to deduct from fields holiday taken and recalculate holiday remaining when choosing a date range for the requested holiday. The idea is that a manager can then go into this request and choose to approve or reject the holiday. Once approved status will change to approved and change to rejected if rejected. But I need a script that'll recalculate the holiday taken if rejected and reduce holiday taken and back to holiday remaining, perhaps a script that'll no to do this when status says rejected.
Im new to Filemaker and new to writing scripts so would really appreciate some help. Please let me know if I need to provide more information. see attached files for more information also.