October 14, 201015 yr I have a Project Number which is currently set as a serial number. I have a Task Number which needs to increase by one until the Project Number changes. Example: Project Number - Task Number 7100 - 1 7100 - 2 7101 - 1 7101 - 2 7101 - 3 7102 - 1 thanks, Jim
October 15, 201015 yr Not sure I understand. Do you have two tables, Projects and Tasks (and maybe a join table btw them)? Can you tell us why you need this? Is this a sort order?
October 15, 201015 yr Author I have Project Table and Task Table that are related as Project:__KP_ProjectID to Task::__kf_ProjectID. Each project has a unique serial number as project number. I need to show a Task Count number for each project. So when project number changes my thought was to have Task Count number start over at one. Jim
October 15, 201015 yr Can a Task be associated with more than one project? What is a Task Count number? Is it simply a numbered list of tasks? That can be done with the @@ symbol on a layout.
October 15, 201015 yr Author A Task can only be associated with one project. By Task Count I mean Task Number. Another words if the Task Number is 3, then it is the third task under that project. Does that help explain what I am looking for? Jim
October 15, 201015 yr I would store the highest project number. When a new project/task pair is being created, for either existing or new project (I assume you already have a way to create a new project and increment the project number), compare the newly created project number to the stored number. If the newly created project number is greater than the stored number; increment the stored number by 1, and set the project's task number to 1. If the newly created project number is less than or equal to the stored number (you may be adding a task to a previous project); just increment that project's task number by one and leave the stored value alone.
October 15, 201015 yr There are many ways for your technique to fail, least of which is record lock with multi-user access and deletion of projects.
October 15, 201015 yr I wouldn't go this route. Let the key field for tasks be a meaningless auto-enter serial number. In the portal of tasks on the project form, simply add a sort order field. This demo from "comment" shows how to elegantly arrange rows in a portal. http://fmforums.com/forum/showpost.php?post/294075/ Edited October 15, 201015 yr by Guest
Create an account or sign in to comment