Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, June 3, 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: Using Custom Field on Opportunity in C# Code Snippet
Lee Harris
Posts: 23
 
Using Custom Field on Opportunity in C# Code SnippetYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Mar 15 12:06 PM

Hi,


I am having some trouble accessing a custom field on the Opportunity table in a load action (C# Code Snippet Action) on the Insert Opportunity screen (web 8.1). I have built interfaces and also tried a complete rebuild and deploy but no luck.


I am using the following code to get a list of opportunities in descending order as I am only interested in the top one.


 


Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.IOpportunity> repository = Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.IOpportunity>();


Sage.Platform.Repository.ICriteria criteria = repository.CreateCriteria();


criteria.AddOrder(repository.EF.Desc("SEQUENCENUMBER"));


var result = criteria.List<Sage.Entity.Interfaces.IOpportunity>();


 


Then I am trying to access my custom field (sequencenumber) using the following


Sage.Entity.Interfaces.IOpportunity opportunity = (Sage.Entity.Interfaces.IOpportunity)result[0];


var nextNumber = ((int)opportunity.sequencenumber + 1)


 


The error I am seeing is "could not resolve property: SEQUENCENUMBER of: Sage.SalesLogix.Entities.Opportunity."


 


I appreciate any ideas as to what I may be doing wrong, or if there is a better way to select the top 1 opportunity and then access the custom field. 


 


Thanks in advance,


Lee

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Using Custom Field on Opportunity in C# Code SnippetYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Mar 15 12:21 PM

Did you add the SEQUENCENUMBER field to the Opportunity entity (not talkign about the table)? Right click the entity and update properties, select the field, etc - then do a build. Also, you need to reference the field by it's property name (case sensitive) not by it's field name. The property name is not likely all upper case.

[Reply][Quote]
Lee Harris
Posts: 23
 
Re: Using Custom Field on Opportunity in C# Code SnippetYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Mar 15 5:28 AM

"you need to reference the field by it's property name (case sensitive) not by it's field name"


 



That was what I needed, I was referencing it with the field name rather than the property name. Coming from LAN development this web stuff is taking some getting used to.


Thanks.

[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/3/2025 7:33:01 AM