8/14/2025 5:26:28 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!
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.
|
|
|
|
SLX 7.5 - Trouble with a new table
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?
|
|
|
| |
| |
| |
|
Re: SLX 7.5 - Trouble with a new table
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? |
|
|
|
Re: SLX 7.5 - Trouble with a new table
Posted: 22 Oct 08 3:48 AM
|
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!!  |
|
|
|
Re: SLX 7.5 - Trouble with a new table
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>(); | } | } |} ------------------------------------------------- |
|
|
|
Re: SLX 7.5 - Trouble with a new table
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?
|
|
|
|
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!
|
|
|
|
|
|
|
|