Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, August 14, 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: SLX 7.5 - Trouble with a new table
Hormiga
Posts: 4
 
SLX 7.5 - Trouble with a new tableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Oct 08 7:36 AM
Hi, everybody!
I’m sorry for my terrible English – it isn’t my native language, but I’ve got a problem.

I have created new table – FB_IMPORT_LOG, which isn’t linked to any other table, and I need to display data from this table.

I’ve created new entity with the same name – FB_IMPORT_LOG, then I created new business rule – “Get Records” – with the following source code:
-------------------------------------------------
|#region Usings
|using System;
|using Sage.Entity.Interfaces;
|using Sage.Platform;
|using Sage.Platform.Repository;
|using Sage.Form.Interfaces;
|#endregion Usings
|
|namespace Sage.BusinessRules.CodeSnippets
|{
| public static partial class FB_IMPORT_LOGBusinessRules
| {
| public static void GetRecordsStep1( IFB_IMPORT_LOG fb_import_log, out System.Collections.Generic.IList result)
| {
| IRepository repository = EntityFactory.GetRepository();
| IQueryable qry = (IQueryable)repository;
| IExpressionFactory ef = qry.GetExpressionFactory();
| ICriteria criteria = qry.CreateCriteria();
| result = criteria.List();
| }
| }
|}
-------------------------------------------------

Then, I’ve created a new Quick Form, put data source (“dsFB_IMPORT_LOGs”) on it with the following properties:
-------------------------------------------------
|EntityType: FB_IMPORT_LOG
|GetByMethod: GetRecords
|Source: FB_IMPORT_LOG
-------------------------------------------------

The next my step was creating a Grid with then “Data Source” property, set to “dsFB_IMPORT_LOGs”.

Saving – Building – Creating New Page – Adding a Smart Part – Saving – Deploying…

So, that’s what I got when I’m trying to see the result:
-------------------------------------------------
|Object reference not set to an instance of an object.
|Description: An unhandled exception occurred during the execution of the current web request. Please review
|the stack trace for more information about the error and where it originated in the code.
|
|Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
|
|Source Error:
|
|Line 99: protected override void OnFormBound()
|Line 100:{
|Line 101:dsFB_IMPORT_LOGs.Bind();
|Line 102:
|Line 103:
|
|Source File: c:\Inetpub\wwwroot\SlxClient\SmartParts\FB_IMPORT_LOG\ILForm.ascx Line: 101
|
|Stack Trace:
|
|[NullReferenceException: Object reference not set to an instance of an object.]
| Sage.Platform.ComponentModel.ComponentChangeWatcher..ctor(Object component, EventHandler`1
| changeHandler) +110
| Sage.Platform.EntityBinding.PropertyBinding.HookupChangeEventing() +98
| Sage.Platform.EntityBinding.PropertyBinding.OnCurrentEntityChanged() +10
| Sage.Platform.EntityBinding.EntityBinding.Bind(Object entity, Boolean metadataChanged) +75
| Sage.Platform.EntityBinding.EntityBinding.Sage.Platform.EntityBinding.IEntityBinding.Bind(Object entity,
| Boolean metadataChanged) +11
| Sage.Platform.EntityBinding.EntityBindingSource.Bind(Boolean metadataChanged) +108
| Sage.Platform.EntityBinding.EntityBindingSource.Bind() +6
| ASP.ILForm.OnFormBound() in c:\Inetpub\wwwroot\SlxClient\SmartParts\FB_IMPORT_LOG\ILForm.ascx:101
| Sage.Platform.WebPortal.SmartParts.EntityBoundSmartPart.OnPreRender(EventArgs e) +208
| System.Web.UI.Control.PreRenderRecursiveInternal() +110
| System.Web.UI.Control.PreRenderRecursiveInternal() +193
| System.Web.UI.Control.PreRenderRecursiveInternal() +193
| System.Web.UI.Control.PreRenderRecursiveInternal() +193
| System.Web.UI.Control.PreRenderRecursiveInternal() +193
| System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
|Boolean includeStagesAfterAsyncPoint) +6536
-------------------------------------------------

What am I doing wrong?
[Reply][Quote]
Dan Carvin
Posts: 227
 
Re: SLX 7.5 - Trouble with a new tableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Oct 08 10:13 AM
Try creating a Main View for your entity, and a Navigation item that connects to the main view.
[Reply][Quote]
RJ Eaton
Posts: 234
 
Re: SLX 7.5 - Trouble with a new tableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Oct 08 10:37 AM
Check to ensure that the Entity has been set in the datasource and it isn't set to Object...
[Reply][Quote]
Ken Poggensee
Posts: 71
 
Re: SLX 7.5 - Trouble with a new tableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Oct 08 12:48 AM
t
[Reply][Quote]
Hormiga
Posts: 4
 
Re: SLX 7.5 - Trouble with a new tableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Oct 08 1:31 AM
But i don't need new Navigation Item. I need new Menu Item (got it), which points to the form (got it), which display table data with a couple of filters (here is a problem).
Is there any way just to display the SQL-query result?
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: SLX 7.5 - Trouble with a new tableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Oct 08 3:48 AM
Quote:
Originally posted by Hormiga

Hi, everybody!
I’m sorry for my terrible English – it isn’t my native language, but I’ve got a problem.

I have created new table – FB_IMPORT_LOG, which isn’t linked to any other table, and I need to display data from this table.

I’ve created new entity with the same name – FB_IMPORT_LOG, then I created new business rule – “Get Records” – with the following source code:
-------------------------------------------------
|#region Usings
|using System;
|using Sage.Entity.Interfaces;
|using Sage.Platform;
|using Sage.Platform.Repository;
|using Sage.Form.Interfaces;
|#endregion Usings
|
|namespace Sage.BusinessRules.CodeSnippets
|{
| public static partial class FB_IMPORT_LOGBusinessRules
| {
| public static void GetRecordsStep1( IFB_IMPORT_LOG fb_import_log, out System.Collections.Generic.IList result)
| {
| IRepository repository = EntityFactory.GetRepository();
| IQueryable qry = (IQueryable)repository;
| IExpressionFactory ef = qry.GetExpressionFactory();
| ICriteria criteria = qry.CreateCriteria();
| result = criteria.List();
| }
| }
|}
-------------------------------------------------

Then, I’ve created a new Quick Form, put data source (“dsFB_IMPORT_LOGs”) on it with the following properties:
-------------------------------------------------
|EntityType: FB_IMPORT_LOG
|GetByMethod: GetRecords
|Source: FB_IMPORT_LOG
-------------------------------------------------

The next my step was creating a Grid with then “Data Source” property, set to “dsFB_IMPORT_LOGs”.

Saving – Building – Creating New Page – Adding a Smart Part – Saving – Deploying…

So, that’s what I got when I’m trying to see the result:
-------------------------------------------------
|Object reference not set to an instance of an object.
|Description: An unhandled exception occurred during the execution of the current web request. Please review
|the stack trace for more information about the error and where it originated in the code.
|
|Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
|
|Source Error:
|
|Line 99: protected override void OnFormBound()
|Line 100:{
|Line 101:dsFB_IMPORT_LOGs.Bind();
|Line 102:
|Line 103:
|
|Source File: c:\Inetpub\wwwroot\SlxClient\SmartParts\FB_IMPORT_LOG\ILForm.ascx Line: 101
|
|Stack Trace:
|
|[NullReferenceException: Object reference not set to an instance of an object.]
| Sage.Platform.ComponentModel.ComponentChangeWatcher..ctor(Object component, EventHandler`1
| changeHandler) +110
| Sage.Platform.EntityBinding.PropertyBinding.HookupChangeEventing() +98
| Sage.Platform.EntityBinding.PropertyBinding.OnCurrentEntityChanged() +10
| Sage.Platform.EntityBinding.EntityBinding.Bind(Object entity, Boolean metadataChanged) +75
| Sage.Platform.EntityBinding.EntityBinding.Sage.Platform.EntityBinding.IEntityBinding.Bind(Object entity,
| Boolean metadataChanged) +11
| Sage.Platform.EntityBinding.EntityBindingSource.Bind(Boolean metadataChanged) +108
| Sage.Platform.EntityBinding.EntityBindingSource.Bind() +6
| ASP.ILForm.OnFormBound() in c:\Inetpub\wwwroot\SlxClient\SmartParts\FB_IMPORT_LOG\ILForm.ascx:101
| Sage.Platform.WebPortal.SmartParts.EntityBoundSmartPart.OnPreRender(EventArgs e) +208
| System.Web.UI.Control.PreRenderRecursiveInternal() +110
| System.Web.UI.Control.PreRenderRecursiveInternal() +193
| System.Web.UI.Control.PreRenderRecursiveInternal() +193
| System.Web.UI.Control.PreRenderRecursiveInternal() +193
| System.Web.UI.Control.PreRenderRecursiveInternal() +193
| System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
|Boolean includeStagesAfterAsyncPoint) +6536
-------------------------------------------------

