AnsweredAssumed Answered

Issue with Dynamically setting Portal Filter

Question asked by rhearob on Sep 28, 2018
Latest reply on Sep 28, 2018 by rhearob

Hello Experts and Friends,

 

This is a bit of a noob question - so please be gentle.  This is my return to Filemaker after a 20 year absence. 

 

I am building a small enterprise management app for a wholesale/retail food business.  As a part of that the user is able to enter sales orders with delivery schedules for the wholesale business portion.  I have developed a tabbed screen with the sales order items and the sales order schedules on two different tabs.  I have put a button in the sales order items portal to allow the user to navigate directly to the schedules tab and begin entering delivery schedules.  Screen shots of these two screens below:

 

 

 

Screen Shot 2018-09-28 at 2.55.59 PM.pngScreen Shot 2018-09-28 at 2.57.33 PM.png

 

I have simple code on the sales order item portal that populates global variables with the sales order number and the sales order item number.  Code Below:

 

Screen Shot 2018-09-28 at 3.02.19 PM.png

 

I have tried this code as part of the button click, on row enter, and on row exit.  In debug it actually executes flawlessly in any of the three places.  When the user clicks the plus button on the line, the following code executes:

 

Screen Shot 2018-09-28 at 3.04.14 PM.png

 

The filter calculation in the portal is as follows:

 

The table relationships are as follows (note there is only 1 occurrence of each of the sales order tables):

 

Screen Shot 2018-09-28 at 3.07.03 PM.png

 

Now with all of the data out of the way - What is occurring is that no matter what Item the user selects, or the value of the $$item variable - the Sales Order Item of the third item on in the Sales Order Items table is used to create new records in the table.  Both in debugger, and when I add $$item as a merge variable on my layout, the value is the correct item the user selected, but it is not used when the portal record is created. 

 

I had thought maybe I was running into a record pointer issue with the sales order item table, so tried this variation in my button script - with no impact.

 

Screen Shot 2018-09-28 at 3.03.51 PM.png

 

Any ideas FM experts?  I know this is a common issue, I have combed the forums looking for anything that would help with no luck.

Outcomes