Control with specified EpiGuid property does not exist

Sharing this as it took me all morning to figure out. Issue was some of our customizations had some old custom code that somehow was working even though it shouldn’t have:

EpiShape eshUrgent = (EpiShape)csm.GetNativeControlReference("85bbe452-61cb-40dc-85ba-88724b83c7a5");

This is trying to get at a custom control (not a native control). It was working in Kinetic so long as I didn’t change anything in the script editor. Guess it was precompiled.
Once I tried changing the code (any minor change, eg adding a MessageBox) I would get the
“Control with specified EpiGuid property does not exist.” error message, even though that was the correct GUID.

So it turns out that the GetNativeControlReference function doesn’t work for custom controls. We can get at the control like this instead:

EpiShape eshUrgent = this.eshUrgent;

Clue was at bottom of this thread… Thanks @Jason_Woods. Verification on Customization

Also, after you save the customization, the code doesn’t really update onto the program until you reload it. So have to completely close the program, relaunch to test your work each time. I keep forgetting this…

2 Likes