May 7, 200718 yr Hi, I want to make a button that will open a second window, add a new record, but place the current record (from first window)'s ID in a field. It tried to script it using the SET FIELD,... with field::fieldID, but it doesn't work, can anyone help me out? Basically I am trying to avoid turning the create records in portal situation. lj
May 7, 200718 yr the button above the portal would be "Add Line Item" and would: Set field (globalfield to current records's id) New Window Go to Layout (layout based on table occurrence for the line items) New Record Set foreign key field to globalfield Are you showing the user a popup where they enter the line item info?
May 7, 200718 yr Author Yeah, I wanted to make a popup window when they click the "add line item" button. I'll try to do what you suggested (if I can figure it out). I'll let you know in a few... thanks!
May 7, 200718 yr Author Worked like a charm! My question now is, why didn't my way worked? I tried basically same thing... does it have something to do with the way a global field works? I just tried to set field foreign key = primary key of 1st table, but it was a no go... You suggest the same thing except by transfering the primary key to the global field and it works! must have to do with globals! Thanks Very Much!!! Lonesomejubilee
May 7, 200718 yr Yours didn't work because when you open the new window, the context changes, and from the new window, FM doesn't know what value to use. BTW, you can set up your button to pass the ID as a script parameter, and not use a global field. Your script then might be: If [get(ScriptParameter <> "" /* prevents empty record creation */] New Window Go To Layout["My Layout"] New Record [] Set Field [iD, Get(Scriptparameter] Commit Record[] End if David
Create an account or sign in to comment