E10 Configurator Search Button

Hi,

I want to add a search button on the from page of my configurator, to search for previous Sales order numbers and lines, and then return data from the OrderDtl table and populate the configurator character and numeric fields.

Is this possible, if so can anyone help with the code on the 'On Clcik of the button

Thanks

It sounds like you’re trying to do something that may not be possible the way you want. Within the Product Configurator there are only 2 places you can call server side expressions (and hit the database) - On Load and On Save; essentially before you enter the configurator and when you leave the configurator. The front page of the configurator is too late and you can only use client side expressions here. You could use a lookup table at this point but it sounds like the amount of potential data you are wanting to search is not going to make that a feasible option.
Unless I’m misunderstanding what you want to do, it sounds like you’re trying to make the configurator do something it’s not meant to do. The only thing I could suggest right now is a highly filtered query On Load that would plop the dataset into an input on the first page that would allow the user to select from a small set of options. Even this does not sound ideal, but that’s my best guess for now.

You can use a server UD method and call it on the button click. You will need to send your input search parameters and then can return the results. Within the UD method you can use standard business objects to handle the search for you and this works a lot like using a business object within a BPM (add reference and using statement) then make service calls. You can also use dynamic queries within the UD method or direct queries.

Yes - I agree with UD Method. I was thinking it earlier and somehow forgot to mention that in my original post. (Late nights, early mornings and only one pot of coffee will do that to ya!) :wink:

1 Like

I do this all the time. There are a few ways to go about it. I populate a drop down that I have filtered as well as just populate a field with a single result. As someone mentioned, you can only call from certain places, but there are ways around that. I never let it stop me.

  1. Drop Down Box
    I simply create two fields one I call “search” (simple text box) and one I call say “Part” (Drop Down Box w/ query) The “part” drop down has the query set up to pull from the DB. I use the “search” field as a filter inside the drop down box criteria.

  2. Button – Code on click
    You can use UDMethods, which can be called so that you can be in a place to hit the DB. You can have data returned. I usually send myself a string back and then parse it out.

Or You can make the configurator re-run an event. I use this when I want the code re-run due to a change or new selection.
Refresh.Events(“Page1Load”);

It is not as hard as it sounds. You simply code the button and work thru the limitations. I have all kinds of examples and code if you need it. You can even code your configurator to automatically do this w/out a button if you want it to be dynamic.

Brenda J. Mohr
Humtown Products

That sounds exactly what i need do you have an example of the code for the search button ?

In order to get you specific code, I would need to know what you are actually trying to do, but here is my example:

ON CLICK

                            /***** Populate Information *****/
                            Inputs.myParse.Value = UDMethods.Get_Tool_Desc(Inputs.HToolNum.Value);
                            UDMethods.Pop_ToolingInfo();

You will need to create the variable myParse (I have this set to invisible and just re-use it). Inputs.HToolNum.Value is a field the user populates. This is the tool I need to get information on.

Looks like part of the email was cut off… Here is the code for the UD Methods:

The UD Method - Get_Tool_Desc()

string CompanyID = “10”;

Erp.Tables.Resource Resource;

string myToolData = string.Empty;

var Resource_Recs = (from Resource_Row in Db.Resource
where Resource_Row.Company == CompanyID
&& Resource_Row.ResourceID == ToolNum
select Resource_Row).FirstOrDefault();
{
var ResourceRow = Resource_Recs;
if (Resource_Recs != null)
{
myToolData = Resource_Recs.Description; /*** (0) Tool Description /
myToolData = (myToolData + “|” + Resource_Recs.ShortChar02); /
(1) CustID /
myToolData = (myToolData + “|” + Resource_Recs.ShortChar03); /
(2) Ejection /
myToolData = (myToolData + “|” + Resource_Recs.Number04.ToString());/
(3) Cavities /
myToolData = (myToolData + “|” + Resource_Recs.ShortChar04); /
(4) Box Type /
myToolData = (myToolData + “|” + Resource_Recs.ShortChar01); /
(5) Machine /
myToolData = (myToolData + “|” + Resource_Recs.Inactive.ToString());/
(6) InActive /
}
} /
Resource ***/

return myToolData;

The UD Method - Pop_ToolingInfo()

string [] myArray; myArray = new string[7];

myArray = Inputs.myParse.Value.Split(new string[] { “|” }, StringSplitOptions.None);

            Inputs.HToolDesc.Value = myArray[0];
            Inputs.resCustID.Value = myArray[1]; /*** Resource Original Values ***/
            Inputs.resEject.Value  = myArray[2].ToUpper();
            Inputs.resNumCav.Value = System.Convert.ToDecimal(myArray[3]);
            Inputs.resBType.Value  = myArray[4].ToUpper();
            Inputs.resMach.Value   = myArray[5];

if (Inputs.HToolNum.Value == “T-00000”) {Inputs.DataCurTool.Value = “NEW TOOLING REQUESTED”;}
else
{
Inputs.DataCurTool.Value = "CUSTID: " + Inputs.resCustID.Value + “\r\n” + "MACHINE: " + Inputs.resMach.Value + “\r\n” + "Box Type: " + Inputs.resBType.Value + “\r\n” + “Cavities: " + Inputs.resNumCav.Value + “\r\n” + “Ejection: " + Inputs.resEject.Value;
if (myArray[6] == “False”) {Inputs.ToolStatus.Value = false;}
if (myArray[6] == “True”) {Inputs.ToolStatus.Value = true;}
}
if ((Inputs.HToolNum.Value != “T-00000”) && (Inputs.reQuote.Value != “REQUOTE”))
{
if(MessageBox.Show(“This is an Existing Tool. Are you Re-Quoting an Existing Job?”,“VERIFICATION: Re-Quote”, MessageBoxButtons.YesNo) == DialogResult.Yes)
{
MessageBox.Show(“Please fill in the Part to be Re-Quoted.”);
Inputs.reQuote.Value = “REQUOTE”;
Inputs.Part2ReQuote.Invisible = false;
}
}
Inputs.Ejection.Value = Inputs.resEject.Value; Inputs.NumCavity.Value = Inputs.resNumCav.Value;
Inputs.BoxType.Value = Inputs.resBType.Value; /Inputs.Machine.Value = Inputs.resMach.Value;/
Inputs.NumCavity.Label = (Inputs.resBType.Value == “FAMILY”) ? (“Number of families this tool makes: *”) : (”# Cavities: *”);
Inputs.ToolStatus.Invisible = (!Inputs.ToolStatus.Value);
Inputs.curToolMach.Value = Inputs.resMach.Value;

if ((Inputs.CustID.Value != Inputs.resCustID.Value) && (Inputs.HToolNum.Value != “T-00000”))
{
MessageBox.Show(“Tool Owner is NOT the same as the current customer. \r\n Please verify this is the tool you wish to quote. \r\n Ownership WILL BE changed to match this quote upon customer approval.”,“WARNING”);
}

Brenda J. Mohr
Humtown Products
Phone: 330-482-5555

Brilliant, I am on customer site but I will look into this next week,

Thanks