I’m building a generic configurator that will be used for multiple parts. When I load the entry page, I need to know what the “target part” that is being configured is, so that I can adjust the page accordingly. Initially I was using Context.PartNumber, and that worked well when testing just one part number. Now I have a top level part number with subcomponents that are using the same configurator. I can page through the various parts that are linked to the configurator (not all of the subcomponents are), but Context.PartNumber only gives me the top level part number. Is there a way to get the current target sub-component part number for the current configurator page that’s being displayed?
Context.PartNumber is always set to the part number for the TOP level of the configurator. If you have a multi-level configurator, then this can be a challenge. I personally have not done this much (except in experiments). I am sure that someone out there has found a way to pass info via global variables.
@jdewitt6029 and @skhan and I all had this struggle as we used a ton of sub configurators and wished so badly that Epicor could tell us if we were going to a new configurator and if so, what part we were configuring, but I think we had to write that to a delimited string dictionary that @jdewitt6029 then retrieved values from at different points in the configuration process using methods.
@utaylor yes we did. We capture the ‘target part’ or what we call ‘base part’ and save that to a global variable. In subsequent sub configurators we bind that global variable to an input that is hidden in a second page of each configurator (what we called our debug page). That way we can use it in the logic for the current configurator to make decisions. We also built a line description that is made from all the choices in all the configurators in the method. To do that we also use a global variable and store in it a dictionary string which we parse out to get any of the information. Again, we also use that for making decisions in sub configurators. Pretty handy.
Much easier to explain in a short video. Here is an example of one of our configurators with sub configurators. At one point i will go to our hidden debug page and highlight our dictionary string and model number (target part).
Yes, the configurator is running slowly. that is because I am doing this on a system i have yet to apply the Windows fix for speed.
You may also notice i don’t choose something from every drop down. If there is only one option to choose from in a dropdown, i have it auto selecting that one item.
Thanks @jdewitt6029 that looks like what I’m needing. The video was very helpful. What’s the syntax to capture the base part and save it to the global variable? Also it looks like you have a different configurator for each part, with a similar layout. I’m actually using the same configurator for all parts, and using a UD table to populate what shows up on the entry form, based on the base part number.
We have different configurators for different part types (parts of a chair or table). A part gets linked to the configurator it needs to be linked to by eng (the ones who create our parts and methods).
You get the base part number like you were using Context.PartNumber but you assign it to an input which is linked to the global variable
First, create a global variable (Actions → Global Input Variables).
Next, create an input (I put it on another page and hide that page or on the same page and hide the input)
Next, change the Global Input properties of that input to use that global variable you created in first step.
Now all you need to do is assign the Context.PartNum to that input in the code some where.
It will be assigned to that global now and your sub configurators will be able to use it.
Such a nice configurator
@jdewitt6029 Do you have a way to handle a user going backwards through your configurator? Thus possibly having to modify the middle of your string?
Yes. UD method that takes the string, converts it to a dictionary. We then can replace what ever value we want. MethodName(input.strBuild.value, key, value). Returns the input string which gets reassigned to input.strBuild.value.
could do the epiusers panel on the configurator.
@jdewitt6029 I tried to use Context.PartNum
in the read-only expression of an input and got a compiler error. Is this why you copy it to a global? Where and how do you get it into a global?
Context.PartNum is a read only field. It contains the base part number for the configurator, which the original calling part number on the Quote (or Order or Job).
To use a Global Variable, first create it, it is an option in the Actions menu of the Configurator Designer. Then you assign the Global Variable to a Text Box on your form. When you complete the form, it copies the text box value to the Global Variable, and the next page or the next configurator loads, it loads the global variable. If the global variable is linked to a text box on that form, it automatically stores the global variable’s value to that text box.
That doesn’t address my question.
Aha… to work around the bug in read-only expressions, you can write it to an invisible input in your page load expression, then use that input in your read-only expression.
Yes, that is what Joe ended up doing is writing it to a global string that gets carried throughout the subconfigurators @jdewitt6029
Exactly. (sorry for the slow response, I was out on PTO)
Word from support is that they can reproduce the issue in the classic UI, but it works in Kinetic so it probably won’t be fixed.