Forum Discussion

JamesDalton's avatar
JamesDalton
Qrew Trainee
5 years ago

Make it impossible for users to change status back to previous status by mistake

Hello all,

Right now I am working on a policy tracker for the insurance company that I work for. To track the status of each policy in its lifecycle, I am using a dropdown. Every time a user chooses a new status and saves the record, the status gets saved in a child table called 'Status Log'. To make it so that a user cannot choose a previous step by mistake, could I make it so that when a user chooses the next status, all the previous statuses become 'read-only' or something to that effect?








------------------------------
James Dalton
------------------------------
  • If there's a strict order in which these records go from one Status to another, you could always setup the change in Status to be initiated by a button instead. So, say it's in "Quote Sent" status, your button could say something like "Submit to [Next Status]".

    ------------------------------
    Blake Harrison
    bharrison@datablender.io
    DataBlender - Quickbase Solution Provider
    Atlanta GA
    404.800.1702 / http://datablender.io/
    ------------------------------
    • JamesDalton's avatar
      JamesDalton
      Qrew Trainee
      So this is what I came up with

      var text nextStatus = If([Status] = "Pending Initial Action", "Assigned To Underwriter", [Status] = "Assigned To Underwriter", "Quote Sent", [Status] = "Quote Sent", "Awaiting Payment", [Status] = "Awaiting Payment", "Payment Received/Make Live", [Status] = "Payment Received/Make Live", "Policy Live/Money Received", [Status] = "Policy Live/Money Received", "All Appropriate Documents Received", [Status] = "All Appropriate Documents Received", "Policy Documents Sent to Broker");
      
      
      
      var text changeStatus= URLRoot() & "db/" & [_DBID_RENEWALS] & "?a=API_EditRecord&rid="&[Record ID#]&"&apptoken=d24xdccdwjqg6s9cdce8bq29d8n"&"_fid_10=$nextstatus";
      
      
      "javascript:" &
      "$.get('" & 
      $changestatus & 
      "',function(){" &
      "location.reload(true);" &
      "});" 
      & "void(0);"​
      Where _fid_10 is the status field. Did I get something wrong with the syntax? Appreciate any insight.

      ------------------------------
      James Dalton
      ------------------------------
      • BlakeHarrison's avatar
        BlakeHarrison
        Qrew Captain
        I'd suggest the following instead:

        var text nextStatus = Case([Status],
                              "Pending Initial Action","Assigned To Underwriter",
                              "Assigned To Underwriter", "Quote Sent",
                              "Quote Sent", "Awaiting Payment",
                              "Awaiting Payment", "Payment Received/Make Live",
                              "Payment Received/Make Live", "Policy Live/Money Received",
                              "Policy Live/Money Received", "All Appropriate Documents Received",
                              "All Appropriate Documents Received", "Policy Documents Sent to Broker");
        
        
        
        var text changestatus= URLRoot() & "db/" & dbid() & "?a=API_EditRecord&rid="& URLEncode(Record ID#])&"&apptoken=d24xdccdwjqg6s9cdce8bq29d8n" &
                 "_fid_10=" & URLEncode($nextstatus);
        
        var text land = URLRoot() & "db/" & dbid() & "?a=dr&rid=" & URLEncode([Record ID#]);
        
        "<a class='Vibrant Success' & href=" & 
        
           $url &
                
                URLEncode($land)
        
        
        & ">Submit</a>"

        I think I mentioned it in another question you'd posted, but this would be intended to be used in View mode, typically I'd suggest setting it up as a "Submit" or "Complete" button. On the form, you'll want to also make the Status field 'Read Only' unless the user is in an Administrator role.

        ------------------------------
        Blake Harrison
        bharrison@datablender.io
        DataBlender - Quickbase Solution Provider
        Atlanta GA
        404.800.1702 / http://datablender.io/
        ------------------------------