OK, am new to programming, so the syntax eludes me.
I have one combo box, that sets a part number string based off a look up table (those I can do!) But I want to be able to have a check box that ether allows this, or allows for a manual part entry, and override the part number string.
it shouldn’t be hard to do.
the two combo boxes should have a line of code that says:
if check box = true, then PCLookup “table”, “value”…
else variables = user input string;
How do I get the combo box to act if the check box is true / false
You can disable a control based on a value of another control. You can set the Checkbox and then use the Disable formula property to enable or disable the ComboBox or the Text box (for the part number) based on the value of the checkbox.
Will that work?
Later, you’ll want logic that selects the combo box value or the text box value for your part based on the value of your checkbox.
You can try using dataview information before dropdown, or you can use special filtering syntax in the properties window of dropdowns, but I don’t remember it. I think that’s Epicor documented somewhere
Yeah, I get that I can control things, and in this case one will control the other, and either allow for a user input or read it off a table.
If check mark = false, then read off the table
if check mark =true, then allow user to input a string, and substitute that string in place of string from table.
I just don’t know how to write that in C#… or what I’m missing in the expression…
return Inputs.CH_Override.Value = true;
doesn’t seem to work, I seem to be missing something…
Dropdowns can be dynamic, with multiple sources. And you setup rules for which source to use. That checkbox could be use in the selection of which “source”
Most of coding in Configurator isn’t about being a c# syntax wizard, it’s about knowing where to put your code. Also, there are always many, many different ways of doing the same thing.
What Mark said seems like your easiest option; I’ve done similar things several times. Put code on the “On Field Changed” action of the checkbox to set the visible or enable/disable property of your ComboBox and TextBox appropriately. Always make sure to code for all user scenarios (checking and unchecking the box in this case). People, myself included, often think the user will follow a linear path through their Configurators and they forget to code for when users change their mind on an input or go back a page, etc.
You would need to add a textbox to manually enter the part num, and then toggle the read only via the checkbox. Ideally, if the user selects a value via the combobox you would then auto-populate the textbox with the value, that way you
can just pass the textbox to record creation as the input string, or the method rule if the part num is job mtl.
I don’t have Configurator access now but go to your Configurator Designer screen, click on your CB_Override field and post a screen shot being sure to include the properties panel on the right-hand side.
this is in the ‘On Field changed’ action (I tried in it the ‘On field validating’ , and it crashes Epicor!)
now, while it does allow me to enter the string from CB_Override.Value, it will only grab it when I hit the check box. But the check box doesn’t turn on or off, it only seems to dump the value of CB_Override into CH_Jet.
I feel I ether am missing something to revert back, or the if/then statement is missing something to continuously check if CB_Override is true or false… I kinda feel there needs to be a ‘page refresh’ in the on field validating of both the CB_Override & CB_Jet_Override. But am baffled how ask for this…
I get the following error with this line of coding:
The following errors were found during compile:
CS1061 - c:\Users\pshepherdson\AppData\Local\Temp\7\ConfigDump\Client_paul_testInputEventCollection.cs (60,31) - ‘Erp.UI.Cfg.TEST92e046bb88a74b178287d9e42914de43._paul_testInputControlCollection’ does not contain a definition for ‘Ch_Jet_Override’ and no extension method ‘Ch_Jet_Override’ accepting a first argument of type ‘Erp.UI.Cfg.TEST92e046bb88a74b178287d9e42914de43._paul_testInputControlCollection’ could be found (are you missing a using directive or an assembly reference?)
Total number of Errors: 1, Warnings 0
CS1061 - c:\Users\pshepherdson\AppData\Local\Temp\7\ConfigDump\Client_paul_testInputEventCollection.cs (60,31) - ‘Erp.UI.Cfg.TEST8d38ba89d1ee4d4582cea2c8cf039f14._paul_testInputControlCollection’ does not contain a definition for ‘CH_Jet_Override’ and no extension method ‘CH_Jet_Override’ accepting a first argument of type ‘Erp.UI.Cfg.TEST8d38ba89d1ee4d4582cea2c8cf039f14._paul_testInputControlCollection’ could be found (are you missing a using directive or an assembly reference?)
Total number of Errors: 1, Warnings 0
But i do use the list at the top “Available selections” to populate it.
I find it difficult as one screen allows you to type anything, while the expression builder seems to be missing steps & functions… so, I’m kinda bouncing between them… trying to figure out how to write an expression in one, and get the same results in the other…
So as you have seen/heard, Configurator logic is event-based. So you need to think about the state of the controls as the user clicks around the screen. In order to control the first pass through a configurator, I’ll set all the inputs except the first to Read-Only. This allows me to alter the controls as inputs are filled. You still have to be careful to reset fields if dependent inputs are changed. In this case, you Read-Only expression for the CB_Jet_Override is !BC_override (not the value of the override input). So when the user makes override True, the Read-Only expression is false and a user can fill the field. You can even hide the field in the On Field Change event.
So start thinking of events and not linear programming. If you’re using an expression multiple times, put it into a User Define Method and call it in the expression.
Hope this hints get you going. It’s a bit of a curve but after a bit, you’ll get it.