Hi all,
I have a card page which is linked to some header table, and in the card page, two subpages (both listparts) - one is a lines page (lines of header) and the other is some item page (individual items of the line). So all three tables/parts work together in some way. What I am trying to do seems very simple but for some reason it is causing me so many headaches.. Simply put, when entering a new record in the item subpage, it should automatically enter in the line no. in a field in item page of the current selected line. This same functionality works when entering a new line record. It automatically pulls the header No. into a field in the new line rec. So with the items, this doesn't happen and instead I get this message when clicking on a new line:
This message makes sense as the item records shown should only be linked to the specific line selected but I'm not sure how to solve this. The easy solution is to have this filter message present until a user manually enters in the correct line no., but the issue is that I want to hide that field and automatically do it. Another solution I thought would be to pass a variable between subpages and that is my main focus now (unless someone could explain how to make it so it automatically fills in via normal nav functionality). So I'm now at the point where when any line is selected I want to call a function in the item page to set the line no... This also causes me many issues as I'd like to simply call the function from the page, but it calls the function of another item list instance (since I just made a variable of type page - subtype: item page). So another thought would be to get the correct instance but that also gives me issues as you cannot re-set a page variable in code (/assignment of this variable is not allowed/).
So.. I have it so there is a function in the card page which passes the item page instance to the line subpage which passes the selected line rec by calling the function of the passed argument. The issue with this is I need to call the card page function from the line subpage after selecting a record, but how can I get the correct card page instance to accomplish this? It would be nice to just call a function to set the instance to some variable but it doesn't seem possible, and even calling a getter function to get the instance doesn't seem possible....
Sorry this was so much, please help..
Thanks