Jump to content
Sign in to follow this  
Gismo12

Set Variable / Set Field

Recommended Posts

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.

image.png.4287f42f6ab411d7e903ec41617ebd4f.png

Script: image.png.9dab1dba1eb947c7cbfdc9c829db2b00.png

The New Customer / Aircraft Layout opens from TBL Customer_Aircraft but no Customer Id is set.

image.png.23cf0280d4a208124ca9cf2ad9671eee.png

Please could you tell me where I am going wrong?

Relationship is one to many

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

 

Share this post


Link to post
Share on other sites

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:

image.png.f44dfb297609ca44a5d56b7b41cc60a3.png

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

 

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.