iMarcW Posted May 9, 2003 Posted May 9, 2003 I've tried everything--how do I put a button inside a portal row that will insert contents of a field from that portal row (or the related record) into another field? No matter what row I click in, the button always pastes the data from row #1 of the portal.
Fitch Posted May 9, 2003 Posted May 9, 2003 If you put the button in the first row of the portal, you should see it on every row in Browse mode. With a script such as: Set Field [target, related::text] ... the related::text should go into the target field.
iMarcW Posted May 9, 2003 Author Posted May 9, 2003 I had the button showing up in every row, but no matter what row I clicked the button in, it always used the first row's data. Using Set Field, as you suggested, made it work correctly. I was using Insert Calculated Result, which for some reason makes no distinction as to what row is in use and just uses the first related record. The problem is, Set Field erases the previous contents. I want to be able to append the data to the field, which is why I was using Insert Calculated Result. Why do these two commands behave differently in the data they choose to use? Basically, I'm making a list of pieces of data from the different portal rows, which I pick and choose from the portal by clicking the buttons. When I'm done, this list is just a text field that can be edited any way I please. Maybe the workaround is to Set Field to an intermediate field and then insert the contents of that field to the target field.
Peter Fenner Posted May 9, 2003 Posted May 9, 2003 I don't know about your button problem but you can still use the set field script step. SetField[YourField, YourField & AppendedText] Your are setting the field as itself plus the appended text. Pete
LiveOak Posted May 10, 2003 Posted May 10, 2003 My guess is that "Insert Calculated Result", which depends upon the destination field being visible on the layout, "clicks into the destination field" upon execution and thus loses the context of which portal row you were on. Kind of like clicking out of the portal row and into the destination field manually. Set Field is a much better choice in general, as it doesn't require the destination field to be visible on a layout and doesn't use the clipboard (as Copy and Paste do). -bd
iMarcW Posted May 10, 2003 Author Posted May 10, 2003 That makes sense, LiveOak. And I forgot that I can use the field contents as a variable in the SetField calculation. All is well.
Recommended Posts
This topic is 7855 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