Forum Discussion

EvanFujikawa's avatar
EvanFujikawa
Qrew Cadet
8 years ago

Creating a child record from a button on the parent form and automatically return back to the parent form after the child has been saved.

Creating a child record from a button on the parent form and automatically returning back to the parent form after the child record has been saved.

User is on parent form and adds a record to the child form through a button. Is there a way to automatically return back to the parent form after the child form has been saved? If not, it there a way to indicate on the button that a child record has been created for the parent record by changing the color of the button? This is my existing formula  URLRoot() & "db/" & [_DBID_ROOT_CAUSE] & "?a=API_GenAddRecordForm&_fid_17=" & URLEncode ([Record ID#])& "&z=" & Rurl()



Thanks All,
Evan

55 Replies

  • This is the current formula I have for the "Add button" the leads to the root cause form.


    var text URLONE = URLRoot() & "db/" & [_DBID_ROOT_CAUSE] & "?a=API_GenAddRecordForm&_fid_17=" & URLEncode ([Record ID#]); 

    var text URLTWO = URLRoot() & "db/"  & [_DBID_DAMAGE] & "?a=dr&rid=" & [Related Incident];

    var text ADD =  

    $URLONE

    & "&NextURL=" & URLEncode($URLTWO);

    var text EDIT = URLRoot() & "db/" & [_DBID_ROOT_CAUSE] & "?a=dr&rid=" & [Record ID# of the Root Cause];

    If([Record ID# of the Root Cause]>0, $EDIT, $ADD)



    So far it's doing everything correct but to enable the user to get back to the record in the root cause for that was created.

    I want the leave the user in the parent form (Damage) since that's the only form table they will have access to.

    I want the button to do 2 functions if possible; 1 enable the user to create the record in root cause and 2 after the record is created have access to the record without letting the users create multiple records for that same row.

    Below was a workaround I was working on last night in case I don't get the button to function the way I need it. I would rather have access to add/edit function through "Add Investigation" button.

    "Root Cause Related Damage Parts Incidents2" on the right Leads the user to the record that was added once a root cause has been saved. Top row had a record added, bottom row has not had a record added.




    I feel like we're so close to solving this problem!!!
  • There must be a problem with that Summary field.


    For a record with a child root cause record, what is the value on that field.
  • The value in the Summary field is 1 for [Record ID# of the Root Cause]

    Here are the settings.

  • If the value in that Summary minimum Record ID is a 1, then the IF must be performing the EDIT formula variable. If you have changed the "dr " to "er" then pushing the button must be displaying the root cause Record in edit mode, which I thought is what you wanted.
  • Yes, that is what I want. Once the root cause record is created I want the user to only to have access to edit that record and not able to keep "adding" new records.

    What is currently happening is once the user creates a record for root cause the "add" button is not changing to edit mode and allows the user to keep adding new records.
  • I would have to see you app to debug the issue. I can be contacted via my website QuickBaseCoach.com

    My response has been slow today as I have had a technical issues not being able to sign onto the forum today on most of my devices.
  • What about the following:
    var text URLONE=URLRoot() & "db/" & [_DBID_Tasks] & "?a=API_GenAddRecordForm&_fid_11=" & URLEncode ([Record ID#])& 
    "&_fid_60=" & [03 IDD]& 
    "&_fid_61=" & [03 EDD]&;

    var text URLTWO=URLEncode("https://DOMAINNAME.quickbase.com/db/DBID2?a=q&qid=REPORT ID");

    $URLONE
    & "&NextURL=" & URLEncode($URLTWO)

    Getting an invalid formula after the semicolon following &[03 EDD]&
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      Remove the last & in urlone.

      var text URLONE=URLRoot() & "db/" & [_DBID_Tasks] & "?a=API_GenAddRecordForm&_fid_11=" & URLEncode ([Record ID#])&
      "&_fid_60=" & [03 IDD]&
      "&_fid_61=" & [03 EDD];
    • michaelward's avatar
      michaelward
      Qrew Member
      OK that works but it doesnt save the new record and when I hit save and close I get a bad URL (We Cant Understand....) error
  • KellyBianchi's avatar
    KellyBianchi
    Qrew Assistant Captain
    Mark, where would you add the dfid if you want to return to a specific parent form?
  • Kelly, 
    it would be something like this

    var text URLONE = URLRoot() & "db/" & [_DBID_ROOT_CAUSE] & "?a=API_GenAddRecordForm&_fid_17=" & URLEncode ([Record ID#]); 

    var text URLTWO = URLRoot() & "db/"  & dbid() & "?a=dr&dfid=10&rid=" & [Record ID#];

     

    $URLONE

    & "&NextURL=" & URLEncode($URLTWO);