Launch Part Configurator programmatically

Is there a way to launch a configurator programmatically? I would like to launch the part configurator from the part entry screen by placing a button on the part entry form.

You can open any form programmatically in c#. Something along these lines:

ProcessCaller.LaunchForm(oTrans, “IMGO3400”,
edvQuoteDtl.dataview(edvQuoteDtl.row)(“partNum”))

Where IMGO3400 is the name of your menu item.
Jose C Gomez
Software Engineer

There are many examples here on the forums - seach: processcaller. I also imagine it would be possible to create a context menu for it (on right click of PN) if it doesn’t already exist.

3 Likes

Is this the same as trying to launch this runtime: Erp.UI.ConfigurationRuntimeentry?

I have setup a menu item for it and then tried launching it programmatically like this:

ProcessCaller.LaunchForm(oTrans, “MYMENUID”,“PARTKEY”);

It throws an exception stating that it needs the Erp.UI.App.ConfigurationArgs object. How do I pass in the ConfigurationArgs to the call?

the last parameter (PARTKEY) should be an LFO. You may have to look at the code (using ILSpy, reflector, etc) of the desired target form to see what it expects. If there is no specific handling, you can write your own

Below is an example of an LFO, it is not intended as a direct solution

LaunchFormOptions lfo = new LaunchFormOptions();
lfo.IsModal = true;
lfo.ValueIn = "PARTKEY";
ProcessCaller.LaunchForm(oTrans, "QAGO0070", lfo);

Then inside the target form load event, you could handle the data you pass in

1 Like

Thanks. I’ll give it a try. I think it is looking specifically for this type: Erp.UI.App.ConfigurationArgs as the param. I cannot locate where the class is located.

image

What would be the business case? There are context variables that might be invalid if you’re not running it from particular object: Quote, Order, Job, etc. I imagine that most of the document rules would not work. Just curious.

Mark W.

Mark brings up a great point. If that screen has different contexts, then it may beneficial to walk it thru (and trace) from the closest business case.

I would like to be able to launch the Part Configurator from Part Entry. Currently, in E10 based functionality, it is available only from Quote Entry and Order Entry.

I would like to add a button on the part entry form and launch the Configurator form on button click.

When I was poking around, I noticed that there is a ConfiguratorAdapter with the method .StartConfiguration. Would this solve my problem? If so, is there any documentation on how to properly call this method?

Thanks for all your help.

Thanks. I thought I have referenced all the DLLs. I see the class now. Will play around with it.

Chris,

Can you provide a code sample how to populate the properties for ConfigurationArgs? What is the minimal requirement?

Hmm I wonder if there is a field somewhere that will enable the OpenWith functionality for what you are looking for. Is there an OpenWith on the Quote/Order entry screens for the Configurator? If so, let’s bark up that tree.

Re: sample code, I 've never used that particular flavor of what I assuming is a descendant of LaunchFormOptions.

It would really require you to look at the source of the form in question to see what/how it is processing.

Here is my code (that gets to a certain point then throws an error ) – I am plugging in some hard-coded value just to try to get it to launch.

Guid rowID = System.Guid.Parse("551DABBB-DC2C-4411-8E66-55F3D069CAA9"); //Part_Row.CurrentDataRow["SysRowID"].ToString());
	Guid foreignSysRowID = System.Guid.Parse("8350D2FE-E6F3-49AB-9C19-01B01F8C7D40");

	Erp.UI.App.ConfigurationRuntimeEntry.ConfigurationArgs args2 = new Erp.UI.App.ConfigurationRuntimeEntry.ConfigurationArgs(Erp.UI.App.ConfigurationRuntimeEntry.ConfigurationArgs.ConfigurationMode.Production, "Part", rowID, false, "", "", "");

	args2.SourceKey = new Dictionary<string, object>() { { "SourceSysRowID", "152204A5-A01C-435B-A539-C3FB544B996C" }};
	args2.SourceTableName = "PartRev";
	args2.RelatedToTableName = "Part";
	args2.RelatedSysRowID = rowID;

    ProcessCaller.LaunchForm(oTrans, "CON1000", args2);

here is the error details:

Application Error

Exception caught in: Epicor.ServiceModel

Error Detail

Message: Object reference not set to an instance of an object.
Program: Epicor.ServiceModel.dll
Method: ShouldRethrowNonRetryableException

Client Stack Trace

at Erp.Services.BO.ConfigurationRuntimeSvc.PreStartConfiguration(ConfigurationRuntimeTableset& configurationRuntimeDS, ConfigurationSummaryTableset& configurationSummaryTS) in C:_Releases\ERP\UD10.1.500.18\Source\Server\Services\BO\ConfigurationRuntime\ConfigurationRuntime.cs:line 201
at Erp.Services.BO.ConfigurationRuntimeSvcFacade.PreStartConfiguration(ConfigurationRuntimeTableset& configurationRuntimeDS, ConfigurationSummaryTableset& configurationSummaryTS) in C:_Releases\ERP\UD10.1.500.18\Source\Server\Services\BO\ConfigurationRuntime\ConfigurationRuntimeSvcFacade.cs:line 86
at SyncInvokePreStartConfiguration(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func2 func) in C:\_Releases\ICE\3.1.500.18\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59 at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func2 func) in C:_Releases\ICE\3.1.500.18\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 47
at Epicor.Hosting.Wcf.EpiOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in C:_Releases\ICE\3.1.500.18\Source\Framework\Epicor.System\Hosting\Wcf\EpiOperationInvoker.cs:line 23
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)
at Erp.Proxy.BO.ConfigurationRuntimeImpl.PreStartConfiguration(ConfigurationRuntimeDataSet configurationRuntimeDS, ConfigurationSummaryDataSet configurationSummaryTS)
at Erp.Adapters.ConfigurationRuntimeAdapter.PreStartConfiguration()

I just can’t remember who but there is a person on this list who was one of the first to use the Product Configurator to load MOMs to a Part Revision.

Mark

I have a similar requirement of which i am most of the way there. i am looking to launch the configurator automatically when a configurable part is entered. I have followed the above and got most of the way. The only thing that differs between the trace on the standard configure button and my code is that the configure button passes the partnum and revnum into the PreStartConfiguration method. I wonder if anyone has gotten past this?