February 13, 200620 yr Hello ALL: Q: How to write the script on FM pro7 to log a record from TABLE1 to TABLE2 w/ a new record_ID. OK, here is my case: ==================== I have a FM pro7 file called DoorAccess Management which has two table: DoorAcces and DoorAccessLog. Both Table has ID, Key#, AccessLevel, Employee. Once the Door key was assignned to other Employee, I will like to log the old record w/ old employee name to DoorAccessLog table. How to do so? Thank you for help.
February 16, 200619 yr Author Hello there: Yes, I am using the import function. but the script seems has problem. The script is logging all the record(s). Well, all I need to do is logging the current openning record. OK, here is the content of the script. Go to Layout ["Form View - Log" (DoorAccess Management)] Import Records [No dialog; "DoorAccess Management.fp7"; Add; Windows ANSI] So, where can I assign it to import the current reord? (The only one record to import.)
February 16, 200619 yr Hi Charlih, To import only one record, you must first isolate it in DoorAccess (from all the other records). Imports always pull an entire record set so you need a found set of ONE. Then when you go to your Form (in DoorAccess Log) and perform your import, only the one record will import. Envision this please and see if it might work for you - script activates on DoorAccess form which 'moves' the old Employee to the Log as follows: Freeze Window Loop Show All Records Omit Record Show Omitted Only Exit Loop If [ Get(FoundCount) = 1 ] End Loop Go To Layout [ "Form View - Log" (DoorAccess Log) ] Import Records [ No Dialog ; "DoorAccess Management.fp7" ; Add ; Windows ANSI ] Show All Records Go To Layout [ original layout ] Show All Records This will leave you back on your DoorAccess layout on the same record. You can then finish your script by changing it to the new Employee. Your SOURCE would be DoorAccess (after you specify DoorAccess Management.fp7) and your DESTINATION will be your DoorAccess Log table. The loop is to protect in case of multi-user solution. UPDATE: Oh ... I REALLY tried to let it go but there are probably easier ways to move/create only one record other than import and I feel obligated to mention it. But since I didn't know your structure, and since you seemed already 'in to' the import idea, I didn't want to write volumes (smile) or add confusion to the mix. You already KNOW how to do the import and it should work for you just fine. LaRetta Edited February 16, 200619 yr by Guest Added Update
Create an account or sign in to comment