How do I automatically link a time card to a Task, Project, and Customer without having to pick each from a dropdown?

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

I have the all the tables linked together via relationships and say so say you add a new time card from the Tasks table, the task name pulls over from the task but I still need to select the appropriate Customer and Project from their respective dropdowns to link it all together. Or add a Time card from the Projects table, it pulls the Project Name but not the Customer or a Task name. How do I set it up so if a Time Card is always created from the Task Table, it automatically sets the Customer and Projects to the right selection?

Photo of Chris_MCD

Chris_MCD

  • 0 Points

Posted 4 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 69,904 Points 50k badge 2x thumb
The Tasks table probably already has the fields [Related Project] and [Related Customer].  You can do lookups if those fields down to the Time Card Table and then


You can use a form rule which says
When Related Project is blank
Change Related Project to the value in the field [Task-Related Project]
Change Related Customer to the Value in the field [Task-Related Customer]

But you might consider simply changing the Relationship reference field to be those lookup fields instead of manukau choosing them.  One way to do that is to change their type to be formula numeric and make them formula fields equal to the lookup fields from the Task.
Photo of Chris_MCD

Chris_MCD

  • 0 Points
Thanks Mark. I actually did try the first option you provided and could not get it to work. I will have to try the 2nd one though. I didn't think to change the field type, that won't disrupt the relationship at all?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,904 Points 50k badge 2x thumb
No, it won't hurt the relationship, but in general if you are hesitant about changes, you can always make a copy of you app to do a quick test.

Another thing.  Why do you need to have those relationships at all?  You can simply lookup the customer and project from the Task down to the Time card. If you need to have an embedded report if time cards on the customer, you can use a Report link field without a relationship.

But a caution is that if you change the relationship to be based on a lookup field then you won't be able to make a Summary field in that relationship.

Going back to your post about my first suggestion not working, so the form rule did not fire?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,904 Points 50k badge 2x thumb
Chris,
I realized that I did it answer your question the best way.  You said that you are always going to launch the ADD Time Card entry off the Task.

The correct  and simple answer is to simply build that into your ADD Time entry button on he Task record.

URLRoot() & "db/" & [_DBID_TIME_RECORDS] & "?a=API_GenAddRecordForm&_fid_11=" & URLEncode ([Record ID#])
& "&_fid_21_=" & [Related Client]
& "&_fid_20_=" & [Related Project]
& "&z=" & Rurl()

The formula above put the value of the Task Record ID into field 11 which in this example would be the related Task field of the time record.  Then it also populated Related Client and Rekated Project into their correct Field IDs.

You get the field ID numbers off the usage tab if the field properties or you can turn on the field ID in the field list. Sorry for giving you less correct answers the first go around.
Photo of Chris_MCD

Chris_MCD

  • 0 Points
Sorry for the delayed response on this, just getting back into it. The relationships are needed for the use of the summary fields which are used for calculations on the multiple levels. I imagine those numbers could be derived from elsewhere but the relationships just make it more readily available I think.

In regards to your first suggestion, you are correct, the form rule did not fire. I tried it several different ways and could never get it to work. There is a fair chance I didn't do it right but none the less, I was looking or other options.
Photo of Chris_MCD

Chris_MCD

  • 0 Points
I like the idea behind this suggestion but I am still a novice when it comes to the usage of URL Formulas. I don't quite understand the formula you have here. Could you perhaps break it down into sections for me when you have a moment? If I'm no mistaken, you are saying I would create a URL-Formula field in my Tasks table and use this formula in that? From there I get lost...
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,904 Points 50k badge 2x thumb
I posted an app in the Exchange which gives a tutorial on URL formulas. How about if you go through that and then post back with Questions or contact me off line via the information in my profile for one on one assistance.

https://yqc.quickbase.com/db/main?a=AppDetail&ID=1803&app_name=URL%20Formula%20Buttons%20for%20Dummies%20v1