Limit records being loaded in UltraCombo field

That was it,



Thanks,

Mike



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
bw2868bond
Sent: Thursday, January 03, 2013 8:34 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Limit records being loaded in UltraCombo field





Change Like to MATCHES
Change % to *

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , "Mike
Numbers" wrote:
>
> Just getting back to this after the holidays.
>
>
>
> I changed -
>
> > string whereClause = String.Empty;
>
> To-
>
> string whereClause = "RoleCode like 'Eng%'";
>
>
>
> When I open the program I get the following message-
>
> Invalid query: where Company = 'CIGNYS' and (RoleCode like 'Eng%') BY
Name.
>
>
>
> No records are then being passed through the adapter.
>
>
>
> Mike
>
>
>
> From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf Of
> Mark Wonsil
> Sent: Wednesday, December 26, 2012 9:29 PM
> To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> Subject: Re: [Vantage] Re: Limit records being loaded in UltraCombo field
>
>
>
>
>
> Hi Mike,
>
> > string whereClause = String.Empty;
> >
> > System.Data.DataSet dsSalesRepAdapter =
> > Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
> > "SalesRepAdapter", out recSelected, false, whereClause);
>
> You're filling the combo with a query but the query condition
(whereClause)
> is set to blank. Try setting it to something like:
>
> whereClause = "RoleCode like 'Eng%'";
>
> It's not a C# thing really, you just need to pass the adapter the correct
> selection.
>
> Mark W.
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
> [Non-text portions of this message have been removed]
>





[Non-text portions of this message have been removed]
9.04.507a
I have added an UltraCombo object being loaded from SalesRep to the Part.entry program. I followed an example in an old student manual and everything is working the way it is supposed to. My problem is I don't want all of the records in the SalesRep table, I only want records that the field SalesRep.RoleCode start with "Eng". Can someone show me how I can add code that will do this. It seems like it should go in the script that gets created from the wizard, but with my C# knowledge, I don't see how to do it. Any help would be appreciated.
Depends on the code you used, can you post it?

Jim Kinneman
Encompass Solutions, Inc

--- In vantage@yahoogroups.com, "mike.numbers" <mnumbers@...> wrote:
>
> 9.04.507a
> I have added an UltraCombo object being loaded from SalesRep to the Part.entry program. I followed an example in an old student manual and everything is working the way it is supposed to. My problem is I don't want all of the records in the SalesRep table, I only want records that the field SalesRep.RoleCode start with "Eng". Can someone show me how I can add code that will do this. It seems like it should go in the script that gets created from the wizard, but with my C# knowledge, I don't see how to do it. Any help would be appreciated.
>
Below is the code in Customization Tools Dialog / Script Editor for the
UltraCombo box. I HOPE this is the code you are referring to . (I am still
trying to figure out how everything fits together.)



using System;

using System.Data;

using System.Diagnostics;

using System.Windows.Forms;

using System.ComponentModel;

using Epicor.Mfg.UI;

using Epicor.Mfg.UI.FrameWork;

using Epicor.Mfg.UI.ExtendedProps;

using Epicor.Mfg.UI.FormFunctions;

using Epicor.Mfg.UI.Customization;

using Epicor.Mfg.UI.Adapters;

using Epicor.Mfg.UI.Searches;

using Epicor.Mfg.BO;





public static class Script

{





// ** Wizard Insert Location - Do Not Remove 'Begin/End
Wizard Added Module Level Variables' Comments! **

// Begin Wizard Added Module Level Variables **



// End Wizard Added Module Level Variables **





// Add Custom Module Level Variables Here **







public static void InitializeCustomCode()

{



// ** Wizard Insert Location - Do not delete
'Begin/End Wizard Added Variable Initialization' lines **

// Begin Wizard Added Variable
Initialization



// End Wizard Added Variable Initialization

// Begin Wizard Added Custom Method Calls



// End Wizard Added Custom Method Calls



}







public static void DestroyCustomCode()

{



// ** Wizard Insert Location - Do not delete
'Begin/End Wizard Added Object Disposal' lines **

// Begin Wizard Added Object Disposal



// End Wizard Added Object Disposal

// Begin Custom Code Disposal



// End Custom Code Disposal



}







private static void SearchOnSalesRepAdapterFillDropDown()

{



// Wizard Generated Search Method

// You will need to call this method from
another method in custom code

// For example, [Form]_Load or
[Button]_Click



bool recSelected;

string whereClause = String.Empty;



System.Data.DataSet dsSalesRepAdapter =
Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
"SalesRepAdapter", out recSelected, false, whereClause);

if (recSelected)

{

// Set EpiUltraCombo
Properties

epiUltraComboC1.ValueMember
= "SalesRepCode";

epiUltraComboC1.DataSource =
dsSalesRepAdapter;


epiUltraComboC1.DisplayMember = "Name";

string[] fields = new
string[] {


"Name"};


epiUltraComboC1.SetColumnFilter(fields);

}

}





