Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 5233 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hi,

First please accept my apologies if this has been asked before, but I can't seem to find an answer to my specific problem.

Within my database if have a "Jobs" table and a "Tasks" table. When a user inputs a Task, they select a job name, and cost, and the task gets sorted by ID into a portal in the relevant Jobs record.

What I'd like to be able to do, is to calculate the total cost of all tasks completed for a particular Job and display the result in a field on the Jobs layout.

Is this possible? I have attached a erd of my tables.

Hope this all makes sense,

Best wishes and thanks

ERD_JOB_TASK_copy2.jpg

Posted

Create a calc field in Jobs, TotalCost = sum ( jobs_Task::Cost).

"When a user inputs a Task, they select a job name"

Hope that's not the case. They should be selecting a JobID!

You can avoid the user needing to select a JobID if you create a new task from the Job Form.

On Job Form layout

Button: New Task

Set $jobID; Jobs::pkJobID

Go to Layout Task Form

New Record

Set Tasks::fkJobID; $jobID

  • Newbies
Posted

Thanks for the quick reply! The solution was obvious, sorry. I didn't realise that Filemaker would auto calculate records that had the correct ID.

Yes, you're right, they select the Job ID. Actually I'm using the popup select script that you wrote to select the ID :-)

I think I had a reason for not wanting to create new Task records directly from the Job layout, but I can't remember what it was now. I guess I can have both.

Thanks Again!

This topic is 5233 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.