Forum Discussion

MarkCorcoran's avatar
MarkCorcoran
Qrew Cadet
8 years ago

Copy a child record that contains a Multi-Line Text Field.

I working on a quote form and need to ability to copy a child record on the quote.
(Quote being the parent, and Details being the child records).

I can get it working just fine with the following URL Formula:

var text URL= URLRoot() & "db/" & Dbid() & "?a=API_AddRecord"
& "&_fid_15=" & [Related Sales order]
& "&_fid_13=" & URLEncode([Related Product])
& "&_fid_7=" & URLEncode([Product Description2]) //this is a lookup field
& "&_fid_8=" & [Product Quantity]
& "&_fid_9=" & [Product Unit Price]
& "&_fid_24=" & ToNumber([Taxable Item]);

"javascript:" &
"$.get('" & 
$URL & 
"',function(){" &
"location.reload(true);" &
"});" 
& "void(0);"

(FID #7 is the ID for [Product Description] a multi-line text box).

[Product Description2] is a lookup field that pulls in a default product description from a products table.  Using form Rules, I then copy this value to a field called [Product Description] which is multi-line text box.  This allows the sales reps to edit the product description as needed, and this is what is displayed on the quote.

What I really need is this URL Formula to work:

var text URL= URLRoot() & "db/" & Dbid() & "?a=API_AddRecord"
& "&_fid_15=" & [Related Sales order]
& "&_fid_13=" & URLEncode([Related Product])
& "&_fid_7=" & URLEncode([Product Description]) // this is a multi-line text box.
& "&_fid_8=" & [Product Quantity]
& "&_fid_9=" & [Product Unit Price]
& "&_fid_24=" & ToNumber([Taxable Item]);

"javascript:" &
"$.get('" & 
$URL & 
"',function(){" &
"location.reload(true);" &
"});" 
& "void(0);"

But when I change [Product Description2] to [Product Description] - The URL Formula no longer works (no errors, just don't work).

The only reason I can think of is maybe it is because it is a Multi-Line Textbox.
Any Ideas??

Thanks

Mark
  • That javascript refresh is super handy, but it also hide error messages.

    To debug,

    Do this and then it will expose the success or failure message.  

    var text URL= URLRoot() & "db/" & Dbid() & "?a=API_AddRecord"
    & "&_fid_15=" & [Related Sales order]
    & "&_fid_13=" & URLEncode([Related Product])
    & "&_fid_7=" & URLEncode([Product Description]) // this is a multi-line text box.
    & "&_fid_8=" & [Product Quantity]
    & "&_fid_9=" & [Product Unit Price]
    & "&_fid_24=" & ToNumber([Taxable Item]);

    $URL

    //"javascript:" &
    //"$.get('" & 
    //$URL & 
    //"',function(){" &
    //"location.reload(true);" &
    //"});" 
    //& "void(0);"




     
    • MarkCorcoran's avatar
      MarkCorcoran
      Qrew Cadet
      This is the result.

      <qdbapi>
      <action>API_AddRecord</action>
      <errcode>0</errcode>
      <errtext>No error</errtext>
      <rid>68</rid>
      <update_id>1508604229225</update_id>

      </qdbapi>
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      OK, so put back the formula the way it was.  I thought you meant that it did not create the record.  You are saying that it does create the record, but the fid 7 is blank.

      When you view (not edit) the source record that you are copying, can you tell me what text is on the field [Product Description]?  ie does it in fact have text in it?