Home
|
Forums
|
Contact
|
Search
|
Syndication
[login]
[create account]
Saturday, August 16, 2025
slxdeveloper.com
Home
Search
Contact us
About slxdeveloper
Syndication
Community
Forums
(NEW!)
Newsletter Archive
Members
Your Profile
Submit Article
General
Administration
(6)
OLE DB Provider
Miscellaneous
(2)
Architect
VBScript
(9)
ActiveX Controls
(6)
How To's
(14)
.NET Extensions
(3)
External
OLE DB Provider
(12)
SLAPI (SlgxApi.dll)
SalesLogix COM
(1)
Web
ASP/ASP.NET
(2)
Web Services
Web Client
Downloads
Samples
(17)
Documentation
(7)
Utilities
(18)
Resources
SalesLogix
(3)
Programming
(1)
8/16/2025 2:29:39 AM
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 Thread
View:
Dynamic
Flat
Tree
Search:
Author
Thread: Custom Code snippet Property
Dan Carvin
Posts: 227
Custom Code snippet Property
Posted: 04 Nov 08 12:52 PM
I'm in 7.5 trying to create a code snippet property which returns a value based on some values in an extension table.
When doing the build, I get errors saying that an object reference is required. How to I add the object reference I need? Can someone an example of such a code snippet property?
Thanks,
[
Reply
][
Quote
]
Nick Hollis
Posts: 549
Re: Custom Code snippet Property
Posted: 05 Nov 08 4:31 AM
Which object are you trying to use? Can you paste the code snippet here?
[
Reply
][
Quote
]
Dan Carvin
Posts: 227
Re: Custom Code snippet Property
Posted: 05 Nov 08 12:23 PM
Here's what I have (not finished but a start that should work):
public static void GetDaysDelinqStep1( IAccount account, out System.String result)
{
String DaysDelinq;
if (Sage.Entity.Interfaces.ICDaysdelinq.Accountid != null)
{
if (Sage.Entity.Interfaces.ICDaysdelinq.Agebal04 >0)
{
DaysDelinq = ">90";
}
else
{
DaysDelinq = "Something else";
}
}
else
{
DaysDelinq = "N/A";
}
return DaysDelinq;
}
Here's one of the errors I get during the build:
ERROR - C:\Documents and Settings\Administrator.DOMAIN\Application
Data\Sage\Platform\Output\Sage.SnippetLibrary.CSharp\src\Sage.SnippetLibrary.CSharp.@.9f262c59-eed8-4261-b79c-36a7c0a7f735.codesnippet.cs
(37,17):An object reference is required for the nonstatic field, method, or property 'Sage.Entity.Interfaces.ICDaysdelinq.Accountid.get'
[
Reply
][
Quote
]
Andy Norris
Posts: 39
Re: Custom Code snippet Property
Posted: 05 Nov 08 12:29 PM
You haven't instantiated a ICDaysdelinq object. The Interface definition won't have a value unless you have an instance declared. Like below:
Sage.Entity.Interfaces.ICDaysdelinq CDaysObj = this.BindingSource.Current as Sage.Entity.Interfaces.ICDaysdelinq;
Then reference the CDaysObj where you're referencing the Interface in the rest of the code.
[
Reply
][
Quote
]
Dan Carvin
Posts: 227
Re: Custom Code snippet Property
Posted: 05 Nov 08 1:56 PM
Now I'm getting:
'Sage.BusinessRules.CodeSnippets.AccountBusinessRules' does not contain a definition for 'BindingSource'
Sorry, I'm fairly new to C#.
[
Reply
][
Quote
]
Andy Norris
Posts: 39
Re: Custom Code snippet Property
Posted: 05 Nov 08 2:31 PM
Is ICDaysdelinq an extension of the Account entity? If that's the case, then it would likely be account.CDaysdelinq.Accountid and account.CDaysdelinq.Agebal04 that you should use instead, I would guess.
[
Reply
][
Quote
]
Nick Hollis
Posts: 549
Re: Custom Code snippet Property
Posted: 06 Nov 08 5:22 AM
Quote:
Originally posted by Dan Carvin
Now I'm getting:
'Sage.BusinessRules.CodeSnippets.AccountBusinessRules' does not contain a definition for 'BindingSource'
Sorry, I'm fairly new to C#.
Because you are in a Business Rule you do not have this.BindingSource.Current - this is part of the page. As Andy says you can use the account entity being passed into the Business Rule to join to your table - this will work if your delinq...table is an extension table of Account. If not, you can generate an entity instance of your delinq (sorry havent got the name of the entity you are after on this reply screen
), and then set your properties. I.e something like:
Sage.Entity.Interfaces.Idelinq del = Sage.Platform.EntityFactory.GetById
(account.Id.ToString());
del.PROPERTY = account.PROPERTY;
del.Save();
[
Reply
][
Quote
]
Dan Carvin
Posts: 227
Re: Custom Code snippet Property
Posted: 07 Nov 08 12:54 PM
(duplicate post)
[
Reply
][
Quote
]
Dan Carvin
Posts: 227
Re: Custom Code snippet Property
Posted: 07 Nov 08 12:54 PM
It is an extension table, so how do I join it?
BTW, I am doing this as a custom property rather directly in the Account Detail because the customer may ask me to drive logic in other views (Ticket, etc) off of the value I am creating. If I make it a custom property then the value would be available to any process that is linked to Account. Make sense?
[
Reply
][
Quote
]
Nick Hollis
Posts: 549
Re: Custom Code snippet Property
Posted: 10 Nov 08 12:37 PM
You access it through the account entity being passed into the business rule...so you would use account.YOUREXTENSIONTABLE.YOUREXTENSIONPROPERTY
Nick
[
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
|
page cache (param): 8/16/2025 2:35:54 AM