What am I doing wrong?


It looks like your code snippet doesnt actually do anything:

IRepository repository = EntityFactory.GetRepository();
| IQueryable qry = (IQueryable)repository;
| IExpressionFactory ef = qry.GetExpressionFactory();
| ICriteria criteria = qry.CreateCriteria();
| result = criteria.List();

I may be missing something here but to me it doesnt look like you set any properties of you repository - like which entity you would like to get....its probably returning nothing hence the object not set to instance of an object error.

By the way, your English is better than mine - and I'm from England!!
[Reply][Quote]
Hormiga
Posts: 4
 
Re: SLX 7.5 - Trouble with a new tableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Oct 08 1:20 AM
My mistake. =)
This code is a result of char filtering at this forum. Here is the original code:
-------------------------------------------------
|#region Usings
|using System;
|using Sage.Entity.Interfaces;
|using Sage.Platform;
|using Sage.Platform.Repository;
|using Sage.Form.Interfaces;
|#endregion Usings
|
|namespace Sage.BusinessRules.CodeSnippets
|{
| public static partial class FB_IMPORT_LOGBusinessRules
| {
| public static void GetRecordsStep1( IFB_IMPORT_LOG fb_import_log,
| out System.Collections.Generic.IList<IFB_IMPORT_LOG> result)
| {
| IRepository<IFB_IMPORT_LOG> repository = EntityFactory.GetRepository<IFB_IMPORT_LOG>();
| IQueryable qry = (IQueryable)repository;
| IExpressionFactory ef = qry.GetExpressionFactory();
| ICriteria criteria = qry.CreateCriteria();
| result = criteria.List<IFB_IMPORT_LOG>();
| }
| }
|}
-------------------------------------------------
[Reply][Quote]
Hormiga
Posts: 4
 
Re: SLX 7.5 - Trouble with a new tableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Oct 08 2:46 AM
I've got new results.
I've created new page with a Live Group Viewer on it, configured it, so it works correctly. Then I've add my Smart Part on this page, and while playing with "Show In Mode" property (List/Detail/Insert) I've noticed, that my form work correctly only in detail view. If I trying do display form in list view, then same error appears.
I think that means, that my form requesting concrete database record for working.
Is there way to configure form, so it will displays like I want?
[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): 8/14/2025 5:33:43 AM