Cannot Access Customization After Bad Code Changes

I have two customizations on UD07. One is for end-users, the other is for admins (mostly access to additional fields). If I pull up the screen in Developer mode, and choose the version for end-users, I can click Tools > Customize and access the C# code. However, if I choose the Admin version, I get an error when clicking Tools > Customize, and do not get the C# code editor. This has happened in the past, but the Base version of the screen layout would be displayed. Then I would use Customization Maintenance to gain access to the C# code so I could fix it. Unfortunately, I’m not able to access my code changes so I can make any fixes. Has anyone run into this before?


## System Information ##
==================

AppServer Connection: net.tcp://ERPTEST01/DEVSSO
Form Name: Blanket PO Administrator Maintenance
Customization Name: Blanket_PO_Header_Admin
Menu ID: UD07ADMN
Software Version: 4.1.200.0

============

Application Error

Exception caught in: App.UD07Entry.UD07Form.EP.Customization.Blanket_PO_Header_Admin.CustomCode.3

## Error Detail ##
============
##!Message:##! Object reference not set to an instance of an object.
##!Program:##! App.UD07Entry.UD07Form.EP.Customization.Blanket_PO_Header_Admin.CustomCode.3.dll
##!Method:##! UD07Form_BeforeToolClick

## Client Stack Trace ##
==================
   at Script.UD07Form_BeforeToolClick(Object sender, BeforeToolClickEventArgs args)
   at Ice.Lib.Framework.EpiBaseForm.OnBeforeToolClick(String tKey, ToolClickEventArgs ea)
   at Ice.Lib.Framework.EpiBaseForm.handleToolClick(String tKey, ToolClickEventArgs ea)

What do you mean that you’re not able to access your code changes? Anytime I mess up my code, and can’t get it to open anymore, I have to use the Customization Maintenance to fix it. If that doesn’t work, then I have to rebuild it from scratch.

1 Like

Before you start from scratch, try right clicking on the screen and see if Customization appears there.

Sometimes an error will prevent “Tools” from working.

In customization maintenance you can export the customization to an xml file, fix any issues in the xml itself, and then re-import it.
That’s what I have done in the past.

2 Likes

Thanks to everyone for your insights. In the end, I opted to use Joseph’s idea of exporting to XML. However, rather than attempt to fix the code and fall into the same pit, I just saved the C# code portion and restore the original version from my last solution CAB file. Now it’s just a matter of figuring out how to do what I wanted in the first place! Cheers, Tony.