Quartekoen Posted September 17, 2008 Posted September 17, 2008 Here's the scenario. I have an item database that has the tables ITEM and POTENTIALITEMS. There is a button on the POTENTIALITEMS layout that will turn a potential item into an item. This isn't so much a problem as it is an annoyance. The fields from POTENTIALITEMS need to be copies to ITEMS, but the layouts are not identical. This prevents me from using the "Go to Next Field" script step. Also, I'd like to avoid having a column of 40 - 50 "Set Field" steps on there. What I really want to do is have a simple variable in my script with a Carriage-return seperated list of the fields that need to be filled, in order (e.g. itemnum¶description¶upc¶weight, etc...). Then, I would have a MiddleValues Script step simply pull out what field it needs to go to next, so it would be something like Set Field[ MiddleValues ( $fieldlist ; $iteration ; 1 ) ; $thatFieldsValue] The problem is that I can't figure out how to go to a specific field by calculation. I've tried naming the fields in the Object Info, but I doesn't seem like I can select the field itself. Is this even possible? Thanks.
comment Posted September 17, 2008 Posted September 17, 2008 It's not possible to specify the target field for Set Field[] by calculation. Go to Next Field[] goes to the next field in the layout's order tab order - and you can change the tab order. Go to Object[] CAN select a field, and if followed by Set Field[] with no target field specified, the currently active field will be set. Or you could just import your potential item into the Items table. Or keep them in the same table and just toggle a status field.
Newbies duqf95a Posted April 16, 2011 Newbies Posted April 16, 2011 It's not possible to specify the target field for Set Field[] by calculation. Go to Next Field[] goes to the next field in the layout's order tab order - and you can change the tab order. Go to Object[] CAN select a field, and if followed by Set Field[] with no target field specified, the currently active field will be set. Or you could just import your potential item into the Items table. Or keep them in the same table and just toggle a status field. FYI, using Set Field[] with no target field specified does NOT work; it returns an error 5, "Command is invalid (for example, a Set Field script step does not have a calculation specified." It sure would be nice to calculate the field name... It's allowed elsewhere, I don't understand why FM is inconsistent like that.
comment Posted April 16, 2011 Posted April 16, 2011 FYI, using Set Field[] with no target field specified does NOT work; it returns an error 5 I am afraid you are very much mistaken about this: "If no field is specified and a field is selected in Browse mode or Find mode, that field is used." http://www.filemaker.com/11help/html/scripts_ref1.36.39.html#1029024 If no field is specified and no field is selected, the error returned will be 102 (Field is missing). It sure would be nice to calculate the field name... This is an old thread, dating before version 10 (January 2009) introduced the Set Field By Name[] script step.
bruceR Posted April 17, 2011 Posted April 17, 2011 Here's the scenario. I have an item database that has the tables ITEM and POTENTIALITEMS. There is a button on the POTENTIALITEMS layout that will turn a potential item into an item. This isn't so much a problem as it is an annoyance. The fields from POTENTIALITEMS need to be copies to ITEMS, but the layouts are not identical. This prevents me from using the "Go to Next Field" script step. Also, I'd like to avoid having a column of 40 - 50 "Set Field" steps on there. What I really want to do is have a simple variable in my script with a Carriage-return seperated list of the fields that need to be filled, in order (e.g. itemnum¶description¶upc¶weight, etc...). Then, I would have a MiddleValues Script step simply pull out what field it needs to go to next, so it would be something like Set Field[ MiddleValues ( $fieldlist ; $iteration ; 1 ) ; $thatFieldsValue] The problem is that I can't figure out how to go to a specific field by calculation. I've tried naming the fields in the Object Info, but I doesn't seem like I can select the field itself. Is this even possible? Thanks. Easy with AppleScript.
Recommended Posts
This topic is 5310 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 accountSign in
Already have an account? Sign in here.
Sign In Now