imoree Posted August 31, 2011 Posted August 31, 2011 Just asking a general question about portal behavior. I have a portal and i had put an "X" to delete records but this was put in my Orders table. The portal was based on my Line Items table So this is what i noticed. If i use the icon from the orders table this is the effect: What i did was create a new field in my lineitems table to lookup the orders trash "X". and i get this: I would like to know why i get the undesired repeating field when i think it shouldnt matter? thanks
Vaughan Posted August 31, 2011 Posted August 31, 2011 The relationship the portal is based on is set to allow the creation of related records. This produces the blank row at the bottom.
efen Posted August 31, 2011 Posted August 31, 2011 Doesn't answer your specific question but is related to it ... If required, you can create a conditional delete button that will not show in the portal (with auto creation enabled of related records) when there is no record. Use a calculated field (result text) If(IsEmpty ( portal primary key field );"";"X") Use this calc field - conditionally formatted to show a red X - as the delete button with a script that does nothing if there is no portal row record but deletes the related record if used when one exists.
imoree Posted September 26, 2011 Author Posted September 26, 2011 Efen, if the calculated field does the calculation and inserts the "X" only if the primary key is not empty, then what am i conditionally formatting? can u please give me an example ? i am confused. what would the condition be i guess is what i am saying since the calculation took care of it? -i
efen Posted September 26, 2011 Posted September 26, 2011 Like the attached - although this just uses a conditionally formatted text object delete.zip
imoree Posted September 27, 2011 Author Posted September 27, 2011 Efen, So based on this post: Use a calculated field (result text) If(IsEmpty ( portal primary key field );"";"X") that is irrelevant to your file TOTALLY!! that is what was confusing me, but in your file, your conditional child::_pk - true then turn Text RED THen your script checks if ID field and asks if you want to delete portal row. Thanks for making me not think i was crazy .. YET!!
efen Posted September 27, 2011 Posted September 27, 2011 This version has the extra field ... delete2.zip
imoree Posted September 27, 2011 Author Posted September 27, 2011 2nd version seems like why bother when your 1st method is much cleaner & simpler. -i
efen Posted September 27, 2011 Posted September 27, 2011 1st method is much cleaner & simpler That's why I attached the first file rather than the one with the extra field - which I only posted because you seemed to have trouble understanding how it worked in a previous post
Recommended Posts
This topic is 4805 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