Skip to main content
Question

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

  • October 21, 2017
  • 0 replies
  • 104 views

Forum|alt.badge.img+6
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
This topic has been closed for replies.

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);"