Forum Discussion

RyanFarrington's avatar
RyanFarrington
Qrew Member
5 years ago

Custom Save button, API calls, and redirects to specific pages

(This is kind of continued from this thread, but the question/subject is different)

What I would like to happen
  1. Click a button on a Contact record, Form 1
    1. Takes you to Contact record, Form 2
  2. Enter information on Form 2. 
  3. Click button
    1. Saves the Contact record,
    2. API_AddRecord Creates a new Client with the just-saved info from the Contact record 
    3. API_GenAddRecordForm starts a new Project related to the Contact and (ideally) the new Client.
Issue
I don't know how to get #3 to work. I've tried different methods.

Problems
  1. Either the client record isn't created with the updated info from step 2
  2. Or the system goes to an XML result page instead of redirecting to 3c
First: the client record isn't created with the updated info from step 2
  • Acheived with a button on Form 1. The button's code outline is like this:
    1. API_EditRecord to automatically change certain data about the contact
    2. rdr= to the contact on Form 2
      1. &NextURL= to specify what should happen when Form 2 is saved
      2. API_AddRecord to automatically create the new Client record
      3. rdr= 
        1. API_GenAddRecordForm to create a new Project
Second: the system goes to an XML result page instead of redirecting to 3c
  • Achieved by a custom button on Form 2 with a javascript LinkAway. The button's code outline:
    1. href='javascript:LinkAway(\"... to save the updated data in the record
      1. API_AddRecord to automatically create the new Client record
      2. rdr= 
        1. API_GenAddRecordForm to create a new Project
  • It doesn't like anything after step 1.a. and returns the XML result page. I'm pretty sure it successfully creates the client, but refuses to go on to the Project.
  • I've also tried having it just &disprec=1 instead of redirect to the new project but even that doesn't work.
  • I'd be fine with even redirecting to the Contact record, Form 3, so the user just has to click an "Add Project" button, but redirecting there doesn't work either

If anyone has any ideas how to achieve this multi-step process, I'd appreciate the help!


    ------------------------------
    Ryan Farrington
    Graphic designer, project manager, copywriter, engraver, internal Quick Base developer
    rfarrington@experiencepinpoint.com
    ------------------------------
    • Having your user land back on the Contact form may be your best / easiest solution. If you do that, you can create a Client record using an Automation and have it triggered from the save. That same Automation would be able then to relate the Contact to the Client, probably by the time the user selects the 'Add Project' button.

      ------------------------------
      Blake Harrison
      bharrison@datablender.io
      DataBlender - Quick Base Solution Provider
      Atlanta GA
      404.800.1702 / http://datablender.io/
      ------------------------------