In order to help you trace out error messages in the future, please add the BPM Name to the bottom of any displayed messages or Exception messages. This will help you next month/year when you have a user say “The computer says I cant do xyz”. You will then know which of your custom BPMs is causing the message, and you won’t accidently call Epicor to ask them why.
The way I have done this for years is to put the full name at the bottom of the message… something like this:
Better yet, actually show the BPM name in the trace log and server log instead of an undecipherable hexadecimal key that does’t correspond to the BPM’s GUID or anything else…
Thanks @LBARKER for this. I knew there was probably a way… this would make things standard. In fact you could make a standard widget that you simply copy in that would do this every time for you.
By the way, did you know you can simplify your c# code like this? With String interpolation you can now embed the variables into the string by preceding the quote with a dollar sign, and then put the variables into curly brackets. This also replaces the string.format command if you ever use that. (read more here: https://www.dotnetperls.com/string-interpolation)
String interpolation is also not supported in Product Configurator. But you can use the String.Format option. My reason for using either interpolation or string.format is because it is easier to see where the spaces and symbols will show. I actually believe that there is no significant performance reasons why to choose any of these over the other. Resulting value is the same.
OH… there is one reason… the first two options will auto format your dates and numbers for you without needing to specifically say “convert”…
//below is interpolation method:
string x = $"test: {variable1} test2: {variable2}";
//below is string.format method
string y = string.format("test: {0} test2: {1}",variable1,variable2);
//below is old school:
string z = "test: " + variable1 + " test2: " + variable2;
The new application tracing stuff works really nice for this too. You can create your own custom traces and enable or disable them at will on the appserver.
I believe it is always “True”… but you could always do something different like:
bool myBoolValue = true;
string x = "the value is {((myBoolValue) ? "T" : "F")}";
//x is now equal to "the value is T"
string Y = "the value is {((myBoolValue) ? "1" : "0")}";
//Y is now equal to "the value is 1"
string Z = "the value is {((myBoolValue) ? "yes" : "no")}";
//Z is now equal to "the value is yes"