ChiSao Posted April 27, 2010 Posted April 27, 2010 Hi, in my solution I have a layout with a portal on it. There is a delete button for each record in the portal (the last column). Now I would like to show this button dynamically because some of the records can't be deleted. So it useless to show the delete button. I thought to use a global field and fill it with the button if delete is possible and leave it empty if not. But I'm not sure how to aacomplish that. Could someone help me? Thx by ChiSao
IdealData Posted April 27, 2010 Posted April 27, 2010 Regardless of whether you display an icon in the portal your button will still be active and will therefore execute the action or run your script. You will need to take control from the script to ensure that records are not deleted. On that basis, your script must be able to determine the criteria for deletion of the selected record, or not. The same criteria can be used for conditional formatting, or a calculation to populate a container (your icon). Do not use a global field - it will not work.
ChiSao Posted April 27, 2010 Author Posted April 27, 2010 You right I forgot this problem but anyway I have already the script which prevents from deleting. So I will use the conditional formatting to cover the button and the script to control the function of the button. thx
Mike J Posted April 27, 2010 Posted April 27, 2010 (edited) Try this New calc field; output set to container called: b_Delete button Case ( Isempty (primary key)=1;""; not Isempty (primary key)=1 and delete status field = "delete"; table:icon delete; not Isempty (primary key)=1 and delete status field = "don't delete"; "" ) The first statement allows for this to not be seen if you have any portals with create records active on the relationship. The second/third statement looks at the status you have about whether a record can be deleted or not. In the case of adding a script, If (Isempty (b_delete)=1) Exit script Else Delete the record There are other parameters to consider, but this is the simplest I think. Please feel free to comment anything I may have missed. Thanks [see attached example] Mike Delete_Button_in_Portal.fp7.zip Edited April 27, 2010 by Guest
Recommended Posts
This topic is 5324 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