Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, May 18, 2024 
 
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: This is probably easy but I can't seem to find it
RJ Eaton
Posts: 234
 
This is probably easy but I can't seem to find itYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Aug 15 9:50 AM

I have an entity related 1:M to Opportunity -- From Tab on Opportunity I call the other entity in Insert Mode, Full screen.


On the load if the form is in insert mode I run an Nibernate query to bring back a single item, I then populate a combobox with these values from this item..


Here is my issue .. I need to add a second field to the SQL query I am running so I bring back Item with two values such as ProductName, ProductFamily..


I am trying to seperate out the items so taht the combox displays the Name and I can use the family somewhere else.. I can't seem to get to the second value in the item and I have tried listitem(1)


 


Here is my code snippet for what I have so far


 


 


 


<p>string qry = String.Format("Select P.Name, P.Family From Opportunity_Product OP Join Product P on(OP.Productid=P.Productid) Where OP.Status <> 'Open' and OP.OpportunityId = '{0}'", txtOppId.Text);

 

NHibernate.IQuery query = (NHibernate.IQuery)session.CreateSQLQuery(qry)

.AddScalar("Name", NHibernate.NHibernateUtil.String)

.AddScalar("Family", NHibernate.NHibernateUtil.String); 

this.cmbProduct.Items.Clear();

System.Collections.IList list = query.List();

string ProductList = "";

foreach(object listitem in list)  

{

if (ProductList == " ")

if (ProductList == " ")

 

 

 

{

 

 

ProductList = string.Format("{0}", listitem);

this.cmbProduct.Items.Add("No Closed Products");

 

 

}

 

 

 

else


 

{

 

 

 

ProductList = string.Format("{0}", listitem);


.cmbProduct.Items.Add(ProductList.ToString());

 

 

 

}

 

 


    

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: This is probably easy but I can't seem to find itYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Aug 15 12:41 PM

IIRC the results from CreateSQLQuery is a list of object arrays. So, if that is the case, you could try this:


 


foreach (object[] listitem in items)
{
cmdProduct.Items.Add(listitem[0]); // to use name or listitem[1] to use family
}

 


If that doesn't work, I'd debug in VS and break there to inspect what the items in list are.

[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 © 2024 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): 5/18/2024 9:03:30 PM