November 29, 20187 yr Hi All, I have some issues with Set Variable / Set Field. From the Customer TBL - New Customer Layout, I create a new Customer Name. Customer_Id created auto. Script: The New Customer / Aircraft Layout opens from TBL Customer_Aircraft but no Customer Id is set. Please could you tell me where I am going wrong? Relationship is one to many
November 29, 20187 yr Line 4 in your script is your problem. You create a new record and (probably) have the customer id field auto create a customer id, but in line 4 you clear it.
November 30, 20187 yr Author Hi, The customer Id in the TBL Customer_Aircraft is not a auto create field. Doesn't set variable copy the Id in the customer tbl and set field past it in the TBL customer_Aircraft ID field? If I dont set the ID in the Customer_Aircraft field, how will I relate to the ID created in the Customer TBL?
November 30, 20187 yr No, your not setting the field Customer_Aircraft::Customer_id with the value of the "$save customer id" variable. Line 4 where you do a set field, you set the field to nothing. Click on the cog of the set field and in the calculated field specify the variable "$save customer id". This is what that line should look like:
November 30, 20187 yr Learn to use the debugger to step through scripts line by line, and use the data viewer to watch fields and variables change values. Or in this case, not.
November 30, 20187 yr Author Do you need the actual Customer Id control in the layout to set the variable? I dont want to display the customer id number. on a different topic, when I go to the new customer layout, the customer ID is set to auto. the customer ID does not display. but when I go to edit mode and back to browse mode, the auto Id does display. When I open the new customer layout, enter the customer name, without the display of the customer number, the set variable / set field does not work. if i do go to new customer, edit mode then back to browse mode, the customer id shows and then the set variable / set field works well any suggestions?
December 2, 20187 yr On 11/30/2018 at 11:40 PM, Gismo12 said: Do you need the actual Customer Id control in the layout to set the variable? No you don't. On 11/30/2018 at 11:40 PM, Gismo12 said: I dont want to display the customer id number. on a different topic, when I go to the new customer layout, the customer ID is set to auto. the customer ID does not display. but when I go to edit mode and back to browse mode, the auto Id does display. When I open the new customer layout, enter the customer name, without the display of the customer number, the set variable / set field does not work. if i do go to new customer, edit mode then back to browse mode, the customer id shows and then the set variable / set field works well any suggestions? It sounds like you're record is not actually created in which case your customerid will have no value. When you go to edit mode FM saves the record, and so when you go back into browse mode, the record is there including a value in customerid. I can't tell you how to fix it as I have no idea what your scripts/layouts look like.
Create an account or sign in to comment