Use a specific form for viewing and editing records based on a value of the record

  • 1
  • 2
  • Question
  • Updated 5 months ago
  • Answered

Is it possible to "force" the use of a specific form for viewing and editing records based on a value of the record?

For instance, I have a projects table and each of the projects displays different fields on the form based on the 'type' of project. Rather than having all projects display fields that are not relevant, I want to create a very customized form for each of the projects, and I want that form to be 'called' whenever the user clicks on the eye/pencil icons to view/edit the record.

I know I could do this by creating project-specific roles and assigning the needed forms to each role, but I do not want to create 30+ roles just tor this functionality.

I also know that I could create a custom button that opens a specific form for viewing the record, but the problem is that when the user switches from view mode to edit mode, the default form 'kicks in' rather than the project-specific form. The custom button would work if I could keep the custom form when switching between views.

Anyone know how to accomplish this?

Thanks in advance.

Juan

Photo of Juan

Juan

  • 20 Points

Posted 5 years ago

  • 1
  • 2
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
Yes this is possible. I assume you have an association between the value of the [type] field and the form id such s this:

type=alpha => dfid=10
type=beta => dfid=11
type=gamma => dfid=11

Basically all you have to do is use the image onload technique on the report and modify the href attribute on the edit and display icons according to the value of [type] for that record. So if [type]=alpha for the record the normal html markup for the icons would be modified to append the extra parameter &dfid=10 to the href attribute on the edit and view hyperlinks.
See:
http://pastie.org/9351382

I will put this on my ever expanding list of demos to create.
Photo of Micro Dev

Micro Dev

  • 1,576 Points 1k badge 2x thumb
I need to implement this. Thanks for your help.
Photo of Gregg

Gregg

  • 90 Points 75 badge 2x thumb
Dan, I created the Module.js page, and followed your onload technique. I am a rookie...so here is what i am trying to do but cant...My users can click on 5 different buttons on the home page which takes them to a specific form. Each is a different type of communication request form. Once they click save, and reopen the record it goes back to the generic form instead of the specific form for that communication. How do I get the record to go to the specific form every time? Sorry if this sounds like a repeat question.  Thanks...Gregg 
Gregg
Any chance you can go back to form rules and just 1 form. Then there is no problem of which form to use as there is only 1 form.
Photo of Gregg

Gregg

  • 90 Points 75 badge 2x thumb
i agree...but my rules begin to get in the way...Ill work on one form...it seems much cleaner to have individual forms.
IMHO it’s worth the hassle to use form rules.

Keep in mind that you do not want to think about the fields to show and hide and require interms of the Roles first.

Rather, think about each field or more ideally section as to under which circumstances of Roles should see that section. The Rules will be clearer and not conflict if you just work on one section at a time and make a rule for that.
Photo of Douglas Folk

Douglas Folk

  • 266 Points 250 badge 2x thumb
Not enough roles. I don't need a participant to be an admin.  
Photo of Gregg

Gregg

  • 90 Points 75 badge 2x thumb
Thanks for the assistance. I was able to clean it up and now working great. Thanks for the quick responses too! Have a good week.
Photo of Micro Dev

Micro Dev

  • 1,454 Points 1k badge 2x thumb
Would you share your Module.js page and your formula that calls it so I can implement this on my app.

Thanks
Photo of Micro Dev

Micro Dev

  • 1,616 Points 1k badge 2x thumb
Would you share your Module.js page and your formula that calls it so I can implement this on my app.

Thanks
Photo of Micro Dev

Micro Dev

  • 1,616 Points 1k badge 2x thumb
Dan, Did you ever create a pastie for this?

Thanks
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
Nope the thread is four years old
Photo of Micro Dev

Micro Dev

  • 1,616 Points 1k badge 2x thumb
I understand Dan however my question is if you can explain a little more how this would work.

Thanks