Constraining an association applet

If you ever had a requirement to constrain an assocoation applet, you might be familiar with one of the methods:

To be honest, I always felt guilty using above methods and kept looking for a more declarative way. And finally found it.


Parent BC Constraint Field - applet user property


Let's say you need to constrain a [Contact Assoc Applet] with Opportunity's primary organisation => so you'll assoc only contacts which are from the same org as your opportunity.

First thing you'll need to do is to change an applet class to be CSSSWEFrameSIAAssocList.
Now create a couple of applet user properties:

User Property Value Description
BC Field Search LHS [Primary Organization Id] = Left (static) part of spec. A field mentioned here is from assoc applet's BC.
Parent BC Constraint Field Primary Organization Id Right (dynamic) part of spec is a field name from your list applet's parent BC (Opportunity)

Applet is ready to be compiled and tested!

As a result Siebel will construct a named search spec as shown in a log below:


... Named search [Associate Constraint Search]: [Primary Organization Id] ='2-9EZ5U1'

 

Afterword

As I already mentioned, these UserProps are part of a specific class, which means you can't use it together with other useful UserProprs from different classes (for example, Override Visibility)

Also keep in mind that you are now bond to parent BC field name. Association applet will fail, if used in the context, where parent BC doesn't have a referenced field.