Discussions

Expand all | Collapse all

Asset check-in logging

  • 1.  Asset check-in logging

    Posted 13 days ago
    I am creating a mobile app that will allow a user to check in an asset. They will scan a barcode or type in an asset id in a a search box. That will bring up the record where there will be a "Check In" button. I want the button to create a new record in a Log table where a Date/Time field has a default of Now(). I want the button to save the record and return to the search dashboard. I am using the standard new record command button:

    URLRoot() & "db/" & [_DBID_LOGS] & "?a=API_GenAddRecordForm&_fid_7=" & URLEncode ([Record ID#])& "&z=" & Rurl()

    How do I get it to also save the record and return to the search form. Looking for the proper way to do it now that embedded JavaScript is not an option.

    ------------------------------
    John Luoma
    ------------------------------


  • 2.  RE: Asset check-in logging

    Posted 12 days ago
    You'll have to use the actual API to generate the record. API_GenAddRecordForm is really just a way of pushing the user to the Add Record form and isn't meant to be used for automating the addition of records in the background. For this, you'll want to use API_AddRecord. Below is the code for a simple Add and Redirect:

    var text tk = "your app token";
    var text URL =  URLRoot() & "db/" & [Table DBID] & "?a=API_EditRecord&apptoken=" & $tk & "&rid=" & [Record ID#] &
        "&_FID_10=now"  & //this would be your Date/Time Field
        "&_FID_11="  & "Whatever value you want to put in Field 11"
        "&rdr=" ;
    var text Land = the URL where you want the user to land;
    
    "<a class='Vibrant Success' & href=" & 
    
       $url &
            
            URLEncode($land)
    
    
    & ">Check In</a>"​


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