April 14, 200916 yr Hello all and thank you in advance... I am using FM 9.0 on Mac OSX. I have a database that contains a table "members." Each member on this table belongs to a group with a group name and group number. When I create a new member, and select the group number, everything works fine. When I import from XL, sicne there is no group number (or name) field on the spreadsheet, it doesnt import (makes sense). How do I get FM to assign a group number to that batch of contacts--there will be only one group number for each batch of contacts imported via an XL spreadsheet? I hope I have made myself clear. Thank you again!
April 14, 200916 yr You can ask the User to enter the Group number (using Custom Dialog) which is stored into a global field. Then the import would run and the actual GroupID field would then be set with the global GroupID after the import; similar to (untested pseudo-code) Show Custom Dialog [ Enter Group ID ; Input field: globalGroupID ] If [ IsEmpty ( globalGroupID ) ] Show Custom Dialog [ You did not enter a GroupID. Process will end" ] Half Script End If Set Error Capture [ On ] Import [ bla bla bla ] ... now you have your imported set isolated If [ not Get ( LastError ) ] Set Error Capture [ On ] Replace Field Contents [ GroupID ; globalGroupID ] If [ Get ( LastError ] Show Custom Dialog [ "Record is locked. Be sure every record in this found set receives the GroupID" ] End If End If Back up first before any new process particularly a script untested as this one is. UPDATE: I would also validate that the GroupID the User enters in the global is a valid group number. Edited April 15, 200916 yr by Guest Added update
April 15, 200916 yr Author SO now my newbie comes out...Can you please point me to where I can learn more about Custom Dialogs? Thank you! dp Edited April 15, 200916 yr by Guest
April 15, 200916 yr Custom Dialog is a script-step and you can find out about it by searching FM Help "Show Custom Dialog script step." You need a way to accept the GroupID from a User and then set the imported records with it. You could also just place the global field on a layout and attach a value list based upon GroupID (also displaying the group name as second field) and then only displaying second field. Use a pop-up menu so you wouldn't have to validate the entry.
April 15, 200916 yr Author Thank you! I just got a call from the HR people and the specs of this project have changed so I will now be getting the group number with all the other information! Thank you for your help. dp
Create an account or sign in to comment