Hi Every one,
I am new to business central,
First of all, Is it possible to override the default validation functionality of existing table fields in Business Central?
If yes, then i have a business requirement, i need to change the validation for "Drop Shipment" field in sales order line items (That belongs to "Sales line" table) of sales order page, to true when Item type is of either item or Charge (Item). As the validation for "Drop Shipment" field is set by default for type item, Now i need to validate it to true if the item type selected is Charge Item also.
Here is my table extension that is extending "Sales Line", but i don't know how to by pass the validation for the above scenario.
tableextension 50114 AX_Sales_Line_Ext extends "Sales Line"
{
fields
{
modify("Drop Shipment")
{
trigger OnBeforeValidate()
begin
// if an item Type is of Charge Item or Item then it should validate to true.
if (Type = Type::"Charge (Item)") OR (Type = Type::Item) then begin
end;
end;
trigger OnAfterValidate()
begin
// if an item Type is of Charge Item or Item then it should validate to true.
if (Type = Type::"Charge (Item)") OR (Type = Type::Item) then begin
end;
end;
// trigger Validate() Validate trigger is not present for the pre-installed table fields
// begin
// end;
}
}
}
Just for reference, When i debug the extension, the debugger reached into the definition of "Drop Shipment" and it throws exception on the validation of TestField(Type,Type::Item) when the item type selected is other than item, which shows as validation error on the UI.

your guidance will be highly appreciated.