private static void PartForm_Load(object sender, EventArgs
args)

{

// Add Event Handler Code

SearchOnSalesRepAdapterFillDropDown();



}





}



Thanks for responding.

Mike



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
jckinneman
Sent: Wednesday, December 26, 2012 4:12 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Limit records being loaded in UltraCombo field





Depends on the code you used, can you post it?

Jim Kinneman
Encompass Solutions, Inc

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
"mike.numbers" <mnumbers@...> wrote:
>
> 9.04.507a
> I have added an UltraCombo object being loaded from SalesRep to the
Part.entry program. I followed an example in an old student manual and
everything is working the way it is supposed to. My problem is I don't want
all of the records in the SalesRep table, I only want records that the field
SalesRep.RoleCode start with "Eng". Can someone show me how I can add code
that will do this. It seems like it should go in the script that gets
created from the wizard, but with my C# knowledge, I don't see how to do it.
Any help would be appreciated.
>





[Non-text portions of this message have been removed]
use the whereclause to limit the records returned.

whereclause = "RoleCode begins 'Eng'"; // not 100% sure that 'begins' is the correct qualifier

Jim Kinneman
Encompass Solutions, Inc


--- In vantage@yahoogroups.com, "Mike Numbers" <mnumbers@...> wrote:
>
> Below is the code in Customization Tools Dialog / Script Editor for the
> UltraCombo box. I HOPE this is the code you are referring to . (I am still
> trying to figure out how everything fits together.)
>
>
>
> using System;
>
> using System.Data;
>
> using System.Diagnostics;
>
> using System.Windows.Forms;
>
> using System.ComponentModel;
>
> using Epicor.Mfg.UI;
>
> using Epicor.Mfg.UI.FrameWork;
>
> using Epicor.Mfg.UI.ExtendedProps;
>
> using Epicor.Mfg.UI.FormFunctions;
>
> using Epicor.Mfg.UI.Customization;
>
> using Epicor.Mfg.UI.Adapters;
>
> using Epicor.Mfg.UI.Searches;
>
> using Epicor.Mfg.BO;
>
>
>
>
>
> public static class Script
>
> {
>
>
>
>
>
> // ** Wizard Insert Location - Do Not Remove 'Begin/End
> Wizard Added Module Level Variables' Comments! **
>
> // Begin Wizard Added Module Level Variables **
>
>
>
> // End Wizard Added Module Level Variables **
>
>
>
>
>
> // Add Custom Module Level Variables Here **
>
>
>
>
>
>
>
> public static void InitializeCustomCode()
>
> {
>
>
>
> // ** Wizard Insert Location - Do not delete
> 'Begin/End Wizard Added Variable Initialization' lines **
>
> // Begin Wizard Added Variable
> Initialization
>
>
>
> // End Wizard Added Variable Initialization
>
> // Begin Wizard Added Custom Method Calls
>
>
>
> // End Wizard Added Custom Method Calls
>
>
>
> }
>
>
>
>
>
>
>
> public static void DestroyCustomCode()
>
> {
>
>
>
> // ** Wizard Insert Location - Do not delete
> 'Begin/End Wizard Added Object Disposal' lines **
>
> // Begin Wizard Added Object Disposal
>
>
>
> // End Wizard Added Object Disposal
>
> // Begin Custom Code Disposal
>
>
>
> // End Custom Code Disposal
>
>
>
> }
>
>
>
>
>
>
>
> private static void SearchOnSalesRepAdapterFillDropDown()
>
> {
>
>
>
> // Wizard Generated Search Method
>
> // You will need to call this method from
> another method in custom code
>
> // For example, [Form]_Load or
> [Button]_Click
>
>
>
> bool recSelected;
>
> string whereClause = String.Empty;
>
>
>
> System.Data.DataSet dsSalesRepAdapter =
> Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
> "SalesRepAdapter", out recSelected, false, whereClause);
>
> if (recSelected)
>
> {
>
> // Set EpiUltraCombo
> Properties
>
> epiUltraComboC1.ValueMember
> = "SalesRepCode";
>
> epiUltraComboC1.DataSource =
> dsSalesRepAdapter;
>
>
> epiUltraComboC1.DisplayMember = "Name";
>
> string[] fields = new
> string[] {
>
>
> "Name"};
>
>
> epiUltraComboC1.SetColumnFilter(fields);
>
> }
>
> }
>
>
>
>
>
> private static void PartForm_Load(object sender, EventArgs
> args)
>
> {
>
> // Add Event Handler Code
>
> SearchOnSalesRepAdapterFillDropDown();
>
>
>
> }
>
>
>
>
>
> }
>
>
>
> Thanks for responding.
>
> Mike
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
> jckinneman
> Sent: Wednesday, December 26, 2012 4:12 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: Limit records being loaded in UltraCombo field
>
>
>
>
>
> Depends on the code you used, can you post it?
>
> Jim Kinneman
> Encompass Solutions, Inc
>
> --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
> "mike.numbers" <mnumbers@> wrote:
> >
> > 9.04.507a
> > I have added an UltraCombo object being loaded from SalesRep to the
> Part.entry program. I followed an example in an old student manual and
> everything is working the way it is supposed to. My problem is I don't want
> all of the records in the SalesRep table, I only want records that the field
> SalesRep.RoleCode start with "Eng". Can someone show me how I can add code
> that will do this. It seems like it should go in the script that gets
> created from the wizard, but with my C# knowledge, I don't see how to do it.
> Any help would be appreciated.
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Hi Mike,

