Forum Discussion

GauravSharma3's avatar
GauravSharma3
Qrew Commander
7 years ago

Need to refresh first then, approve the leave application

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

4 Replies

  • 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.
    • GauravSharma3's avatar
      GauravSharma3
      Qrew Commander
      Sounds good. :)

      Can you please guide me more in achieving this?

      Thanks,
      Gaurav
    • RohitAgarwal's avatar
      RohitAgarwal
      Qrew Cadet
      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.