Forum Discussion

Axsess_EnergyGr's avatar
Axsess_EnergyGr
Qrew Cadet
11 years ago

Link/button to open specific form

I have a report that lists customers. When I choose a customer it brings up a form that has a ton of useful summary info about the customer brought in from many parts of the application (this is done with report links, charts, etc).

I would like to be able to insert buttons (or links) on other forms (in other tables) in the app so that when I am viewing a particular customer I can reference info for the customer by launching that useful summary form for that specific customer. Ideally the form with the summary customer info would open in another window so the user can easily reference info between that new window and the form they were working on (or at least open it in a new tab).

I assume this can be done with a formula url field but I am not clear on the code to use that calls the specific form I need and also ties to the customer of the record I am in at the time. Any thoughts would be appreciated.

Tony

34 Replies

  • Hi, this is what i use - I have typed in CAPs all the fields you have to change in your formula.

    "https://DOMAIN NAME/db/TABLE ID?a=nwr&dfid=FORM ID\n&_fid_RELATED FIELD ID IN PARENT TABLE=" & URLEncode ([ID OF KEY FIELD IN CHILD TABLE])
  • To edit a record th format is this

    urlroot() & "db/" & dbid() & "?a=er&dfid=xx&rid=" & Totext([Record ID#])



    where xx is the form ID#
  • I am trying to use the same approach but in my case I have two unrelated tables with one field in each that matches.  So tried the following but no luck. 

    URLRoot() & "db/" & [_DBID_Customers]& "?a=dr&dfid=2&rid"& [Location No]=" &[Location No])
    • MCFNeil's avatar
      MCFNeil
      Qrew Captain
      You have to know the Key field to find that is on the other table (i.e Record ID),  If [Location No] is not the key field you cannot go directly to the record, but rather you will have to do  query to find that [location no]


      Syntax if Key field is [Location No]:

      URLRoot() & "db/" & [_DBID_Customers]& "?a=dr
      &dfid=2
      &rid=URLEncode([Location No])
      Syntax if needing a query:
      URLRoot() & "db/" & [_DBID_Customers]& "?a=q&qid=1
      &query={11.EX."&[Location No]&"}

      (this is assuming your location fid in the new table is FID 11)
    • ArshadKhwaja's avatar
      ArshadKhwaja
      Qrew Commander
      Thanks Matt. Location number is not a key field in both of these tables. I tried this as is by changing the FID but I am getting syntax error 'expected a valid expression after the "&". 

      In this formula where is it matching the location number with the table I am calling from? 
    • MCFNeil's avatar
      MCFNeil
      Qrew Captain
      What are your two DBIDs?  _DBID_Customers  & What?
      What are the field IDs for the [Location No] on those two tables respectively?_
  • Arshad,

    If you are looking to launch a report, the. Build your perfect report and have an question for the missing information. Then build the link below and it will launch a report and answer its own question using data from the record that you are launching from.

    Suppose your perfect report is qid=99

    Urlroot() & "db/" & [_DBID_TABLE NAMEGOESHERE] & "?a=q&qid=99&nv=1&v0=" & [Location No]
  • If you are just looking to provide a link to a scored or records off a a record, you can just use a report link field. You do not need a relationship to have a report link field.
  • Thanks. I was merely giving an option to users to open another form for the specific record they are on.  Can this be achieved if two tables are not linked yet they have a common field? 
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    If that common field is the key field then you can send them directly to that record and that specific form.  If it is not the key field you will have to do the query and then load that record to that form (might have to be another formula button.
  • Hi Mark,

    Is there a way to focus on a particular section after clicked on a button.

    It means after perform some tasks in a button then, user should foucs on the desired function.

    Thanks,

    Gaurav
    • MCFNeil's avatar
      MCFNeil
      Qrew Captain
      If they need to focus on One and ONLY One section, 
      You can copy the form, and remove all other elements.

      Then have the rdr send them to that form.  

      *Keep in mind you will need a way for them to get back to the main form after completing the task.

      **Also, keep in mind the more forms you get, the more maintenance that follows when things change.
    • GauravSharma3's avatar
      GauravSharma3
      Qrew Commander
      Hi Mathew,

      Thanks for your reply. Yeah. you are right. It will not make sense to create multiple forms. I am thinking as we do for back to top in HTML like <a href="#top">Go to top</a>

      So, if I know the id of a section then, I can easily make a focus on it. But how to use it...

      Thanks,
      Gaurav
    • GauravSharma3's avatar
      GauravSharma3
      Qrew Commander
      Mathew,

      Can you please look at my above query?

      Regards,
      Gaurav