Skip to main content
Question

Restructuring Task Table Broke all my API Buttons, Not sure how to fix

  • July 31, 2019
  • 0 replies
  • 207 views

Forum|alt.badge.img+11
I recently corrected my tasks table.  It used to have a List User Field for Assigned To so that I could easily assign tasks and create API buttons to be able to create tasks from my "Opportunities" Table (other places as well).

Some users reported they needed a feature so that they could see all of the tasks their team employees were working on.  So I had to restructure this table so that now I have a departments table with a List User Manager field (sometimes we have more than one manager) and be able to pass that data around to generate the report.  Just got that working, phew.  With a lot of help from the community.

Now, I have my first button I am trying to fix.  Here is the code:

URLRoot() & "db/" & [_DBID_TASKS] & "?a=API_GenAddRecordForm&_fid_12=" & URLEncode ([Record ID#])& 
"&_fid_6=" & URLEncode("Standard Design Proposal") &
"&_fid_8=" & URLEncode(Today()) & 
"&_fid_12=" & [Record ID#] & 
"&_fid_21=" & [Project] &
"&_fid_23=" & "Opportunity" &
"&_fid_28=" & "Opportunity" &
"&_fid_31=" & "mmattera@elitestudioe.com" &
"&z=" & Rurl()

I need to replace the fid31 line.  Somehow I need to create a record in my task assignees table that relates back to this task.  The problem is until this record is saved I dont know its record ID.  So I am not quire sure how to add anything in the join table (Tasks has many Task Assignees, Task Assignees as many Team Members).

When you click this button where are you sitting and what type of record are you trying to create.

Forum|alt.badge.img+5
  • Registered
  • July 31, 2019
Congrats on correcting the task, Ivan. 

Before you invest more time in building API buttons, I'd encourage you to step-back and review your application design.  Grab a sheet of paper (or use the tools in QuickBase).  Draw a rectangle for each table.  Draw an arrow to represent each relationship (point it toward the child table).  This picture is called an application diagram.

Review the diagram with an experienced app. builder.  Mark Shnier is great; CloudBase Services will spend an hour with you gratis.  If you have a good design, building the app. will be easier and faster than if you have extra table OR bad relationships.

Writing API buttons is the equivalent to running water lines.  It's only worth doing once you are absolutely certain where you want the faucet.  So, find yourself a great architect and map out your 'building.'