Mark Reed Posted June 17, 2010 Posted June 17, 2010 I am certain this is something basic, but for some reason my brain is just not connecting this morning... My scenario is this: POHEAD POLINE POREL POCOMP are tables They are related linearly - POHEAD is linked to POLINE using one field - ponum POLINE is lined to POREL using two fields - ponum and poline POREL is linked to POCOMP using three fields - ponum, poline, and jobnum so you have [POHEAD] -- [POLINE] -- [POREL] -- [POCOMP] I have a status field on each of those tables. What I would like to do is have a button on the layout for the POHEAD data that when clicked, sets every status field to CLOSED on all four tables where the PONUM is the same. Does anyone have a sample script or some advice on how to accomplish this?
Mark Reed Posted June 18, 2010 Author Posted June 18, 2010 I still cannot get this working properly - any have any examples or tutorial links?
Mark Reed Posted June 21, 2010 Author Posted June 21, 2010 Here is a copy of my rough framework. I have a ton of work still left on it - but to go further, I need to find a way to create a CLOSE PO function and have it close all the associated records for that PO on the other tables. Import_Tracking_DB.zip
TheTominator Posted June 21, 2010 Posted June 21, 2010 How about... Button on POHEAD layout to Close Set Field[POHEAD::RecordStatus] = "Close" Go to Related Records in table POLINE If(Get(LastError)=0) Replace Field Contents[POLine::POLineRecordStatus] with "Close" End If Go to Layout[POHEAD] Go to Related Records in table POReleases If(Get(LastError)=0) Replace Field Contents[POReleases::PORelRecordStatus] with "Close" End If Go to Layout[POHEAD] Go to Related Records in table POReleases If(Get(LastError)=0) Replace Field Contents[POReleases::PORelRecordStatus] with "Close" End If Go to Layout[POHEAD] Go to Related Records in table POComponents If(Get(LastError)=0) Replace Field Contents[POComponents::POCompRecordStatus] with "Close" End If
Mark Reed Posted June 22, 2010 Author Posted June 22, 2010 thanks! that works like a charm. I was trying to make it too complex with loops and record counts, ect... I didnt even think of using an error to move on to the next one. thank you VERY much.
Recommended Posts
This topic is 5269 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now