Forum Discussion

PatrickDunn's avatar
PatrickDunn
Qrew Assistant Captain
6 years ago

Formula URL to append to text multi-line

Hello. I have a formula URL button that's designed to copy inputs from one set of fields into another. It works with one exception - I can't seem to copy over the text from a text multi-line field (with edit logs) to another field of the same kind. To be clear, in the case of this field in particular, I'd want the copied over text to append (not replace) to the text already in the destination. Any thoughts?
  • I got it to work.  Are you getting any errors?  Can you post the URL button?  Is the URL button actioning a Save function first; or is it used in View mode?

    Because it is a Logging field; ALL entries in the original-Logging field will copy across; so you will essentially be duplicating the outputs.  Since a logging field cannot be edited; what would be the primary purpose of copying the value of a Logging field into another Logging field?  Are you looking to take the "last" entered entry from the Logging field only into the 2nd logging field?  You can do this if you have a formula to extract the last-entry (which requires adding new entries to the top, not the bottom of the main logging field).
  • PatrickDunn's avatar
    PatrickDunn
    Qrew Assistant Captain
    Hello. Thanks for your assistance. I have part of a form in which users can create new records (in the same table) using data from the current record. I want users to be able to add comments to such a new record in the process. The formula, in a nutshell is as follows:

    var text URLOne = URLRoot() & "db/" & Dbid() & "?act=API_AddRecord"
    & "&_fid_6=" & [Topic]
    & "&_fid_7=" & [Details]
    & "&_fid_160=" & [DE - Comment];

    And then of course later the javascript gets that url. All the other portions of this url work - just not the comment, ie the new record has values in the other fields referenced in the above forula. So just to be crystal clear, fid 160 is the multi-line text field with edit logs. I included the other fields for context. I've tried this with the field "DE - Comment" as a mutiline with edit logs and without. Nothing ever copies over.

    Thoughts?

  • PatrickDunn's avatar
    PatrickDunn
    Qrew Assistant Captain
    I was able to get it to work by converting the "DE - Comment" field from a multi-line text field to a text field, and then also by creating the following variable:
    var text CommentText = ToText([DE - Comment]);

    So the formula now reads:
    & "&_fid_160=" & $CommentText;

    The only catch is that if a user enters a comment then clicks on the formula url button without first clicking out of the comment field, the text doesn't carry over.

    Is there a way for the javascript to click out of a field?