Difference between revisions of "OnDetailColumnChanged"

From AutoCount Resource Center
Jump to navigation Jump to search
m (Protected "OnDetailColumnChanged" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite) [Delete=Allow only administrators] (indefinite)) [cascading])
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{NavigateDeveloper|collapsed}}
 
 
 
==OnDetailColumnChanged==
 
==OnDetailColumnChanged==
 
  '''OnDetailColumnChanged''' is triggered when user changes the value at detail area.
 
  '''OnDetailColumnChanged''' is triggered when user changes the value at detail area.
 +
Learn about [[Master and Detail in Document]].
  
 
===OnDetailColumnChanged event in Sales Invoice===
 
===OnDetailColumnChanged event in Sales Invoice===
Line 35: Line 34:
 
In this example, you will also see the example using of DBDecimal and DBNull.Value.
 
In this example, you will also see the example using of DBDecimal and DBNull.Value.
  
[[Category:Developers]]
+
[[Category:Programmer]]
 
[[Category:Script Event]]
 
[[Category:Script Event]]
 +
{{NavigateDeveloper}}

Latest revision as of 08:10, 17 January 2018

OnDetailColumnChanged

OnDetailColumnChanged is triggered when user changes the value at detail area.
Learn about Master and Detail in Document.

OnDetailColumnChanged event in Sales Invoice

public void OnDetailColumnChanged(BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceDetailColumnChangedEventArgs e)

Example

public void OnDetailColumnChanged(BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceDetailColumnChangedEventArgs e)
{
    if (e.ChangedColumnName == "Qty" || e.ChangedColumnName == "UOM")
    {
        e.CurrentDetailRecord.FOCQty = GetFOCQty(e.CurrentDetailRecord.SmallestQty);
    }
}

private BCE.Data.DBDecimal GetFOCQty(decimal qty)
{
    if (qty >= 10)
    {
        return Math.Floor(qty / 10);
    }
    else
    {
        return DBNull.Value;
    }
}

When Qty value is changed, it will refresh the value of FOCQty. The value of FOCQty is based on the qty of every 10 unit.
In this example, you will also see the example using of DBDecimal and DBNull.Value.

Go to menu

IconAC81.png Go to top
ProgrammerGo.jpg Resources For AutoCount Software Developers