Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, June 28, 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: No Results from RepositoryHelper
Bill
Posts: 10
 
No Results from RepositoryHelperYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Apr 12 12:29 PM
fiogf49gjkf0d

I am trying to verify the price on in the Products associated with an Opportunity before the Opportunity can be set to 'Won'.  However, my attempt to access the Opportunity Product(s) always returns a null value regardless of if there are products or not.  I have tried two different methods for getting the Opportunity Products...


A)


 System.Collections.Generic.IList<IOpportunityProduct> objOppProdList = opportunity.Products as System.Collections.Generic.IList<IOpportunityProduct>;

and B)


Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.IOpportunityProduct> objRepHelp = 
               Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.IOpportunityProduct>();
            Sage.Platform.Repository.ICriteria objCriteria = objRepHelp.CreateCriteria();
           
            objCriteria.Add(objRepHelp.EF.Eq("OPPORTUNITYID", opportunity.Id.ToString()));
           
            System.Collections.Generic.IList<IOpportunityProduct> objOppProdList = objCriteria.List<IOpportunityProduct>();

 


They both compile fine however when in SLX (7.5.4) I get an error box that says "Sage.SalesLogix.Entities.OpportunityProduct".  The error goes away when I get rid of the criteria of opportunityid = opportunity.id.tostring() line.  I know there is at least one product in the opportunity because I can see it.


 


Any suggestions?

[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: No Results from RepositoryHelperYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 May 12 7:16 AM
fiogf49gjkf0d

I don't know what "OPPORTUNITYID" is.......not any property in my Entities..... maybe it's OpportunityProduct.OpportunityId or OpportunityIdSmile


 


Here's a CustomerFX web site example that might help you?


Sage.Platform.RepositoryHelper<ISalesOrder> repository =
Sage.Platform.EntityFactory.GetRepositoryHelper<ISalesOrder>();
Sage.Platform.Repository.ICriteria criteria = repository.CreateCriteria();
criteria.Add(repository.EF.Eq("Account.Id", account.Id.ToString()));
criteria.Add(repository.EF.Gt("CalculatedTotal", "Invoice"));           
criteria.AddOrder(repository.EF.Desc("CreateDate"));
System.Collections.Generic.IList<Sage.Entity.Interfaces.ISalesOrder> orders = criteria.List<Sage.Entity.Interfaces.ISalesOrder>();</font>


 


Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.IProductProgram>();
            Sage.Platform.Repository.ICriteria criteria = repository.CreateCriteria();
            criteria.Add(repository.EF.Eq("Product.Id",ProductId.ToString()));
            criteria.AddOrder(repository.EF.Asc("Program"));
            programs = criteria.List<Sage.Entity.Interfaces.IProductProgram>();   

[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/28/2025 12:37:22 AM