Maintaining oTrans object

I am operating inside the Script class of my customization and then I go to a custom class inside the same customization and do some stuff. From there I return to my Script class and the oTrans object is no longer defined. I realize that I will probably have to pass the already defined and working oTrans object to the custom class and then back to the Script class when appropriate but am unsure exactly how to code that. Does anyone have an example that may help me? I’m sorry if this seems elementary and perhaps I am a bit myopic but I can’t seem to get over this hurdle.

It may help if you have some sample code or an outline of how you’re accessing the oTrans object and how you’re moving from the Script class to your custom class. I can’t imagine there ever being a situation where changing scope back and forth would invalidate the oTrans object as long as you’re calling into your custom class and then returning out of it.

1 Like

That’s part of the issue. As a relatively newcomer to Epicor I am not sure how the original class is accessing or defining oTrans. The custom class is an entirely new custom screen drawn on top of the original Epicor screen. Why it was done this way I don’t know but the screen is very busy. Maybe that’s why. Since my company doesn’t want to see the original Epicor screen, on this custom screen I have added an UltraGrid with checkboxes in one column. When a checkbox in this column is clicked I handle a ClickCell event and then want to take data from the clicked row back to the Script class. That works okay but I lose the oTrans in the midst of this. The code is long and arduous to follow and was written many days before I arrived on the scene.

Sounds like it was made harder than it needed to be. There are a couple threads about making a UD screen into a blank page. It should not need a new class either.

1 Like

Thanks guys. I think I have it solved. Jason, you are right. They made it harder than it should have been when whoever wrote this did it. I wish I had the time to redo it. Maybe sometime down the road.