Discussions

Expand all | Collapse all

Save the record and call the edit record API

  • 1.  Save the record and call the edit record API

    Posted 26 days ago
    Hi All,

    Please find the code below which i have used for saving a record and then call another function which edit record.
    The fields which are modified using edit record API.

    The code is working some time perfectly but not all times.

    Please let me know if any idea why if there is any issue.


    var text btnColor = "#ff0000";

    var text UrlEdit = URLRoot() & "db/" & Dbid () & "?act=API_EditRecord" &"&rid=" & [Record ID#] & "&_fid_60=4" & "&_fid_78="&UserToName(User())& "&_fid_79="&UserToEmail(User())&"&rdr=" & URLEncode (URLRoot() & "db/" & Dbid () & "?a=dr&rid=" & [Record ID#] & "&rl=zpk");

    "<a onclick=\"if($('#_fid_13').val()!='' ){$('#_fid_72').val($('#_fid_13').val());$('#_fid_13').val('');$('.saveBtn').trigger('click'); $(location).attr('href', '"&$UrlEdit&"')} else{alert('Please enter Comments');}\" style=\"background: "& $btnColor &";border: 1px solid #d6d6d6;border-radius: 5px;color:#ffffff;display: inline-block;padding: 10px;font-family: sans-serif;text-align: center;text-decoration: none;text-shadow: none; white-space: nowrap\" id=\"create_table\" class=\"Vibrant\">Reject</a>"

    ------------------------------
    Uday
    ------------------------------


  • 2.  RE: Save the record and call the edit record API

    Posted 26 days ago
    Try this change

    var text UrlEdit = URLRoot() & "db/" & Dbid () & "?act=API_EditRecord"
    &"&rid=" & [Record ID#]
    & "&_fid_60=4"
    & "&_fid_78="& URLEncode(UserToName(User()))
    "&_fid_79="& URLEncode(UserToEmail(User()))
    &"&rdr="
     & URLEncode (URLRoot() & "db/" & Dbid () & "?a=dr&rid=" & [Record ID#] & "&rl=zpk");

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



  • 3.  RE: Save the record and call the edit record API

    Posted 26 days ago
    Hi Mark,
    Thanks for the reply .

    I have tried using URLEncode but after i click on the button (Created using RICH Text Filed) then its not re-directing to the specified path.
    I have used some JS code which first save the record and call the Edit Record API  which is not working as expected.
     variable  UrlEdit  i have used in location.attr.




    var text UrlEdit = URLRoot() & "db/" & Dbid () & "?act=API_EditRecord"
    &"&rid=" & [Record ID#]
    & "&_fid_60=4"
    & "&_fid_78="& URLEncode(UserToName(User()))
    "&_fid_79="& URLEncode(UserToEmail(User()))
    &"&rdr="
     & URLEncode (URLRoot() & "db/" & Dbid () & "?a=dr&rid=" & [Record ID#] & "&rl=zpk");


    <a onclick = \"<a onclick = \"
    if($('#_fid_13').val()!='' )
    {
    $('#_fid_72').val($('#_fid_13').val());
    $('#_fid_13').val('');
    $('.saveBtn').trigger('click'); 
    $(location).attr('href', '" & $UrlEdit & "')
    }  else {
    alert('Please enter Comments'); }

    \" style=\"background: " & $btnColor & "; border: 1px solid #d6d6d6; border-radius: 5px; color:#ffffff; display: inline-block;padding: 10px; font-family: sans-serif; text-align: center; text-decoration: none; text-shadow: none;  white-space: nowrap \" id=\"create_table\" class=\"Vibrant\"> Reject</a>"



    ------------------------------
    Udaya Theja Venkataramana
    ------------------------------