going to look at this again tomorrow. this should be simple, at least logically. the syntax seems to be killing me / us…
for eh most part, this works. and has worked fine up until now.
it works as I want (mostly) if I leave off the ‘else’ part. it’s this ‘else’ that seems to be the bug… to spit out table data if a condition is met, or to force the variable to “XXX” if that condition is not met…
So, I’ll be looking at how to write this all with 'if -then ‘else’ as opposed to having the switch function in the middle…
I was initially wondering if you can put a ‘switch’ in the middle of an ‘if-else’ function…
Hi Mark,
I’m back at doing another congfigurator, and have some time to try & learn a bit more.
But am getting frustrated with some simple tasks:
You mention an “enable” property. I can’t find this in the expression drop-downs… can you be a little more exact in what I should be looking for / using?
What I am trying to do, i feel is super simple. Have a check box turn on or off the ability to enter text in a character box.
if the check box = true (checked)
then text box is null; no user entry allowed.
I have:
Inputs.CH_CustCode.Value = “”;
in the check box ‘On Field Change’, so that it erases whatever was in the box initially, but I just can’t find the 'make the text box ‘read only’ variable / value.
I’ve tried an if / else statement, but that doesn’t’ seem to work either. Or, I have the wrong ‘bit’ in the code…
I am having a similar problem. I need users to be able to change a choice they’ve made. As things stand, you have to close out the Cinfig, and start again. Our EPICOR guy gave me this code:
Inputs.cmbYear2.ReadOnly=false;
Inputs.cmbMake2.ReadOnly=false;
Inputs.cmbModel2.ReadOnly=false;
Inputs.cmbCabConfig.ReadOnly=false;
Inputs.cmbRearAxle2.ReadOnly=false;
Inputs.cmbBodyType.ReadOnly=false;
Inputs.cmbGasD.ReadOnly=false;
Inputs.cmbBrand.ReadOnly=false;
The problem is that when I drop it in, each line bombs out because of the “ReadOnly”. So of course I went to the Inputs to see what my choices were![image|643x500]
…and nothing here would give the the desire result.(upload://mqNAIwoFsOHCUE973rHI8bythwT.png)
I went a step farther and dropped it into Visual Studio, and got this:
Let me back up a second … the ReadOnly property expects an expression. So you wouldn’t assign it a value like true or false, but rather an expression that returns true or false.
EDIT
You can’t assign the ReadOnly property outside of the control itself.
You need to select the control, then bring up the expression editor for the ReadOnly Property
Then enter your logic for when that control needs to be read only or not.
Another question, I need the remaining inputs to refresh after the change is made to an input, so do I add my “refresh” to each “readOnly” expression as well?
I’ll jump in here just to get some more points for being active. You can absolutely set the other inputs to refresh with the following code.
Refresh.DynamicList();
My advice to you thought would be not to put it in the read only section as that section of code is ran anytime a change is made anywhere in the configurator. I would recommend putting it in the ‘On Field Changed’ section of code. I would also rccomend trying to be more specific with the inputs that are getting refreshed to try and reduce any unnecessary code from running and slowing down the configurator.
An example of how to select specific inputs to refresh is the following:
I already have the in the OnField for each input, my goal WAS to make it refresh each time a change is made. This is a Config to build trucks. If a sales person accidentally selects the wrong CA(Cab to Axle length) when they go to correct it, I need everything after it to refresh or the remaining choices won’t apply.
Inside of the yellow box is the main “keys”, I have the first 5 inputs Concant’ed into Key1, but I needed the ReadOnly Expression on everything down to the “Brand”.
This lets you control the fields that are getting updated so that if the change to CA doesn’t affect some fields they don’t get updated.
If it is in the read only then even when they are selecting something like Fire Extinguisher it will go and try to refresh all the dynamic lists.
Using a car/trunk type example if you have three combo boxes of Make, Model, and Engine size, when you select the model you would want the engine size combo box refreshed but not the Make. Refreshing the make would just be code that has (small) potential to cause issues because you don’t want the configurator to take forever to run and you don’t want it to refresh selections that don’t need it.