Ok, this one has me good and stumped. I’m hoping someone might help me debug this one.
I’ve automated our Product Configurator and this all works well for the best part. I’ve recently rewritten this into functions which, again, is working really well. However, I’ve got a problem with a couple of products that use a smart string to switch part numbers.
When manually running the configurator, the new part number is constructed from a single textbox. The smart string then updates the part number as the configurator completes.
During our automation I’m having trouble running the method responsible for updating the part number. I think I’ve tracked down what I need to run but I’m not able to work out the format of the parameter I need to feed into this method.
Running my trace log, I think the method I need to use is Erp.BO.ConfigurationRuntimeSvc/SuggestSmartString.
Looking at the swagger, one of the parameters needed is:
After a little digging, I’ve worked out I need to add areference to Erp.Shared.Lib.Configurator and use a list with a PCKeyValuePair as this parameter. I can’t find what information this key/value is looking for though. I’m guessing it’s the textbox name and value, but I can’t get it to work.
I can code it as follows:
System.Collections.Generic.List<Erp.Shared.Lib.Configurator.PCKeyValuePair<System.String,System.String>> lPCKey = new System.Collections.Generic.List<Erp.Shared.Lib.Configurator.PCKeyValuePair<System.String,System.String>>();
Erp.Shared.Lib.Configurator.PCKeyValuePair<string,string> pcKeyPair = new Erp.Shared.Lib.Configurator.PCKeyValuePair<string,string>();
pcKeyPair.Key = "textboxname"; // not sure about these but I feed them in
pcKeyPair.Value = "textboxvalue"; // as strings with the correct name and value of the textbox
lPCKey.Add(pcKeyPair);
boPC.SuggestSmartString(sconfigID, false, ref tsPcSeq, "OrderDtl", tsPCRuntime.PcValueGrp[0].RelatedToSysRowID , lPCKey, out sNewPN, "/0", 0);
My trace log for this method doesn’t show values that are passed through, it only shows this:
<parameter name="smartStringValues" type="System.Collections.Generic.List<Erp.Shared.Lib.Configurator.PCKeyValuePair<System.String,System.String>>"><![CDATA[System.Collections.Generic.List`1[Erp.Shared.Lib.Configurator.PCKeyValuePair`2[System.String,System.String]]]]></parameter>
How am I able to find what information I need to pass into this parameter???
@josecgomez hope you don’t mind the tag but you’ve helped me lots in the past! Any ideas? Anyone else?
I hope this all makes sense - it’s late here and my brain hurts!
Thanks in advance!
Ryan.