Hi Linh, Sorry for the delay in responding, hope its not too late for a code-snippet: Here you go - var result : BadiOpportunityExcludeCodeValuesChanging; var input : BadiOpportunityExcludeCodeValuesImport; var bus_types : BadiOpportunityCodeValue; input = InputData; var Oppt_UUID = input.RootObjectNodeReference.UUID; if (!Oppt_UUID.IsInitial()) { var opp_ctxt = Opportunity.Retrieve(Oppt_UUID); if ((opp_ctxt.IsSet()) && (opp_ctxt.ProcessingTypeCode == "OPPT") && (opp_ctxt.OriginTypeCode.content == "ZUP")) { //var ls_btd = opp_ctxt.BusinessTransactionDocumentReference.GetFirst(); //if ((ls_btd.IsSet()) && (ls_btd.BusinessTransactionDocumentReference.TypeCode == "ZK02")) //{ var lt_bustype = result.BadiOpportunityCodeValue.Where(n => n.ListID == "BusinessType"); if (lt_bustype.Count() > 0) { result.Clear(); bus_types.Content = "002"; //Cross Sell result.BadiOpportunityCodeValue.Add(bus_types); bus_types.Content = "001"; //Up Sell result.BadiOpportunityCodeValue.Add(bus_types); } //} } } return result; As you can see from Above the structure "RESULT" contains the filtered list of values. An additional note to this, the RESTRICTCODE Badi works only for STANDARD fields and not for CUSTOM (extended) fields. Hope this clarifies. BR Dedeepya
↧