> string whereClause = String.Empty;
>
> System.Data.DataSet dsSalesRepAdapter =
> Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
> "SalesRepAdapter", out recSelected, false, whereClause);

You're filling the combo with a query but the query condition (whereClause)
is set to blank. Try setting it to something like:

whereClause = "RoleCode like 'Eng%'";

It's not a C# thing really, you just need to pass the adapter the correct
selection.

Mark W.


[Non-text portions of this message have been removed]
Just getting back to this after the holidays.



I changed -

> string whereClause = String.Empty;

To-

string whereClause = "RoleCode like 'Eng%'";



When I open the program I get the following message-

Invalid query: where Company = 'CIGNYS' and (RoleCode like 'Eng%') BY Name.



No records are then being passed through the adapter.



Mike



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Mark Wonsil
Sent: Wednesday, December 26, 2012 9:29 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Re: Limit records being loaded in UltraCombo field





Hi Mike,

> string whereClause = String.Empty;
>
> System.Data.DataSet dsSalesRepAdapter =
> Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
> "SalesRepAdapter", out recSelected, false, whereClause);

You're filling the combo with a query but the query condition (whereClause)
is set to blank. Try setting it to something like:

whereClause = "RoleCode like 'Eng%'";

It's not a C# thing really, you just need to pass the adapter the correct
selection.

Mark W.

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]
Change Like to MATCHES
Change % to *

--- In vantage@yahoogroups.com, "Mike Numbers" wrote:
>
> Just getting back to this after the holidays.
>
>
>
> I changed -
>
> > string whereClause = String.Empty;
>
> To-
>
> string whereClause = "RoleCode like 'Eng%'";
>
>
>
> When I open the program I get the following message-
>
> Invalid query: where Company = 'CIGNYS' and (RoleCode like 'Eng%') BY Name.
>
>
>
> No records are then being passed through the adapter.
>
>
>
> Mike
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
> Mark Wonsil
> Sent: Wednesday, December 26, 2012 9:29 PM
> To: vantage@yahoogroups.com
> Subject: Re: [Vantage] Re: Limit records being loaded in UltraCombo field
>
>
>
>
>
> Hi Mike,
>
> > string whereClause = String.Empty;
> >
> > System.Data.DataSet dsSalesRepAdapter =
> > Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
> > "SalesRepAdapter", out recSelected, false, whereClause);
>
> You're filling the combo with a query but the query condition (whereClause)
> is set to blank. Try setting it to something like:
>
> whereClause = "RoleCode like 'Eng%'";
>
> It's not a C# thing really, you just need to pass the adapter the correct
> selection.
>
> Mark W.
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
> [Non-text portions of this message have been removed]
>