Skip to main content
Question

Add Record with JavaScript

  • June 26, 2018
  • 0 replies
  • 23 views

Hello,

I am currently trying to add a record to already existing DB and I have code that is already adding records to the DB. My issue is my code will add a record but will not assign fields to the record.

function AddDriverToQB(Driver, PolicyReviewData, apptoken){
    console.log(PolicyReviewData[0].insured_name);
    console.log(Driver[0].age);
    var AddDriverURL = "https://ctc.quickbase.com";
        AddDriverURL += "/db/";
        AddDriverURL += DBID;
        AddDriverURL += "?a=API_AddRecord";
        AddDriverURL += "&_policy___cert__no_="+ PolicyReviewData[0].policy___cert__no_;
        AddDriverURL += "&_insured_name=" + PolicyReviewData[0].insured_name;
        AddDriverURL += "&_driver_name=Guy Richie";
        AddDriverURL += "&apptoken=" + apptoken;
    
    $.get(AddDriverURL, true, function(){
       console.log("Driver Added"); 
    });
    
}

The data for the input are 2 arrays that I know return values as that is what is being printed out before the Add Record. Is there any reason the record would not record fields? 

Thanks in advance.
This topic has been closed for replies.

Ignore my question, I forgot to include the _fnm before my field names.