March 8, 200916 yr 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 ?
March 8, 200916 yr 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
March 8, 200916 yr Author So IsEmpty will do it ? I'll try. Thank you ! EDIT// Yes ! That works. Thanks again !
March 8, 200916 yr 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.
March 8, 200916 yr The IsEmpty() checks for related records for the current record, but what checks for related records for the current found set?
March 9, 200916 yr 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:
Create an account or sign in to comment