OnMasterColumnChanged: Difference between revisions

From AutoCount Resource Center
Content added Content deleted
No edit summary
mNo edit summary
Line 36: Line 36:




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

Revision as of 15:44, 27 November 2017

Go to menu

Go to top
Resources For AutoCount Software Developers


OnMasterColumnChanged

OnMasterColumnChanged is triggered when user changes the value on master area of entry form, except detail area.
Learn about Master and Detail in Document.

OnMasterColumnChanged event in Sales Invoice

public void OnMasterColumnChanged(BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceMasterColumnChangedEventArgs e)

Example

  • When DebtorCode is Changed, prompt message box to display Price Category of selected customer.
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));
        }
    }
}

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