QuoteEntry customization create misc charge

Hi all!
I am working on a customization for the QuoteEntry.
Baiscally I have done all the logic to get a field I want (cost of the extra painting).
Now I need to create a misc charge line on the order in which I can add my cost.

How can I create a misc charge line from code??

Thank you all!

Have you tried creating one manually with a trace log capturing what the client is doing?

Between that and the Object Explorer, you can probably get most of the way and most of us find we’re glad of the experience figuring it out.

I didn’t do it cause I don’t have to know what the client is doing.
Basically I created a button on the QuoteEntry which launch my code.
The code calculate a field for me that is the cost of the extra painting.
Now with that I need to create a MiscCharge (of extra painting) in which I’ll insert the price calculated before.
I wanted to do this continuing my code on the customization.
If this can’t be done I thought I can store my price in a field that I don’t use in the QuoteEntry, then a BPM (which is triggered by the changing of the field) could create a MiscCharge and complete that with the price.

I prefer the first way tho

I know it can be done, but I also know it’s wise to know what the Epicor client does when the user performs an action you want to do for them automatically even if you don’t actually do exactly the same. Particularly in the Quote system, which can bite unwary developers.

For a start, there are different methods and views depending on whether you’re wanting a header Misc or a line Misc. You can check oTrans.GetNewMisc() and oTrans.GetNewHeaderMisc() in Object Explorer, though they aren’t the only way of getting want you want done.