Jump to content

Frequent use Script Events: Difference between revisions

(Created page with "{{NavigateDeveloper|collapsed}} ==Introduction== Understand the usage of 5 Frequent use script events ===What is '''MasterColumn''' and '''DetailColumn'''?=== All documen...")
 
Line 19:
 
==Frequent Use Events==
{{NavigateDeveloper|collapsed}}
====[[OnMasterColumnChanged]]====
'''OnMasterColumnChanged''' is triggered when user changes the value on master area of entry form, except detail area.
 
===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]]====
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.