Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

No related record and a button


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

Recommended Posts

Posted

Hi folks !

I have a portal and button script configured there "GoToRelatedRecord" on it. It works fine, if there is a related record.

Is there any way to configure it to create a new related record (in the same button script), if no related records are yet present ?

Posted

I assume that the button is situated on the master record, and not within a portal row...

If [ IsEmpty( relationship::primarykey ) ]

#no related records

Else

#related record exists

Go to Related Records []

End If

Posted

So IsEmpty will do it ? I'll try.

Thank you !

EDIT// Yes ! That works. Thanks again !

Posted

In fact, it's a good idea to always wrap a gtrr within an If Else Endif structure, unless you're sure that there will ALWAYS be related records.

Posted

The IsEmpty() checks for related records for the current record, but what checks for related records for the current found set?

Posted

The IsEmpty() checks for related records for the current record, but what checks for related records for the current found set?

IsEmpty(related::fk_parentID) or not IsEmpty ( related::fk_parentID ) will NEVER work for a found set because this test always evaluates on the current record, as you are getting to, Vaughan.

One should set error capture on and test for If [ Get ( LastError ) = 401 ] after a GTRR to know whether there were ANY related records for ANY record within the found set AFTER the jump. Oh, I can't tell you how many times this one has bitten me. :wink2:

This topic is 5738 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.