Frequent use Script Events: Difference between revisions

From AutoCount Resource Center
Content added Content deleted
m (Protected "Frequent use Script Events" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite) [Delete=Allow only administrators] (indefinite)))
mNo edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
__notoc__
{{NavigateDeveloper|collapsed}}
==Frequent Use Events==

Understand the usage of 5 Frequent use script events
Understand the usage of 5 Frequent use script events


===[[OnMasterColumnChanged]]===
==Frequent Use Events==
===[[OnDetailColumnChanged]]===
{{NavigateDeveloper|collapsed}}
===[[BeforeSave]]===
==OnMasterColumnChanged==
===[[CalcSubTotal]]===
'''OnMasterColumnChanged''' is triggered when user changes the value on master area of entry form, except detail area.
===[[OnFormInitialize]]===

===OnMasterColumnChanged event in Sales Invoice===
<syntaxhighlight lang="csharp">
public void OnMasterColumnChanged(BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceMasterColumnChangedEventArgs e)
</syntaxhighlight>

===Example===
*Prompt message box to display Price Category of selected customer, when DebtorCode is changed.
<syntaxhighlight lang="csharp">
public void OnMasterColumnChanged(BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceMasterColumnChangedEventArgs e)
{
if (e.ChangedColumnName == "DebtorCode")
{
DebtorRecord debtor = CommonRecordUtils.GetDebtor(
e.DBSetting, e.MasterRecord.DebtorCode);

if (debtor == null)
{
return;
}
else
{
BCE.Application.AppMessage.ShowMessage(
string.Format("{0}\n{1}\nPrice Category: {2}",
debtor.AccNo, debtor.CompanyName, debtor.PriceCategory));
}
}
}
</syntaxhighlight>

It is important to control only execute the statements when the '''changed is "DebtorCode"'''.


[[Category:Developers]]
[[Category:Script Event]]

====[[OnDetailColumnChanged]]====

====[[BeforeSave]]====

====[[CalcSubTotal]]====

====[[OnFormInitialize]]====
<br />
<br />
[[:Category:Script_Event|More Application Script Events]]
[[:Category:Script_Event|More Application Script Events]]
<br />
<br />
[[Category:Developers]]
[[Category:Programmer]]
[[Category:AppScript]]
{{NavigateDeveloper}}

Latest revision as of 04:51, 17 January 2018