Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, June 5, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Trying to prepopulate lookup with filter based on Current Account for Opportunity
RJ Eaton
Posts: 234
 
Trying to prepopulate lookup with filter based on Current Account for OpportunityYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Apr 14 9:00 AM

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


 

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/5/2025 2:52:07 AM