January 17, 201313 yr We have a database for our cabinet making business. For each estimate created, there can be several items costed (ie Kitchen, Laundry, Vanity). Each item is assigned an item ID (_pkItemID). There are two parts to the costing - time and materials. I want to be able to import a profile into the costing time section rather than having to enter each task in individually. So I have created a profile table - and created a template of task records that get used for costing time required to complete various tasks for each job. There is a global field called _fkItemID for the actual __pkItemID value to be pasted into prior to import. For some reason the script - which contains set variable is not working. Does anyone have any hints or tips for things i should be checking or changing? A screen grab of the script is attached (for some reason it would not copy and paste). Many thanks set variable.tiff
January 17, 201313 yr Author i think i've just sorted it myself. for some reason because multiple related records were showing in the found items it wasn't copying the variable id. when i added a step to filter to show just the one record - it worked!
January 17, 201313 yr I thought your Set Field line, should have been before the Perform Find so your GET(Foundcount) get to the one record,, after thought
January 18, 201313 yr Author The find is actually to to find the correct profile (general instead of kitchen or robe or other). I am having trouble with the set variable again. Not sure what i've done so that is not working now. when i tested the idea using copy and paste and it works, but obviously it would be preferable to perform the same function with set variable. any ideas?
January 23, 201313 yr me, In layout1 I set variables var1 to $x1 .... .var50 to $x50 in layout2 set field1 with $1 ...... set field50 with $50 Comit Records always works 4me, don't know about a copy paste i am fm11
January 23, 201313 yr I think you should write the script in such way. 1) Enter Find Mode 2) Set Variable 3) Perform Find B'coz we can only find for a value after entering the Find Mode, then perform Find.
January 23, 201313 yr If I follow your script correctly, you first set $itemID to the primary key of Estimate_ItemCosting. Your find is to locate a record in your Profile_TaskMaterials table. You have a portal view into Profile_TaskLI on the layout "Profile Tasks Form View in Admin" Your script takes you to the first record in the portal. It then does a set field step on the Profile_TaskLI::_fkItemID field. I think you are assuming that because you've selected that field in the portal row, then that is the field that gets updated by the set field step. This isn't necessarily so. Your script needs to change to a layout which has the context of Profile_TaskLI and is on the current record which is equivalent to the first record in the portal for this set field script to work reliably. You may be able to to this with a GTRR step from the Profile_TaskMaterials table to Profile_TaskLI matching the current record, then switching to a layout in the context of Profile_TaskLI, but without seeing the relationships I don't know whether this would work. Also, I don't know what the purpose of the Pause/Resume Script [indefinitely] is - does the user enter data at this point then press continue for the script to switch to the other portal for more data entry? HTH Brian
January 23, 201313 yr The advice from FMBUG is not valid. You do not enter find mode, then set a variable. This is backwards. If doing a scripted find, you set a variable; then enter find mode; then set the field to the variable; and then perform the find.
January 24, 201313 yr BruceR, yes, you are right. It was a mistake.., the right one is, 1) Set Variable 2) Enter Find mode 3) Set Field 4) Perform Find Thanks BruceR....
Create an account or sign in to comment