4Justme2 Posted July 5, 2012 Posted July 5, 2012 Just realized I posted this to the wrong forum. Please disregard here... and I'll repost under scripting. Thanks... mp I have two linked tables (one is my context... the other a portal placed on the context table). I simply want to be able to click a button to create a new portal row. I have looked everywhere for the problem… spelling, relationships, etc…. The script creates the new record but never sets the field with the __ID_PEO_pk ... I'm hoping it's glaringly obvious to someone out there what I might be doing wrong because I'm at my wits end... Tables: PTO_PEOPLE (context layout) __ID_PEO_pk Name PTO_STATUS_lineItems_j (portal) __StatusID_pk __ID_PEO_fk type I’ve linked The tables by primary key __ID_PEO_pk from the PTO_PEOPLE table to __StatusID_pk, the foreign key in the PTO_STATUS_LineItems_j Here's my Script: Set Variable [$PEO; Value:PTO_PEOPLE::__ID_PEO_pk] Go to Layout [PTO_STATUS_LineItems_j”(PTO_STATUS_LineItems_j)] New Record/Request Set Field [PTO_STATUS_LineItems_j:__ID_PEO_fk; $PEO] Commit Records/Requests [skip data entry validation; No dialog] Set Variable [$statusID; Value:PTO_STATUS_LineItems_j::__StatusID_pk] Go to Layout [original layout] Go to Portal Row [select; First] Go to Field [status_LineItems_j::date]
4Justme2 Posted July 5, 2012 Author Posted July 5, 2012 I have two linked tables (one is my context... the other a portal placed on the context table). I simply want to be able to click a button to create a new portal row. I have looked everywhere for the problem… spelling, relationships, etc…. The script creates the new record but never sets the field with the __ID_PEO_pk ... I'm hoping it's glaringly obvious to someone out there what I might be doing wrong because I'm at my wits end... Tables: PTO_PEOPLE (context layout) __ID_PEO_pk Name PTO_STATUS_lineItems_j (portal) __StatusID_pk __ID_PEO_fk type I’ve linked The tables by primary key __ID_PEO_pk from the PTO_PEOPLE table to __StatusID_pk, the foreign key in the PTO_STATUS_LineItems_j Here's my Script: Set Variable [$PEO; Value:PTO_PEOPLE::__ID_PEO_pk] Go to Layout [PTO_STATUS_LineItems_j”(PTO_STATUS_LineItems_j)] New Record/Request Set Field [PTO_STATUS_LineItems_j:__ID_PEO_fk; $PEO] Commit Records/Requests [skip data entry validation; No dialog] Set Variable [$statusID; Value:PTO_STATUS_LineItems_j::__StatusID_pk] Go to Layout [original layout] Go to Portal Row [select; First] Go to Field [status_LineItems_j::date]
comment Posted July 5, 2012 Posted July 5, 2012 Here's my Script: Set Variable [$PEO; Value:PTO_PEOPLE::__ID_PEO_pk] Go to Layout [PTO_STATUS_LineItems_j”(PTO_STATUS_LineItems_j)] New Record/Request Set Field [PTO_STATUS_LineItems_j:__ID_PEO_fk; $PEO] Commit Records/Requests [skip data entry validation; No dialog] Set Variable [$statusID; Value:PTO_STATUS_LineItems_j::__StatusID_pk] Go to Layout [original layout] Go to Portal Row [select; First] Go to Field [status_LineItems_j::date] That can't be an exact copy of your script. can it?
comment Posted July 5, 2012 Posted July 5, 2012 Just realized I posted this to the wrong forum. Please disregard here... and I'll repost under scripting. Thanks... mp Please don't do that (double-post) - let the moderators move the thread, if necessary.
4Justme2 Posted July 6, 2012 Author Posted July 6, 2012 Try this Thank you Kris.... that really simplified things for me--I appreciate. I have merged your two topics. Thank you Lee (I'll remember that next time).... :hmm:
Kris M Posted July 6, 2012 Posted July 6, 2012 Just a suggestion you might want to rethink your Table/TO/Field naming conventions as its not a best practice to start a fieldname with underscore anymore. Looks nice in sort order but i think it causes other problems with 12. It's 6 am here and i don't remember why but remember hearing about it.
bcooney Posted July 6, 2012 Posted July 6, 2012 http://www.filemakerhacks.com/?p=4924 underscores aren't ExecuteSQL friendly if first character, apparently. Wrap in quotes.
Recommended Posts
This topic is 4523 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