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

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
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
Photo of Printmark

Printmark

  • 406 Points 250 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,256 Points 50k badge 2x thumb
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);"




 
Photo of Printmark

Printmark

  • 406 Points 250 badge 2x thumb
Today was one more brick in the wall for me, it is a good feeling.. thanks again!.

Now onto the next brick (resorting of the line items - drag and drop would be great, but thinking a numbering solution might be my only option).  My trouble is they appear in a different order when using exact forms. - but this is another post topic I have to research).
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,256 Points 50k badge 2x thumb
Yes, I do love that javascript refresh code snippet.  I use it every day in new formula buttons.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,256 Points 50k badge 2x thumb
For sorting you may need to let the user provide an override sequence numeric field to sort on.  Alas,  no native drag and drop, but I seem to recall Dan had a drag 'n drop demo working with, yes, script. 
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,372 Points 20k badge 2x thumb
Yeah you can drag your records around and sort them in to a new order:

QuickBase Bloggers ~ Reorder Bloggers
https://haversineconsulting.quickbase.com/db/bmguzsp87?a=q&qid=1

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=543

Here I am in the midst of demoting Kirk to second fiddle:

(Edited)
Photo of Printmark

Printmark

  • 406 Points 250 badge 2x thumb
Cool... I looked at the pastie, and it all looked a bit cryptic to me.  I'll have to do my homework to figure out how all that works. Thanks for sharing.