You might want to research those script steps in FIleMaker Help or some training materials.
Try it this way:
Set Variable[ $Customer_ID; Value:customer::XCustomer_FK ]
Go To Layout[ : “WIP”(WIP) ]
Set Field [ WIP::XCustomer_FK ; $Customer_ID ]
Go To Layout [Original Layout ]
I have really tried a lot to make this work, and it seems easy enough, but mine is just not working.
Using the above script you suggested, takes me to the WIP layout and adds a record in the WIP, but I can't get that record to to show up in the portal on in the customer table... so on the customer table you're only alowed to see the WIP records belonging to the customer...
Then either your script or the portal's set up/relationship is not correct. You can post an exact listing of your script here for others to check and you can check to see what match fields and/or portal filter you've set up for your portal to make sure that the customer ID value that the script enters into each new record is what is being used as the match field and that it's not being excluded by a portal filter..
To post a script to the forum:
- You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
- If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
- If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
Really appreciate the help in here, since im not the most experienced in filemaker.
So far i got my relationship set up as attched screen shot.
and my script is looking like this:
Set Variable [ $Customer_ID; Value:customer::XCustomer_FK ]
Go to Layout [ “WIP” (WIP) ]
Set Field [ WIP::XCustomer_FK; $Customer_ID ]
Go to Layout [ “WIP” (WIP) ]
My problem is the WIP record relating to the customer dosen't show up in the portal added onto the customer table. In portal setup the portal is set showing related records from WIP and filter portals with the folowing calculation: customer::Customer Name = WIP::company.
Your script has a problem. The two go to layout script steps should not be identical.
What layout are you "on" when you perform this script? Which of the Tutorial: What are Table Occurrences? boxes shown in your screen shot is selected in Layout Setup | Show Records From for that layout?
The script it run when hitting a button on the in the customer table - where the portal also is placed where the infor from WIP should show up.
"Layout Setup | Show Records From for that layout?" - do you mean portal setup..? The table thats selected in my portal setup is WIP.
I mean layout setup for the layout where you placed the portal. From your answer, it appears that it specifies an occurrence of your Customer table. But what exact text to do you see in that drop down? If it specifes the right table, wrong Tutorial: What are Table Occurrences?, it could explain why this isn't working.
If so, then the second go to layout step is not returning you to the original layout from where you originally performed this script.
On the layout where the portal is placed are showing records from "customer" is that wrong..?
Then, from what I see in your screen shot of table occurrences and relationships, your script should look like this:
Set Variable[ $Customer_ID; Value:customer::XCustomer_ID ]
Go to Layout[ “WIP” (WIP) ]
Set Field[ WIP::XCustomer_FK; $Customer_ID ]
Go to Layout[ “Customer” (Customer) ]----> or you can use: Go to Layout [ Original Layout ]
got it - it works...
Is there a quick way in the script that can be added so Customer::Client = WIP::Company. So basicly the client name on the customer layout will automatically be on the WIP layout...?
Simply use the field tool to add the name field from the customer table to your WIP layout.
Sorry was not thining, works.. thank you so much