Edit Record on Different Form Based on Field Value

  • 0
  • 1
  • Question
  • Updated 5 months ago
  • In Progress
I've got an application up that is managing the process flow for one of 6 products.  When you edit a record, obviously you see the form for the table.

However, I need to be able to create 5 more different forms, and route the 'edit' to that form, based on what value is in the 'product' field.

I started to use Form Rules, but it's a nightmare trying to hide everything and show everything for all 7 roles.

How can I click on a record in a report and be transported to the correct form, based on the Product field?
Photo of Kyle Chase

Kyle Chase

  • 100 Points 100 badge 2x thumb

Posted 6 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,670 Points 50k badge 2x thumb
No, you cannot. 
I personally despise multiple forms as its a worse nightmare than form rules.

So, you choices are to associate your forms with which reports they should be used on (set that in Forms usage, once you have more than 1 form) or else use sections as much as possible and show hide rules on whole sections.  The issue will be to group your common fields data entry fields together if possible as you may only have a data entry field once on a form.

Photo of Kyle Chase

Kyle Chase

  • 100 Points 100 badge 2x thumb
Thank you very much for your information.

I actually submitted another question just a bit ago because I didn't see this response.  I was trying to create an 'if' statement based on product and redirect from there, but I could never get the syntax right.

Your solution above assumes there are different reports for different products, when in fact it's the same report, but sorted and grouped by product.

So, it seems the only solution is to create multiple reports and then associate those reports with forms in 'Forms Usage'.  But that means multiple reports on the same page, because each Client Manager work multiple products, and so that means that not everything will be displayed in one neat report on dashboards...resistance will be swift and severe.  But, if it's a limitation, it is what it is, I guess.

We definitely do have multiple sections on the first product form and I can certainly show/hide based on [PRODUCT].  I was just thinking that an if statement would be much more efficient.

Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,348 Points 50k badge 2x thumb
Kyle,
I'm still not understanding the question here.

Can you just do this?

We definitely do have multiple sections on the first product form and I can certainly show/hide based on [PRODUCT].  I was just thinking that an if statement would be much more efficient.



Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,074 Points 20k badge 2x thumb
Try this using a single Rich Text Formula Field named [Button]:
"<a class='QBU_Button Vibrant Success'" &
" data-rid='" & [Record ID#] & "'" &
" data-product='" & [Product] & "'" &
" onerror='
(async () => { let dbidTable = `your table dbid`;
  let rid = this.dataset.rid;
  let product = this.dataset.product;
  let map = {
    `sproket`: `10`,
    `widget`,  `11`,
    `thingamajig`, `12`
  };   let dfid = map[product];
  let url = `${dbidTable}?a=er&rid=${rid}&dfid=${dfid}`;
  document.location.href = url;
  window.open(url);
})();
'>Button</a>"
You will need to adjust the map to conform to your product's and dfid's. My mappings act like this:

if [Product] = `sproket` open form with dfid=10
if [Product] = `widget` open form with dfid=11
if [Product] = `thingamajig` open form with dfid=12

Note that this formula uses the 3Q&S Technique and employs three different quote characters:

(1) double quotes are used to delimit the formula text
(2) single quotes are used to delimit the <a> elements attributes
(3) back tick quotes are used as the quote character within the JavaScript.

I did not test this but I think it is correct as is.
(Edited)