April 27, 201015 yr 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
April 27, 201015 yr 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.
April 27, 201015 yr Author 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
April 27, 201015 yr 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, 201015 yr by Guest
Create an account or sign in to comment