public static DirPartyRelationship findByChildParty(DirPartyRecId _parentParty, DirPartyRecId _childParty, boolean _forupdate = false) { DirPartyRelationship partyRelationship = null; ; partyRelationship.selectForUpdate(_forupdate); select firstonly partyRelationship index hint TypeParentChildIdx where partyRelationship.ParentParty == _parentParty && partyRelationship.ChildParty == _childParty; return partyRelationship; } public static void lookupDependentsByParentParty(FormStringControl _formControl, DirPartyRecId _ParentParty) { SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(DirPartyRelationship),_formControl); Query query = new Query(); QueryBuildDataSource queryBuildDataSource = query.addDataSource(tableNum(DirPartyRelationship)); QueryBuildRange queryBuildRangeJournalType = queryBuildDataSource.addRange(fieldNum(DirPartyRelationship, ParentParty)); sysTableLookup.addLookupfield(fieldNum(DirPartyRelationship, RelationshipTypeId)); sysTableLookup.addLookupfield(fieldNum(DirPartyRelationship, ChildParty)); queryBuildRangeJournalType.value(queryValue(_ParentParty)); sysTableLookup.parmQuery(query); sysTableLookup.performFormLookup(); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter