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;
}
In which view is this , Jim ? I think the only place is to use the applet searchspec of the Association applet.
ReplyDeleteThe Opportunity type will have to be passed to the searchspec via..a profile attribute (I hate profile attributes). I am guessing using the ChangeRecord event of the Opportunity BC, use the SetProfile action to set the Opportunity Type into a profile attribute.
Then one can give an IIF condition in the Association applet's searchspec to apply the searchpec conditionally.
i guess we can use search spec in the associate applet by getting accound id in profile attribute
ReplyDeleteYou guys are very close. think for the minimum amount of change required to achieve this.
ReplyDeleteAre you referring to using a link searchspec ? Using ParentFieldValue there ?
ReplyDeleteI tried setting search spec with parent field value, but applet stopped opening up after that, any other ideas?
ReplyDeleteCreate two separated applets (filtered one on internal and one on external); after that put in join on bc of the assoc applet the filter(internal or external) and after that create two filtered assoc applet associated respectively to the internal and external. It should do the job with the price of duplicated objetcs
ReplyDeleteJim, are you referring to "Parent BC Constraint Field" user property ? For some Product Associate applets ?
ReplyDeleteThanks guys for your comments, sorry I couldn't try these options out, personally I like the toggle applet solution but as I am very busy with my current assignment at the moment I couldn't try it out.
ReplyDeleteJim,
ReplyDeleteHave you tried constraining the data using the Source Field which is one of the MVL property.
I didn't understand the script for this solution, Can some one please explain this script in detail.
ReplyDeleteThanks