Need to refresh first then, approve the leave application

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • In Progress
Hi team,

I have a Leave Approve button (Formula URL) in my App that approve the leave application. I am facing a problem if someone wants to approve the multiple leave applications (Suppose 4) and what they do, they open all four applications in a different tab and approve one by one. So, what happened, the only first time it worked and increase the leave taken balance but did not increase the leaves taken balance when they approve the rest three applications.

What I want, can you give me a solution when the page refresh first before do the actual work (edit record)?

I have also tried the Xavier solution here but could not get success.

May be @dandiebolt can help me with his script solution.

Thanks,

Gaurav
Photo of Gaurav Sharma

Gaurav Sharma

  • 5,804 Points 5k badge 2x thumb
  • confused

Posted 1 year ago

  • 0
  • 1
Photo of Gaurav Sharma

Gaurav Sharma

  • 5,804 Points 5k badge 2x thumb
@Dan, can you please help me out in this?
Photo of Rohit Agarwal

Rohit Agarwal

  • 552 Points 500 badge 2x thumb
Going in every application and then approving looks tedious.
Assume you have more than 4 and for every application, you want to approve leave application.

Why not create a custom script that allows you to update all application on a single click.

- create a page showing all your application along with a checkbox.
- which ever checkbox is checked collect rid for that checkbox and write API edit record in order to update leave taking balanced w.r.t rid you collected.


let me know if this solution looks good to you.
It will save a lot of time.
Photo of Gaurav Sharma

Gaurav Sharma

  • 5,758 Points 5k badge 2x thumb
Sounds good. :)

Can you please guide me more in achieving this?

Thanks,
Gaurav
Photo of Rohit Agarwal

Rohit Agarwal

  • 552 Points 500 badge 2x thumb
Yeah Sure,

Step 1 - Make API do query call in order to get all your projects or application whatever you say along with the Record ID.

2- Display in a table associated with the check box.

3- Then on click of button check how many check boxes are selected if none leave error message else, Suppose two check boxes are selected get the RID for these 2 check boxes and store in an array.

4- loop through that array in order to make API EDIT Record w.r.t individual RID.

5- Done.


see attached picture for better understanding.