Product Configurator error: System.Diagnostics.Process.Start

We’re in the middle of migrating a customer from 10.2.700 on-premise to the cloud (currently Kinetic 2022.1.1). In the Epicor product configurator we used to be able to create a dynamic url based on some inputs and open it via System.Diagnostics.Process.Start. In their new cloud environment however, I cannot use System.Diagnostics anymore.

We’re still using the Classic UI (WinForms) product configurator. When i validate the code it will always give the following exception, either in OnFieldChange or Client-side UD methods.

Is there any workaround for this so we will still be able to open a specific url in the browser? I’ve already tried the default Browser control provided in the Product configurator, but this seems to use an integraded Internet Explorer browser which throws a lot of Script Errors…

You may want to check out @SteveFossey’s post, step 5.

How to: Build a custom form to print job-related documents and tags without logging in to a job - Code Review / Sharing - Epicor User Help Forum (epiusers.help)

1 Like

I do have System.Diagnostics as a using, and if I comment it out it fails, so I guess my use of Process.Start is still relying on that.

My knee-jerk reaction is that everything needs to be pulled back from the UI going forward - so when we get to this point I’ll probably be moving this into a function and putting the using statement and the action in there, and just calling it from my UI.

Assuming functions don’t lose the ability to get references to whatever, I imagine that’ll be the generic solution for pretty much everything.

1 Like

Functions run on the server. Not going to do you any good to start a process there, if it even lets you.

Thank you for your replies,

As @SteveFossey said, I don’t think the referenced post is relevant here, since it still makes use of System.Diagnostics.

Also, rebuilding this code to an Epicor Function wouldn’t solve this, since that will run on the server instead of on the client.

Actually in any case, the one I did is running on the server, because we don’t use clients on local machines - we’re using Remote Desktop Services. We don’t even have a pdf reader on the local machine, it opens the default pdf reader on the server and passes it back to the local machine in a RDS window.

Maybe some ideas here:

However, one can see the issue with allowing clients to start processes from a security standpoint.

When they get to the web client, your job becomes much easier. :wink:

1 Like

Hideous hackish way to do this… You should be able to use System.Diagnostics.Process.Start in a customization. You can use Process caller in a configurator (for now…). Make a customization that simply opens a URL and closes itself. You can pass the URL via LaunchFormOptions I believe. Its gross, but I think it could work in a pinch. I think you should be able to hide the form during one of the startup events, but it might flash for a bit.

:man_shrugging:

Edit: actually depending on what you want the URL to do, you might be able to open it directly with CEF in the customization.

1 Like

Thanks, i’ll try this!

1 Like

Let us know how it goes

Hey, this might be completely off the wall, but just reading @aidacra on New UI calling. He mentions in point 1 and 2 here:

that you have a url field on menu items. If a (custom UD) menu could point at a url, could you just use launchformoptions to launch that menu and let Kinetic figure out how to open the url?

Indeed a hacky way, but this worked for me!
Thanks!