Consider scenario: When opportunity type is internal, system should only show internal marketed products for opportunity in product association list applet and for opportunity type external system should show only external marketed products. Products are marked as internal and external by product type field.
Challenge: According to oracle there is no other way then scripting on web load of association applet to filter the records. Script can look something like following. And it works flawlessly.
Can you suggest any script less alternative?
function WebApplet_Load ()
{
var BO;
var ParentBC;
var BC;
var AccountId;
BO = TheApplication().ActiveBusObject();
ParentBC = BO.GetBusComp("Opportunity");
if(ParentBC.Name = "Opportunity")
{
AccountId = ParentBC.GetFieldValue ("Account Id");
BC = this.BusComp();
with (BC)
{
ClearToQuery();
ActivateField("Account Id");
SetSearchSpec ("Account Id", AccountId);
ExecuteQuery();
}
}
ParentBC = null;
BC = null;
BO = null;
}