skingjack2 Posted June 17, 2007 Posted June 17, 2007 Hello Newbie here. I've come across this set field expression in a script from the free FM Business productivity solution that I'm dissecting to learn more about FM (v8.5) The expression is "set field (customers::temp data, customers::fullname)"; can someone please take the time to explain exactly what this does ( tried googling). I know it has something to with a relationship dealing with the customers file but I have no field named temp data- where does this come from? Thanks to all that take the time to enlighten me =) Jack
Genx Posted June 17, 2007 Posted June 17, 2007 (edited) FM Business productivity solution that I'm dissecting to learn more about FM (v8.5) Hi Jack. Before I explain anything I would like you to know that the business productivity solution is not a good place to start if you want to learn about FM 8.5 -- It really only exhibits the features of FileMaker 6. FileMaker Intnl. never took the time to upgrade their files... Just hang around here a bit any you'll be fine In answer to your question: Set Field [ Customers::TempData ; Customers::FullName ] Does the following: It takes the value in the Customers table, in the FullName field, for the current record, and put's it into the field TempData (also in the customer's table). I.e. if Customers::FullName had the value "xyz" in it, the above would set the TempData field in the customers table for the current record to also be "xyz". Hope that helps Edited June 17, 2007 by Guest
comment Posted June 17, 2007 Posted June 17, 2007 It's the other way around, I'm afraid. A better explanation can be found in Help > Script steps > Fields script steps > Set Field script step.
Genx Posted June 17, 2007 Posted June 17, 2007 Ah, sorry!!! Tax law has a way of muddling things up in one's head. I've made the necessary mods to the explanation.
skingjack2 Posted June 22, 2007 Author Posted June 22, 2007 Genx/Comment, Much appreciated for the responses; I do believe I have the set field sort of figured out... Unfortunately it leads into the next line of the script I'm trying to dissect: (perform script ["create invoice" from file: "invoices 2"]) where I again run into a problem: the file "invoices 2" doesn't exist. I'm puzzled... any thoughts? If this is confusing, I'd be more than happy to post the complete script for your viewing. Thanks for your patience and assistance. Jack
skingjack2 Posted July 10, 2007 Author Posted July 10, 2007 Genx/Comment, After some time off to regroup, I think the best way to approach this project is to do as you suggest and start fresh rather than trying to modify the FM biz productivity solution to meet my needs (which are somewhat simple IMO); I believe the reliance on the FM solution is causing me more issues than necessary. I'll be posting a query in the appropriate forum outlining my goals and intended course of action to acheive them. Thanks to the both of you for your responses & patience. Jack
skingjack2 Posted August 12, 2007 Author Posted August 12, 2007 Hi Genx/Comment, I'm back to revisit this scripting option after doing some more reading. I was wondering if I could run a scenario by the both of you to see if I'm on the right track. Here is what I thinking... 2 dbs - 1 called clients, the other bookings (holding information related to travel reservations). They are related by contact ID. If I enter the contact ID in the bookings contact iD field, the pertinent info from the client db is returned i.e. address etc. If I didn't know the client ID, I could create a button/script in the bookings DB that jumps to the client db and performs the requested find to return the client ID. Now I'm thinking I could use a set field script in the client DB whereby the information in the contact id field is transferred to the contact id field in the bookings db. The syntax I believe would be: set field[bookings::contact ID; contact ID} where contact ID is the information contained in the client DB field "contact ID". Am I on the right track or is there an easier/more elegant way of finding out the client ID. Very receptive to suggestions =) Thanks for your time. Jack
Genx Posted August 12, 2007 Posted August 12, 2007 You're on the right track, but that Set Field wouldn't work because its not related to the client you're on any more than the client is related to the booking... it would be more like: /*1) Get The Criteria you need from the current Booking record you're on and store them in some variables so you can access them when you want to run your search*/ Set Variable[$CriteriaX ; Value: Bookings::FieldX ] Set Variable[$CriteriaY ; Value: Bookings::FieldY ] /*2)Go To Your Contacts Layout, Go Into find mode, and set the criteria equal to those we temporarily stored before in the variables*/ Go To Layout[Contacts] Enter Find Mode[] Set Field[ Contacts::FieldX ; $CriteriaX ] Set Field[ Contacts::FieldY ; $CriteriaY ] Perform Find[] /*3) Retrieve the contactId if the find was successful*/ Set Variable[$contactId ; Value: If( Get(LastError) = 0 ; Contact::ContactId)] /*4) Go back to whatever layout we were on before the Contacts layout... i.e. bookings*/ Go To Layout[original Layout] /*5) If we couldn't get the contact ID - display a message, otherwise set the ID field equal to the id we have stored in our variable*/ If[isEmpty($contactId) ] Show Custom Dialog[ Error ; No Matching Contact Could be found for this booking] Else Set Field[bookings::ContactId ; $contactId] End If Not entirely clear... but oh well. The question is really why your bookings aren't related to contacts in the first place I guess. See how you go, or post back with any questions you have about the above. Everything above surrounded by /* */ are explanations and not portions of the script. HTH
skingjack2 Posted August 12, 2007 Author Posted August 12, 2007 Genx, Fyi... the booking and client db are related- they're related via the contact id fields. I'll have to take a closer look at your suggestion; there are some new functions that I'm going to have read up on; time to hit the books again =) Be back soon...thanks for your help. jack
Genx Posted August 12, 2007 Posted August 12, 2007 Well technically, your bookings should either be assigned to contacts on creation, or created from contacts... parent...less bookings shouldn't exist -- so the question is, how is your contact selection working from bookings?
LaRetta Posted August 12, 2007 Posted August 12, 2007 I would mention a few things here ... [color:blue]/*1) Get The Criteria you need from the current Booking record you're on and store them in some variables so you can access them when you want to run your search*/ What could be in Bookings that would help in hunting up the proper Contact? Also, I would probably find the Contact BEFORE even creating the Booking record (but this is a process decision). Creating the booking record ahead of time might produce an orphan if the User (while hunting for the right Contact) gets side-tracked, answers a phone, goes to lunch etc and drops the ball at that point. Also, as with creating any order, I believe it's best to find the Contact first because, if User can't find the right Contact then they may need to create them! Meanwhile, a partically created Booking record can get lost in the shuffle. [color:blue]/*3) Retrieve the contactId if the find was successful*/ What if the wrong Contact is returned and a search needs to be refined? I would display the record and ask verification before returning with the ID and planting it into a new Booking record. Further, what if more than one Contact is returned? This is usually best handled by presenting a list of the found Contacts and letting the User select the correct one from there or, if only one, showing the detail record of that Contact and asking for confirmation, or creating a new Contact if no matches are found ... then return with the ContactID and create a booking. LaRetta
LaRetta Posted August 12, 2007 Posted August 12, 2007 While I was eating breakfast and responding, I see you've considered these issues, Alex. I'll leave my comments to add a bit of clarity. LaRetta
skingjack2 Posted August 12, 2007 Author Posted August 12, 2007 Laretta/Genx/Comment, Based on everybodys *much appreciated* responses to date, I've determined that the best avenue to resolve my problem is to first locate the client info in the client db and then transfer necessary info to bookings db rather than doing it backwards from the bookings db (and that was gist of my problem, I was uncertain as to which was the best method to proceed). Now that is resolved, my thoughts on the workflow is as follows: 1- using client db, determine if customer is exists or is new 2a- if customer exists, create a new booking with required info pulled from client db to bookings db 2b- if a new customer, create new customer profile in client db then create a new booking. As a model, I'm using the previously mentioned FM starter biz solution ( which apparently is not the greatest solution but appears to do what I need with some modifications) where in that solution you are able to create a new invoice from the client db (using the button on the tab menu). Where I envision the difference is that instead of creating an invoice, it would be modified to create a new record in the booking (and in turn, the booking db would have a button to create a new invoice in the sales db). So I would need 3 core dbs: client, bookings, and sales/invoices (obviously there are other dbs I can incorporate... vendors, phones etc but those are 3 main ones needed). Thanks to everybody for providing the clarity; now to dig in... hopefully everything will go much better now =) Jack
Genx Posted August 12, 2007 Posted August 12, 2007 Hi Jack, All you really have to do is create a new booking record and transfer over the client ID -- after that, all information from the related client is available to you.
skingjack2 Posted August 13, 2007 Author Posted August 13, 2007 Genx, Can you be specific...actually much more specific as to what you are suggesting? How would you suggest I implement what you propose? Thanks, Jack
Søren Dyhr Posted August 22, 2007 Posted August 22, 2007 Please Jack this is not to offend you in any way! I wish to make a poll here, it seems to me like the "FM Business Productivity" ...is to blame for at lot of the questions raised like this one. The marketing geniuses of FMInc. might perhaps on their lack of filemaker development skills, be of the impression that shortcut's to learning the tools utilization - exists. I have off forum recieved a synopsis/missionstatement along with some files, wearing clear evidence that hardly any of Genx and Comments drillings into the relational concepts have sunk in yet. Jack is not to blame here, TTT (things takes time) ...But shouldn't the use of the templates be more visible cautioned? In my opinion should it directly be said that, in order to use the productivity kit should you at least have fundamental knowledge to relational approaches and the inner workings of filemaker as development enviroment.
D.Santhosh Posted August 23, 2007 Posted August 23, 2007 Hi This is Santhosh from INDIA All of your Suggestions are really very nice. D.Santhosh :thumbup:
skingjack2 Posted October 23, 2007 Author Posted October 23, 2007 Genx, Back at trying to resolve this problem.I'm trying to do as you describe;no problem creating a script to create a new record in the booking table. However, I do have a question. What is the best way to transfer over the client id from contacts table to the booking db? Via a set field script or a simplistic copy/paste script? Jack
Genx Posted October 23, 2007 Posted October 23, 2007 Right Okay, I sympathize with you... you came back two months later lol. Given that FileMaker is still kind of hopeless when it comes to their samples, I've attached a very basic Booking example. It allows you to set up events and book clients for those events (from either the event side, or the client side). And never, ever copy and paste - it clutters the user's clip board unnecessarily. Hope it helps. db.zip
skingjack2 Posted October 23, 2007 Author Posted October 23, 2007 Genx/SD/LaRetta/Comment, I owe all of you an apology for my ignorance...big red face. Wasting everybodies time & electrons with needless inquiries (here and elsewhere on the forum). Why? Only tonight after reviewing this thread in depth (always help to print this stuff out), it is now obvious that Genx did in fact originally supply me with the clue to solve my problem (still outstanding but getting closer to resolving)in post 262798. I'll let you know how I make out. Jack
skingjack2 Posted October 23, 2007 Author Posted October 23, 2007 Genx, I did not refresh my screen and see your most recent post with the sample file. I'll delve into and dissect it. Much appreciated for the guidance! Jack P.S. of course, everybodys help is appreciated
Recommended Posts
This topic is 6243 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