Jim_Shelton Posted April 10, 2008 Share Posted April 10, 2008 Okay its not working and I'm frustrated. Most likely something small. I have a table Jobs, with field job number and job name, etc. I need to recored charges made against each job. There could be numerous entries. I thought to set up a new table, Charges, but when I go to that layout, create New Record, and set field Charges::Job Number is Job::Job Number, it does not work. JIm Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted April 10, 2008 Share Posted April 10, 2008 How could it know which of the myriad existing Job records is the one you want to obtain a Job Number from? You have to have a valid relationship FIRST in order to set the field in ONE table to the value of a field in ANOTHER table. You can't say "Set the key field that will connect this table to that table to the value that it would have in it already if it was already related to a record in that other table" Quote Link to comment Share on other sites More sharing options...
Jim_Shelton Posted April 10, 2008 Author Share Posted April 10, 2008 Okay, I have set up a relationship between Jobs and Charges tables. It tells me the tables are related. The only way I can set the job number from Jobs to Charges is to create new record in Jobs first. So something is still amiss. Script looks like: Go to Layout (Job Charges (Charges)) Set Field (Charges::Job Number; Jobs::Job Number)) New Record Request Relationship is Charges::_Kf_JobID = Job::_KP_JobID thanks Jiim Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted April 10, 2008 Share Posted April 10, 2008 Set Variable [$JobNum, Job::_KP_JobID] Go to Layout [Job Charges] New Record/Request Set Field [Charges::_Kf_JobID; $JobNum] Go to Layout [original layout] Quote Link to comment Share on other sites More sharing options...
Databasic Posted April 11, 2008 Share Posted April 11, 2008 Hello Jim Why do you need a script for this - I assume you allocate charges to the Job after the job has been created via the Job number - so a drop down value list of Job:Kp_JobID in the Charges::Kf_JobID field will allow you to allocate the correct job number in the charges allocation layout. Then you could have a portal on the jobs layout showing/listing the related charges allocated to the particular job. Quote Link to comment Share on other sites More sharing options...
Jim_Shelton Posted April 11, 2008 Author Share Posted April 11, 2008 You are correct. There are no charges until the job is active. I am not sure I follow the drop down as to how it would work. I will work with it. I know the users recording the charges would not scroll through a list of all open jobs. thanks to you and Hunter on the information. jim Quote Link to comment Share on other sites More sharing options...
Databasic Posted April 12, 2008 Share Posted April 12, 2008 Well Jim another approach is to place a portal based on the Charges table on the Jobs layout and allow the creation of records in the charges table via that portal - but that still requires the user to find the correct job record - which you have to do at some point because, as Alan pointed out, how will you tell Fm which job to allocate the charge too? Quote Link to comment Share on other sites More sharing options...
Jim_Shelton Posted April 13, 2008 Author Share Posted April 13, 2008 I am trying a portal, the users will be at a layout that displays Jobs::Job Number. I guess I will still need to set field within the portal, so the job number is attached to the charge record. Jim Quote Link to comment Share on other sites More sharing options...
Jim_Shelton Posted April 14, 2008 Author Share Posted April 14, 2008 Good morning, I have a user testing what I worked up. My testing work fine. Thanks for all the assistance Jim Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.