Frequent use Script Events: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{NavigateDeveloper|collapsed}} |
{{NavigateDeveloper|collapsed}} |
||
⚫ | |||
Understand the usage of 5 Frequent use script events |
Understand the usage of 5 Frequent use script events |
||
⚫ | |||
⚫ | |||
{{NavigateDeveloper|collapsed}} |
|||
⚫ | |||
Learn about [[Master and Detail in Document]]. |
|||
'''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==== |
|||
*When DebtorCode is Changed, prompt message box to display Price Category of selected customer. |
|||
<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"'''. |
|||
===[[OnDetailColumnChanged]]=== |
===[[OnDetailColumnChanged]]=== |
||
===[[BeforeSave]]=== |
===[[BeforeSave]]=== |
||
===[[CalcSubTotal]]=== |
===[[CalcSubTotal]]=== |
||
===[[OnFormInitialize]]=== |
===[[OnFormInitialize]]=== |
||
<br /> |
<br /> |