In version 7.5.3 We are making use of a code snippet that was presented here on modifying the prefilter conditions on the load of a form.
We have account .. That might have many sub accts, the sub accounts are added at the account level .. and made available to assoicate them to an opportunity.
This code in 7.5.3 works perfectly, when the lookup is presented it only returns the sub accounts associated to the Opportunity.Account.. In trying upgrade the forms it seems the lookup now returns all the sub accounts for all accounts not just the opporutnity.account.. I have tried to play with the presettings, and tried to modify the code to no avail.. anyone have a hint as to how this changes with 8.1 ..
CODE BELOW
=============================================================================================================
Sage.Platform.Application.IEntityHistoryService svc = Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Application.IEntityHistoryService>(); if (svc != null){ foreach (Sage.Platform.Application.EntityHistory history in svc) { string str; if ((!string.IsNullOrEmpty(history.EntityId.ToString()) && (history.EntityId.ToString() != Sage.Platform.Orm.Entities.EntityViewMode.Insert.ToString())) && ((str = history.EntityType.Name.ToUpper()) != null)) { if (str == "IOPPORTUNITY"){ Sage.Entity.Interfaces.IOpportunity opp = Sage.Platform.EntityFactory.GetRepository<Sage.Entity.Interfaces.IOpportunity>().FindFirstByProperty("Id", history.EntityId); string sId = opp.Account.Id.ToString(); string sAcctList = string.Empty; sAcctList = "xxx' AND (Accountid = '" + sId + "') AND 'A' != 'B"; Sage.SalesLogix.HighLevelTypes.LookupPreFilter actfilter = new Sage.SalesLogix.HighLevelTypes.LookupPreFilter(); actfilter.LookupEntityName = "Sage.Entity.Interfaces.IUTIRegionFin"; actfilter.FilterValue = sAcctList; actfilter.PropertyName = "Id"; actfilter.OperatorCode = "!="; actfilter.PropertyType = "System.String"; FinAcctNumber.LookupPreFilters.Clear(); FinAcctNumber.LookupPreFilters.Add(actfilter); FinAcctNumber.LookupExclusions = new String[] { string.Empty }; break; } } } }
//Enforces Numberic entry for account number FinAcctNumber.Attributes.Add("onkeypress", "Javascript: var key = window.event.keyCode; if ( (key > 47 && key < 58) || key == 8 || key == 127) return; else window.event.returnValue = null;");
===================================================================================================
End of Code
|