Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, August 17, 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: Datasource for an unrelated entity.
Ken Poggensee
Posts: 71
 
Datasource for an unrelated entity.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Mar 09 5:19 PM
Trying to do an option picker thing and running into problems.

I have a form that has a datasource on it that returns a 1:m for the current entity I'm on and have it tied to a datagrid. Now I want to place another datagrid next to it and have the datasource return all the records from a unrelated table. The idea is they are going to select the options from the unrelated grid and I'm going to go insert the records into my 1:m table\grid.

To do this I created a business rule on my unrelated table to return an IList of all the records. I then place a datasource on my form and used the GetByMethod to point to it. I then tied that datasource to my unrelated grid. When I go to open the form I get an error
'Non-static method requires a target.'

I also tried creating the business rule on the entity that I was on rather than my unrelated table and got the same results. I also tried messing with the IsCollection and UseSmartSelection with no joy. This happens whether it is a new record or I try to edit and existing one.

Not sure what it means yet but when I step through it in VS I can see it chokes when it tries to set the SourceObject The error is
'Non-static method requires a target.'
-----------------
void dsTemplate_OnCurrentEntitySet(object sender, EventArgs e)
{
dsTemplate.SourceObject = BindingSource.Current;
RegisterBindingsWithClient(dsTemplate);
}
-----------------

This is the business rule
-----------------
public static void GetOptions( ITemplateOptions templateoptions, out object result)
{
IRepository repository = EntityFactory.GetRepository();

IQueryable qry = (IQueryable)repository;
IExpressionFactory ef = qry.GetExpressionFactory();

ICriteria criteria = qry.CreateCriteria();
//Just a test to return some records. This will be modified later.
criteria.Add(ef.Eq("CreateUser", "ADMIN"));

result = criteria.List();

}
}
-----------------

[Reply][Quote]
Ken Poggensee
Posts: 71
 
Re: Datasource for an unrelated entity.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Mar 09 6:28 PM
Nevermind

I moved the bussiness rule back up to my main entity and fixed my Typo (didnt show error while building though... wierd). And then it started working just as I though it should
[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/17/2025 10:08:01 PM