Discussions

 View Only
  • 1.  Is there any manual to create Approval/Reject buttons?

    Posted 11-26-2019 01:35
    Edited by Annie Chunji Cui 11-26-2019 01:51
    Hi, 

    I've been looking for a step by step(super basic) guide to create Approval/Reject buttons.. But no luck so far... Could you please share with me the link or documents if you have? 
    To be frank, I don't even know which field type I should select -_-;; 

    Thank you in advance!

    ------------------------------
    Annie
    ------------------------------


  • 2.  RE: Is there any manual to create Approval/Reject buttons?

    Posted 11-26-2019 07:47
    I can try to help, but there are lots of ways to make an approval process.  Can we back up a step here?  What EXACTLY do you want the button to do.

    One technique is to update a field which logs changes in order to be able to trap who approved and when and what value they entered (ie Approved or Rejected).

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------



  • 3.  RE: Is there any manual to create Approval/Reject buttons?

    Posted 12-13-2019 04:22
    Hi Mark, 

    Thank you for your quick follow up! 
    The "Approval button" should 
    1. Once  the item record hits certain discount level, then it will auto trigger approval email to the approver. 
    2. Approver approves via email, it sync back to item record with approved/rejected status, approver and time
    3. In case approver  cannot approve via email, then we can click the "approve" button in quickbase on behalf of the approver. 
    So I think it will need two "button"s. One is in email, the other one is in quickbase.

    ------------------------------
    Annie
    ------------------------------



  • 4.  RE: Is there any manual to create Approval/Reject buttons?

    Posted 11-26-2019 08:21
    Annie,

    Mark is correct that you need to be much more specific about what it means to Approve.   Here is an example of an architecture to do that and provide you the flexibility to answer the inevitable questions that will follow later.  


    Imagine that your Opportunity Status Table has the following values.

    Sales
    Quoting
    Proposed
    Approved
    Rejected

    Putting the Opp Status Change table in between the Opportunity and the Opportunity Status tables means that you are capturing the life cycle of the Opportunity as it goes from person to person.    You know what the status is, when it changed and who changed it.  That gives you the ability to do all sorts of trend analysis on your Opportunities.

    Now getting to your specific question.  Quick Base will automatically build you a button called Add Opportunity Status when you build the tables.  Pushing that will add a record to the Opportunity Status Change table.  The user can pick any value from the Opp Status table.  You can limit those options by building a Record Picker and setting it on the form.

    If you want a single button that will add a record to the Opp Status Change table with a specific value of Approved for the Opp Status, you need what is referred to as a Magic Button.  Kirk Trachy has documented these very well with an application called Magic Buttons in the Exchange.  I also recommend going to his seminar at Empower 2020 in San Diego.  You will not regret it as you can add images, icons, change colors and really enhance your application.

    Quickly what your button uses is the API_AddRecord.   Here is a sample of how to do it with a Formula Rich Text Field.

    You need to put the value of your application token in the Token variable
    I am assuming that Field ID #6 is the Related Opportunity field
    I am assuming that Field ID #7 is the Related Opp Status
    I am assuming the Approved is Record ID# 4 in the Opp Status Table
    The image in this case is a green check box on the Quick Base Server
    The last line is Java Script.  It executes the API call and brings you right back to the form that you are on.  It is the "Magic"

    //  Declare Variables
    var text ApproveIMG  = "<img src=https://images.quickbase.com/si/32/211-check_all.png\>"
    var text Token ="abcdefghijklmnopqrstuv";

    // Declare URL Logic 

    var text URLAPIAdd =
      URLRoot() & "db/" & [_OppStatusChange] & "?a=API_AddRecord&AppToken=" &$Token &
     "&_fid_6=" & URLEncode ([Record ID#]) &
    "&_fid_7=4";

    // Java Script  Executable and UI
    "<a href=\"javascript:" & "$.get('" & $URL  & "', function(){" & "location.reload();" & "});" & "void(0);\">"&$ApproveIMG&"</a>"



    So for the architecture in the diagram, this will give you a button to mark the Opportunity Approved.


    ​​

    ------------------------------
    Don Larson
    Paasporter
    Westlake OH
    ------------------------------



  • 5.  RE: Is there any manual to create Approval/Reject buttons?

    Posted 11-26-2019 10:46
    Annie,

    I made a typo in the Java Script.   I did not use the full name of the variable.

    // Java Script  Executable and UI
    "<a href=\"javascript:" & "$.get('" & $URLAPIAdd  & "', function(){" & "location.reload();" & "});" & "void(0);\">"&$ApproveIMG&"</a>"

    This design makes it possible for you to change the function of the button based on conditions of the Opportunity.  You might define another piece of logic that only lets you set the status to Quoting because the current status is Sales.   Then you build a Case Statement that will make the button do different things.


    ------------------------------
    Don Larson
    Paasporter
    Westlake OH
    ------------------------------



  • 6.  RE: Is there any manual to create Approval/Reject buttons?

    Posted 12-13-2019 04:34
    Thank you Don for your thorough explanation!
    I definitely take some time to play around with your formula. 

    For your regular webinar and Empower 2020 in San Diego, I really hope that i can attend. 
    But for now is a bit difficult for me to stay up the night to attend the webinar or fly to US.. 

    Does your company have any plan to open classes/seminars in Asia? Like Singapore? haha 



    ------------------------------
    Annie
    ------------------------------