rkass068 Posted July 22, 2013 Posted July 22, 2013 Hi, I have a bunch of portals with a delete portal row button and it works fine. I am just wondering if there is a script set in FM where the portal row I want to delete gets highlighted so I know if I clicked the correct "x" button to delete the portal row? Thanks
eos Posted July 22, 2013 Posted July 22, 2013 You obviously want to combine this with a confirmation dialog (if you haven't already done so); otherwise the row gets briefly highlighted, then it's gone anyway … You can conditionally format one or more fields in the portal row (not the row per se, alas) with a condition like $$selected = portalTO::keyField; then write a script like … Set Variable [ $$selected ; portalTO::keyField ] // triggers CF highlighting Refresh Window Show Custom Dialog [ "Really delete?" ; "bla bla"; "Yes" ; "No" ] If ( Get ( LastMessageChoice] // if delete button was pressed Delete Portal Row [No dialog] End If Set Variable [ $$selected ; "" ] Commit Record Alternatively (or additionally), capture the name of the row (whatever identifies the record best) and display it in the dialog box.
rkass068 Posted July 24, 2013 Author Posted July 24, 2013 You obviously want to combine this with a confirmation dialog (if you haven't already done so); otherwise the row gets briefly highlighted, then it's gone anyway … You can conditionally format one or more fields in the portal row (not the row per se, alas) with a condition like $$selected = portalTO::keyField; then write a script like … Set Variable [ $$selected ; portalTO::keyField ] // triggers CF highlighting Refresh Window Show Custom Dialog [ "Really delete?" ; "bla bla"; "Yes" ; "No" ] If ( Get ( LastMessageChoice] // if delete button was pressed Delete Portal Row [No dialog] End If Set Variable [ $$selected ; "" ] Commit Record Alternatively (or additionally), capture the name of the row (whatever identifies the record best) and display it in the dialog box. Actually I think the second way would be better. For example, Because each portal row begins with the field "date" I can maybe capture the date and insert it in the dialogue. Do you know the easiest way I can do that? Oh its ok I figured it out using a script parameter thanks!
eos Posted July 24, 2013 Posted July 24, 2013 Actually I think the second way would be better. For example, Because each portal row begins with the field "date" I can maybe capture the date and insert it in the dialogue. Do you know the easiest way I can do that? Oh its ok I figured it out using a script parameter thanks! Not sure how a Script Parameter would help when clicking on an arbitrary field…? Just capture the necessary data from the portal row: Set Variable [ $myDate ; GetAsText ( portalTO::myDateField ) ] // the date you want to display Show Custom Dialog [ "Delete " & $myDate & "?" ; "Really delete record from date " & $myDate & "?" ; "Yes" ; "No" ] // use date in dialog If ( Get ( LastMessageChoice] // if delete button was pressed Delete Portal Row [No dialog] End If You can also use portalTO::myDateField directly in the calculation for the dialog box, but IMO this style is a bit clearer.
Recommended Posts
This topic is 4139 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