Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Bronze Contributor
Posts: 125
Registered: ‎12-09-2010

7.5.4 Web - Deleting unused code

I have a combo box on a web form.  I needed some stuff to occur on changing the combo box value.  I changed my mind a couple times about what kind of action I wanted performed on the onChange event, and I went back to a code snippet I had used earlier.  Even though it was the same control, with the same code - building it then complained that the event of the same name already existed.


If you change the action from, say, a code snippet to a business rule, and then back again, it doesn't give you the option of re-using the settings that were in place before first changing the action to a business rule.  And obviously it doesn't delete the code like I assumed it would.


What is the proper procedure here?  Does "removing" the code snippet steps before changing the rule properly delete the code?  Is there a way of properly deleting the code in the current situation?


I got around the build error by deleting the control, and recreating it with a different name.  Would that have deleted associated code?

Copper Super Contributor
Posts: 99
Registered: ‎07-04-2009

Re: 7.5.4 Web - Deleting unused code

Try the following.


1. In App Architect goto Tools --> Build Settings and take note of the Build Path.

2. Exit App Architect.

3. Delete everything int eh BUild Path from (1)

4. Start App Architect and compile and deploy.


Hope this helps

Chris Grant
Plus Consulting
Copper Super Contributor
Posts: 16
Registered: ‎09-13-2012

Re: 7.5.4 Web - Deleting unused code

[ Edited ]

I have a similar problem like the OP. I deleted the OnLoad-Event of the SalesOrder-Details containing the Code Snippet (not C# Code Snippet). Then I removed some of the controls and now everytime I want to Build the snippet libraries I get the same error that some codesnippet could not refer to some control because it's missing.


I have learned today that you have to delete the code snippet steps before deleting the code snippet itself. If you forgot to do this, the only thing you can do is searching in your VFS (or LFS) for the files that hold the code and delete them or rename them with another extension (like *.bak or *.old or else)


And deleting the content of the build directory didn't work for me at all.


And I still don't know how you could reuse those codesnippets like the OP suggested.

Bronze Contributor
Posts: 125
Registered: ‎12-09-2010

Re: 7.5.4 Web - Deleting unused code

Thats because I didn't actually reuse them. The code was simple enough for me to rewrite, I was mostly toying with different actions to see what would work better. But that was the problem, by rewriting the code, it told me that I was giving my objects names that already existed and stuff like that.

I also realized that you need to be very careful about how you delete stuff in Application Architect.