Quote Form WorkSheet Events

We are on version 10.1.400.13 and are in the process of customizing the Quote Form Worksheet tab. I added 4 user defined fields that sums up and saves the total as the Misc Cost. How do I recalculate the worksheet with the new cost? Also, how do I find all the events used on the worksheet? Does anyone have any code they could share?

Thanks in advance,

Mel

When you say events are you talking about the business objects used? If so, you can enable tracing. This is under the main Epicor screen, under Tracing Options…enable it and then go back to the worksheet and do a mock quote….this will show you all objects used at each step.

Manasa

Clarification --> Main Epicor Screen --> Options --> Tracing options

Manasa

Hey Manasa,

I found one called CallQuoteAdapterRecalcWorkSheetMethod(). Is there a definition somewhere on what it does and how to use it?

Say for example I enter a material profit percentage and tab from that field. When I hit tab the cost is updated. What event or business object triggered the update?

Thanks

Mel

Yeah, that is where I fall short….hopefully someone else reading this can answer that question. Guys?

M. Manasa Reddy
P: 703.471.7145 x454
manasa@euclidsys.commailto:manasa@euclidsys.com

// You could do it this way BO
((Erp.Proxy.BO.QuoteImpl)this.oTrans.PrimaryAdapter.BusinessObject).RecalcWorksheet(oTrans.currentQuoteNum(), <insertQuoteLine>, <insertQtyNum>, oTrans.QuoteData);

// You could do it this way AD - Add QuoteAdapter to your Assemblies
((Erp.Adapters.QuoteAdapter)this.oTrans.PrimaryAdapter).RecalcWorksheet(oTrans.currentQuoteNum(), <insertQuoteLine>, <insertQuoteNum>);

Just replace the insertQuoteNum and insertQtyNum with your actual numbers.

Haso,

I am new to programming in C#. How did you find that adapter?

Thanks

Mel

There are several ways to trigger the Recalculation.

Unfortunately Epicor behind the scenes has made some of the useful methods private. In many other entry screens you could simply do this.oTrans.MethodName() yet for some reason the recalcWorksheet is private and has been since E9.

// You could do it this way BO
((Erp.Proxy.BO.QuoteImpl)this.oTrans.PrimaryAdapter.BusinessObject).RecalcWorksheet(oTrans.currentQuoteNum(), <insertQuoteLine>, <insertQtyNum>, oTrans.QuoteData);

// You could do it this way AD - Add QuoteAdapter to your Assemblies
((Erp.Adapters.QuoteAdapter)this.oTrans.PrimaryAdapter).RecalcWorksheet(oTrans.currentQuoteNum(), <insertQuoteLine>, <insertQuoteNum>);

// You could do it also this way using Reflection and accessing the Quote Transactions private recalcWorksheet method
System.Reflection.MethodInfo mi = typeof(Erp.UI.App.QuoteEntry.Transaction).GetMethod("recalcWorksheet", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
mi.Invoke(this.oTrans, new object[] { this.oTrans.currentQuoteNum(), <insertQuoteLine>, <insertQtyNum> });

// Also the Worksheet is re-calculated by making any changes via code or UI to fields
UnitPrice, DocUnitPrice, BurdenMarkUp, LaborMarkUp, SubcontractMarkUp
MtlBurMarkUp, MiscCostMarkUp, MiscCost, CommissionPct...

When working with Client Side Customizations it is always best to simply use the Adapter. If you don’t want to have to rely on the Assembly you could use the Reflection way.

I would suggest in your case, simply use the Adapter version. Why? Because the Adapter often has Warning/Error MessageBoxes that it may trigger, in addition it may call other UI related methods.

When you use the Business Object version you have to handle the exception yourself. Example:

try {
  // Do BO Magic
}
catch (BusinessObjectException ex) { ExceptionBox.Show(ex); }

So, let’s use the Adapter version.

How-to Reference QuoteAdapter:

  • Go Into Customization Mode
  • Tools -> Assembly Reference Manager
  • Click Add Custom Reference
  • Navigate to your E10 Client (usually C:\epicor\ERP10.1Client\Client)
  • Select Erp.Adapters.Quote.dll

Now by using the Adapter snippet above, you should be able to Press F5 and successfully compile your customization.

However, if you are already saving the total to QuoteQty.MiscCost then the re-calculation should happen automatically.

Thank you.

Learning on the fly :slight_smile:

I’m trying to understand why the information on my worksheet is not changing when I have different quantities. I think it’s because I’m defining my rows incorrectly. Here is a small snipet.

private EpiDataView edvQuoteQty;

edvQuoteQty.CurrentDataRow[“MiscCostDesc”] = “Additional Buried Cost”;
edvQuoteQty.CurrentDataRow[“MiscCost”] = curADDToolingCost.Value+curADDPackagingCost.Value+curADDMiscCost.Value;

When would I use the following?
oTrans.Update()
oTrans.NotifyAll()
oTrans.Refresh()

I also so a posting where someone used BeginEdit() and EndEdit().

Any help would be appreciated.

Thanks

Mel