Discussions

 View Only
  • 1.  URL Button Doesn't Work in Edit Mode

    Posted 02-28-2022 09:23
    I've got a URL button "Submit" that creates a child record then redirects to the parent table. It works great, but I can't do it while in edit mode, which is really the place I need it. I want staff to be able to click "Submit" as they are entering data and not have to save it the record then click the button.

    ------------------------------
    Bethany Hudson
    ------------------------------


  • 2.  RE: URL Button Doesn't Work in Edit Mode

    Posted 02-28-2022 09:26
    Can you post your current code?  Is the advanced settings for your table set to save parent automatically

    "Auto save when redirected away from the page"

    Your workflow that you were sitting on a parent record editing the parent record and then clicking submit which is supposed to save the parent record and add a child record?  When they press submit where do you want to land the user?

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: URL Button Doesn't Work in Edit Mode

    Posted 02-28-2022 09:36
    Clicking Submit adds a child record and the user lands back to their task table.
    var text add= URLRoot() & "db/" & [_DBID_AGGREGATE_TASKS]& "?a=API_AddRecord"& "&_fid_80=" & URLEncode([Record ID#]);
    var text URLTHREE = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & ToText([Record ID#]);
    var text Redirect = URLRoot() & "db/" & [_DBID_TASKS] & "?a=q&qid=1&rid=";
    $add
    & "&rdr=" & URLEncode($URLThree)
    & URLEncode ("&rdr=" & URLEncode($Redirect))​


    ------------------------------
    Bethany Hudson
    ------------------------------



  • 4.  RE: URL Button Doesn't Work in Edit Mode

    Posted 02-28-2022 09:42
    1. Is the advanced settings for your table set to save parent automatically
    "Auto save when redirected away from the page"

    2. Can you clarify the desired workflow?


    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------



  • 5.  RE: URL Button Doesn't Work in Edit Mode

    Posted 02-28-2022 09:57
    Yes, that setting is clicked. 
    Here is the workflow: staff member adds a task that they have completed; the submit button saves it to an aggregate table; they are redirected back to their individual tasks list table.

    ------------------------------
    Bethany Hudson
    ------------------------------



  • 6.  RE: URL Button Doesn't Work in Edit Mode

    Posted 02-28-2022 09:40
    Hi Bettany;
    You can create formula rich text field and use that instead. Formula below is saving master table record then adding child record and returns back to master table record. I hope this helps

    Parameters: fid=48 is related project in task table and fid=6 is task name field in Task table.

    var text url=URLRoot() & "db/" & [_DBID_TASKS] & "?a=API_AddRecord&_fid_48="&[Record ID#]&"&_fid_6=test"&
    "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#]);

    "<a class='Vibrant Success SaveBeforeNavigating' style='background: #6BBD57; border: 1px solid #6BBD57' href='" &$url&"'>Add  Task Record</a>"

    Thank you

    ------------------------------
    Razi D.
    Desta Tech LLC
    razi@destatechs.com
    ------------------------------



  • 7.  RE: URL Button Doesn't Work in Edit Mode

    Posted 02-28-2022 11:36
    Bettany,
    Razi is correct. In your use case you will need to use a formula Rich text field type.  
    I believe that you are saying that your workflow is to be on an Add Record form for a Task.  You want to save the record but AFTER the Record ID# is created, you want to also automatically create a record in a different table called Aggregate Tasks.

    Try this as a Rich Text formula field.

    but your code canny be copy pasted.

    // define $add and $ ReDirect here

    var text URL =
    $Add
    & "&rdr=" & URLEncode($ReDirect);


    "<a class='Vibrant Success SaveBeforeNavigating' style='background: #6BBD57; border: 1px solid #6BBD57' href='" & $url & "'>Add  Task Record</a>"









    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------