Jump to content

Is a portal empty


Raymack

This topic is 534 days old. Please don't post here. Open a new topic instead.

Recommended Posts

6 hours ago, Raymack said:

What is a simple way to test for this?

I assume by "this" you mean the absence of related records. Because a portal can be empty even if related records do exist - on account of the portal being filtered.

The test suggested by @bcooney tests for the absence of related records. In normal circumstances, it will return true when no related records exist. However, if something went wrong and the related records do not have a value in their id (i.e. primary key) field, then you will get a false positive. So it is better to test for:

IsEmpty ( RelatedTO::MatchField )

If the match field contains only non-zero numerical values, you can shorten this to:

not RelatedTO::MatchField

 

Edited by comment
Link to comment
Share on other sites

Thank!  I had a script working fine to delete the portal records, but of course, SOMEONE will hit the DELETE button anyway!  So wanted to test and intercept this possibility...Good to know a new function! Bye R@y

Link to comment
Share on other sites

This topic is 534 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.