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: Error Bounding Fields
Misael Ochoa M.
Posts: 45
 
Error Bounding FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Oct 08 3:42 PM
Hi everyone
I have a PickList Field related to a Entity Field(Siccode) and Edit Text Box Related to another Entity Field (Industry)
So i need to select a PickList value and when it change I need to Populate Entity Field with an Industry that matches with SICCODEID selected

That's my Code for Lookup's result:

if (lueSICCode.LookupResultValue.ToString() != "")
{
//String Builder
System.Text.StringBuilder sb = new StringBuilder();
//Sentencia SQL
sb.Append("SELECT SICCODE.INDUSTRY AS INDUSTRY ");
sb.Append("FROM SICCODE ");
sb.Append("WHERE SICCODE.SICCODE = '" + lueSICCode.LookupResultValue.ToString() + "'");

//Conexion de Sage
Sage.Platform.Data.IDataService data = Sage.Platform.Application.ApplicationContext.Current.Services.Get();
System.Data.OleDb.OleDbConnection objConnection = (System.Data.OleDb.OleDbConnection)data.GetConnection();
//Command
System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDbCommand(sb.ToString(), objConnection);
if (objConnection != null)
{
if (cmd.Connection.State != System.Data.ConnectionState.Open)
{
try
{
// Datareader
System.Data.OleDb.OleDbDataReader dr;
cmd.Connection.Open();
dr = cmd.ExecuteReader();

if (dr.HasRows)
{
while (dr.Read())
{
edtIndustry.Text = dr["INDUSTRY"].ToString();
}
}

}
catch
{
}
finally
{
cmd.Connection.Close();
cmd.Connection.Dispose();
}
}
}
}

But I've been debbuging my Code and I've got values but i don't know why Field is never populated.

I just get values when i remove Link with Entity Field Industry.

Does someone know what's happening?
[Reply][Quote]
Ken Poggensee
Posts: 71
 
Re: Error Bounding FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Oct 08 12:23 AM
So your
edtIndustry.Text = dr["INDUSTRY"].ToString();
is causing a problem?

What it you try to set to to a static value to that like
edtIndustry.Text = "My Test";
Like without any other code... What happens?

I imagine that is going to work? With that being said is anything else 'touching' that object? What f you create a different text object for edtIndustry on you form and try to populate that from your code?

You might also try to drop into Visual Studio to get some more information during debug...

--Ken--
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Error Bounding FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Oct 08 3:17 AM
Is the edtIndustry field bound to the Account.Industry property? It should be..

If so, populate the property of the entity not the control...

So replace the relavant part with:

// Datareader
System.Data.OleDb.OleDbDataReader dr;
cmd.Connection.Open();
dr = cmd.ExecuteReader();

try
{
// Datareader
System.Data.OleDb.OleDbDataReader dr;
cmd.Connection.Open();
dr = cmd.ExecuteReader();

//NH

Sage.Entity.Interfaces.Iaccount acc = this.BindingSource.Current as Sage.Entity.Interfaces.IAccount;

if (dr.HasRows)
{
while (dr.Read())
{
//edtIndustry.Text = dr["INDUSTRY"].ToString(); -- DONT USE.
acc.Industry = dr["INDUSTRY"].ToString();
}
}

}
catch
{
}
finally
{
cmd.Connection.Close();
cmd.Connection.Dispose();
}
}



[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Error Bounding FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Oct 08 3:19 AM
It sounds like your edit field is bound, so as soon as you set the text of the control the binding is overriding it with a blank values form the DB.

Is the edtIndustry field bound to the Account.Industry property? It should be..

If so, populate the property of the entity NOT the control...

So replace the relevant part with:

// Datareader
System.Data.OleDb.OleDbDataReader dr;
cmd.Connection.Open();
dr = cmd.ExecuteReader();

try
{
// Datareader
System.Data.OleDb.OleDbDataReader dr;
cmd.Connection.Open();
dr = cmd.ExecuteReader();

//NH

Sage.Entity.Interfaces.IAccount acc = this.BindingSource.Current as Sage.Entity.Interfaces.IAccount;

if (dr.HasRows)
{
while (dr.Read())
{
//edtIndustry.Text = dr["INDUSTRY"].ToString(); -- DONT USE.
acc.Industry = dr["INDUSTRY"].ToString();
//acc.Save(); - optional whether you want to save the record here, or wait until the user clicks save,...
}
}

}
catch
{
}
finally
{
cmd.Connection.Close();
cmd.Connection.Dispose();
}
}

Cheers,
Nick

[Reply][Quote]
Misael Ochoa M.
Posts: 45
 
Re: Error Bounding FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Oct 08 9:19 AM
That's really good, I missed bound Entity, I had bounded only the Control not the Entity,
Thank You
Misael.
[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:36:46 AM