R2D2 Posted March 8, 2009 Posted March 8, 2009 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 ?
Vaughan Posted March 8, 2009 Posted March 8, 2009 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
R2D2 Posted March 8, 2009 Author Posted March 8, 2009 So IsEmpty will do it ? I'll try. Thank you ! EDIT// Yes ! That works. Thanks again !
bcooney Posted March 8, 2009 Posted March 8, 2009 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.
Vaughan Posted March 8, 2009 Posted March 8, 2009 The IsEmpty() checks for related records for the current record, but what checks for related records for the current found set?
LaRetta Posted March 9, 2009 Posted March 9, 2009 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:
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now