(27 intermediate revisions by 2 users not shown) | |||
Line 80: | Line 80: | ||
|} | |} | ||
=== | ===Get UDF & Do Calculation=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Get '''UDF_Length''' & '''UDF_Width''' from '''Maintain Item''' UDF Fields | * Get '''UDF_Length''' & '''UDF_Width''' from '''Maintain Item''' UDF Fields | ||
Line 202: | Line 202: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Change Title Caption=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Change the Sales Quotation Title to '''My Quotation''' | * Change the Sales Quotation Title to '''My Quotation''' | ||
Line 238: | Line 238: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Get UDF From Maintain Customer=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* At '''Sales Invoice''' On Select Customer Code prompt UDF_MSG from '''Maintain Customer''' | * At '''Sales Invoice''' On Select Customer Code prompt UDF_MSG from '''Maintain Customer''' | ||
Line 310: | Line 310: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Get Transfer Information - QT to IV=== | ||
Below is Example are doing following action | Below is Example are doing following action | ||
* Quotation direct Transfer to Invoice. | * Quotation direct Transfer to Invoice. | ||
* Get the '''Invoice number, Date & Qty''' which had transferred to '''Invoice''' in the Quotation and shown it below the '''Browse''' button | * Get the '''Invoice number, Date & Qty''' which had transferred to '''Invoice''' in the Quotation and shown it below the '''Browse''' button | ||
Last Script Update : | Last Script Update : 20 Sep 2024<br /> | ||
Level : Advance | Level : Advance | ||
Line 363: | Line 363: | ||
begin | begin | ||
lDocKey := M.Dataset.FindField('Dockey').AsString; | lDocKey := M.Dataset.FindField('Dockey').AsString; | ||
lDtlKey := D.Dataset.FindField('Dtlkey').AsString; | |||
if Trim(D.Dataset.FindField('Dtlkey').AsString) <> '' then | |||
lDtlKey := D.Dataset.FindField('Dtlkey').AsString else | |||
lDtlKey := '-1'; | |||
FComServer := null; | FComServer := null; | ||
cdsTemp := TClientDataset.Create(nil); | cdsTemp := TClientDataset.Create(nil); | ||
Line 475: | Line 478: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Only Enable Some of the field on Click Edit by User=== | ||
Below is Example are doing following action in Sales Cash Sales | Below is Example are doing following action in Sales Cash Sales | ||
* Set all Field to Read Only at Header except Agent, DocNo, DocRef1, DocNoEx & UDF_Expired | * Set all Field to Read Only at Header except Agent, DocNo, DocRef1, DocNoEx & UDF_Expired | ||
Line 618: | Line 621: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Calculate Age between 2 date=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Do Calculation UDF_Age := UDF_DateTo - UDF_DateFrom | * Do Calculation UDF_Age := UDF_DateTo - UDF_DateFrom | ||
Line 653: | Line 656: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Simple DropDown Selection List=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Create Label | * Create Label | ||
* Create a drop down list at Maintain Customer for UDF_SearchKey | * Create a drop down list at Maintain Customer for UDF_SearchKey | ||
Last Script Update : | Last Script Update : 04 Dec 2024<br /> | ||
Level : Advance | Level : Advance | ||
Line 732: | Line 735: | ||
dsSearchKey.DataSet := cdsSearchKey; | dsSearchKey.DataSet := cdsSearchKey; | ||
with gvSearchKey do begin | with gvSearchKey do begin | ||
Name := 'Restricted_1'; | |||
OptionsCustomize.ColumnFiltering := False; | OptionsCustomize.ColumnFiltering := False; | ||
DataController.DataSource := dsSearchKey; | DataController.DataSource := dsSearchKey; | ||
Line 774: | Line 778: | ||
with lbSearchKey do begin // Create Label | with lbSearchKey do begin // Create Label | ||
Parent := edCompanyCategory.Parent; | Parent := edCompanyCategory.Parent; | ||
Left := edCompanyCategory.Left + edCompanyCategory.Width + | Left := edCompanyCategory.Left + edCompanyCategory.Width + 200; | ||
Top := edCompanyCategory.Top +3; | Top := edCompanyCategory.Top +3; | ||
Caption := 'Search key :'; | Caption := 'Search key :'; | ||
Line 781: | Line 785: | ||
with edSearchKey do begin // Create Drop List | with edSearchKey do begin // Create Drop List | ||
Parent := edCompanyCategory.Parent; | Parent := edCompanyCategory.Parent; | ||
Left := | Left := lbSearchKey.Left + lbSearchKey.Width + 10; | ||
Top := edCompanyCategory.Top; | Top := edCompanyCategory.Top; | ||
Name := 'edSearch'; | Name := 'edSearch'; | ||
Line 799: | Line 803: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Auto Add Service Charge=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Auto Append ItemCode '''SERVICE''' | * Auto Append ItemCode '''SERVICE''' | ||
* Do Calculation for ItemCode '''SERVICE''' UnitPrice := Total Doc Amount (Excluding GST) * 0.1 & Round to 2 decimal point | * Do Calculation for ItemCode '''SERVICE''' UnitPrice := Total Doc Amount (Excluding GST) * 0.1 & Round to 2 decimal point | ||
Last Script Update : | Last Script Update : 08 Nov 2022<br /> | ||
Level : Basic | Level : Basic | ||
Line 827: | Line 831: | ||
procedure DelOldRecord; | procedure DelOldRecord; | ||
begin | begin | ||
D.DataSet.Filter := 'ItemCode=''SERVICE'' '; | |||
D.DataSet.Filtered := True; | |||
try | |||
if D.DataSet.RecordCount > 0 then begin | |||
D.DataSet.First; | |||
D.DataSet.Delete; | |||
end; | |||
D.DataSet.Filter := ''; | |||
D.DataSet.Filtered := False; | |||
D.DataSet.First; | D.DataSet.First; | ||
while not D.DataSet.Eof do begin | while not D.DataSet.Eof do begin | ||
if D.DataSet.FindField('ItemCode').AsString <> 'RTN5Cents' then // To Excluding 5 Cents rounding | if D.DataSet.FindField('ItemCode').AsString <> 'RTN5Cents' then // To Excluding 5 Cents rounding | ||
ODocAmt := ODocAmt + D.DataSet.FindField('Amount').AsFloat; // To Get Total DocAmt before GST | ODocAmt := ODocAmt + D.DataSet.FindField('Amount').AsFloat; // To Get Total DocAmt before GST | ||
D.DataSet.Next; | D.DataSet.Next; | ||
end; | end; | ||
finally | finally | ||
D.DataSet. | D.DataSet.Filter := ''; | ||
end; | D.DataSet.Filtered := False; | ||
end; | |||
end; | end; | ||
begin | begin | ||
D := TDataSource(Self.FindComponent('dsDocDetail')); | D := TDataSource(Self.FindComponent('dsDocDetail')); | ||
ODocAmt := 0.00; | |||
DelOldRecord; | DelOldRecord; | ||
with D.DataSet do begin | with D.DataSet do begin | ||
Append; | Append; | ||
FindField('ItemCode').AsString := 'SERVICE'; | FindField('ItemCode').AsString := 'SERVICE'; | ||
FindField('UnitPrice').Value := SimpleRoundToEx(ODocAmt * 0.1, -2); | FindField('UnitPrice').Value := SimpleRoundToEx(ODocAmt * 0.1, -2); | ||
FindField('Disc').AsString := ''; | FindField('Disc').AsString := ''; | ||
FindField('Transferable').AsString := 'F'; | FindField('Transferable').AsString := 'F'; | ||
Post; | Post; | ||
end; | end; | ||
end. | end. | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 864: | Line 871: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Auto Click Profit Estimator Button=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Auto Click the Profit Estimator button | * Auto Click the Profit Estimator button | ||
Line 900: | Line 907: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Simulate build-in Calculation using UDF Fields=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Get Discount Amount | * Get Discount Amount | ||
Line 993: | Line 1,000: | ||
lDisc := SimpleRoundToEx(GetDiscountedValue(lAmt, DataSet.FindField('UDF_Disc').AsString), -2); //lAmt - UDF_Disc | lDisc := SimpleRoundToEx(GetDiscountedValue(lAmt, DataSet.FindField('UDF_Disc').AsString), -2); //lAmt - UDF_Disc | ||
lTax := SimpleRoundToEx(GetTaxedValue(lDisc, DataSet.FindField('TaxRate').AsString), -2); //TaxAmt | lTax := SimpleRoundToEx(GetTaxedValue(lDisc, DataSet.FindField('TaxRate').AsString), -2); //TaxAmt | ||
DataSet.FindField('TaxAmt').AsFloat := lTax; | DataSet.FindField('TaxAmt').AsFloat := lTax - lDisc; | ||
DataSet.FindField('Amount').AsFloat := lDisc; | DataSet.FindField('Amount').AsFloat := lDisc; | ||
end; | end; | ||
Line 1,011: | Line 1,018: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Auto Click Edit, Save & Browse Button=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Select Record at Grid | * Select Record at Grid | ||
Line 1,092: | Line 1,099: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Get Current User Name and Current Working Date=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Set Current Login User ID & Current Working Date to UDF | * Set Current Login User ID & Current Working Date to UDF | ||
Line 1,131: | Line 1,138: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Get Excel Data=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Get Data from Excel & append to detail | * Get Data from Excel & append to detail | ||
Line 1,249: | Line 1,256: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Copy To & Paste From Clipboard=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Copy string to Clipboard | * Copy string to Clipboard | ||
Line 1,323: | Line 1,330: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Get CSV/TXT Data=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Get Data from CSV/TXT & append to detail | * Get Data from CSV/TXT & append to detail | ||
Line 1,425: | Line 1,432: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Set Default Filtering For Sales Report=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Filter by Agent in Sales Document Listing | * Filter by Agent in Sales Document Listing | ||
Line 1,515: | Line 1,522: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Copy RefCost to UDF At Maintain Item=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Set UDF_CommCost := RefCost * 1.1 (round to 2 decimal) | * Set UDF_CommCost := RefCost * 1.1 (round to 2 decimal) | ||
Line 1,551: | Line 1,558: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Recalculate Formula Done at OnGridColumnValueChanged Script for Transferred Document=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Recalculate the Formula Done at OnGridColumnValueChanged | * Recalculate the Formula Done at OnGridColumnValueChanged | ||
Line 1,557: | Line 1,564: | ||
* Copy UDF fields (eg UDF_Qty) to Original fields for Non Transfer Items | * Copy UDF fields (eg UDF_Qty) to Original fields for Non Transfer Items | ||
Last Script Update : | Last Script Update : 08 Oct 2024<br /> | ||
Level : Basic | Level : Basic | ||
Line 1,629: | Line 1,636: | ||
VD := FindField('Disc').AsString; | VD := FindField('Disc').AsString; | ||
Edit; | Edit; | ||
FindField('SEQ'). | FindField('SEQ').AsFloat := (i*1000); //To make sure the SEQ field is correct... | ||
if Trim(FindField('FromDocType').AsString) = '' then begin // Copy UDF to Original Fields | if Trim(FindField('FromDocType').AsString) = '' then begin // Copy UDF to Original Fields | ||
FindField('Qty').AsFloat := FindField('UDF_Qty').AsFloat; | FindField('Qty').AsFloat := FindField('UDF_Qty').AsFloat; | ||
Line 1,659: | Line 1,666: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Hide Stock Opening Grid In Maintain Item=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Hide the Grid & Navigator Button for Opening Balance | * Hide the Grid & Navigator Button for Opening Balance | ||
Line 1,704: | Line 1,711: | ||
:10. Click '''Save''' button | :10. Click '''Save''' button | ||
=== | ===Export Data To Excel=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Export Maintain Agent List to Excel | * Export Maintain Agent List to Excel | ||
Line 1,811: | Line 1,818: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Change DocRef 1 Label=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Change the Purchase Order DocRef1 Label to '''C.PO # :''' | * Change the Purchase Order DocRef1 Label to '''C.PO # :''' | ||
Line 1,863: | Line 1,870: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Add Click Button=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Create 2 buttons at Sales Quotation | * Create 2 buttons at Sales Quotation | ||
Line 1,947: | Line 1,954: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Using TxQuery=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Create 1 button at Sales Quotation to Get Total Base Quantity | * Create 1 button at Sales Quotation to Get Total Base Quantity | ||
Line 2,026: | Line 2,033: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===How to find component in different Event?=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Create 1 button at Sales Quotation | * Create 1 button at Sales Quotation | ||
Line 2,108: | Line 2,115: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Simple DropDown Selection List in Document Detail === | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Create a drop down list at Sales Invoice Detail for UDF_DeliveryType | * Create a drop down list at Sales Invoice Detail for UDF_DeliveryType | ||
Line 2,239: | Line 2,246: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Default Company Code & Payment Method In Sales Cash Sales=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* On Click New auto Set Default for | * On Click New auto Set Default for | ||
Line 2,284: | Line 2,291: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Get Transfer Information - QT to DO to IV=== | ||
Below is Example are doing following action | Below is Example are doing following action | ||
* Quotation Transfer to Delivery Order to Invoice. | * Quotation Transfer to Delivery Order to Invoice. | ||
Line 2,447: | Line 2,454: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Approval by User if Document Amount Exceed Limit=== | ||
Below example is to prompt Authorised if the Document Amount Exceed the limit (eg 10000) in Sales Invoice | Below example is to prompt Authorised if the Document Amount Exceed the limit (eg 10000) in Sales Invoice | ||
Last Script Update : | Last Script Update : 18 Sep 2023<br /> | ||
Level : Advance | Level : Advance | ||
Line 2,469: | Line 2,476: | ||
| | | | ||
<syntaxhighlight lang="delphi"> | <syntaxhighlight lang="delphi"> | ||
var FComServer | var FComServer : Variant; | ||
M : TDataSource; | M : TDataSource; | ||
Line 2,499: | Line 2,506: | ||
end; | end; | ||
finally | finally | ||
FComServer := null; | FComServer := null; | ||
cdsUsers.Free; | cdsUsers.Free; | ||
Line 2,521: | Line 2,527: | ||
with fmPassword do begin | with fmPassword do begin | ||
Parent := nil; | Parent := nil; | ||
Height := | Height := 150; | ||
Width := 280; | Width := 280; | ||
Caption := 'Please Enter User Name and Password'; | Caption := 'Please Enter User Name and Password'; | ||
Line 2,551: | Line 2,557: | ||
Top := 35; | Top := 35; | ||
Width := 150; | Width := 150; | ||
PasswordChar := '*'; | PasswordChar := '*'; | ||
end; | end; | ||
with btnOK do begin | with btnOK do begin | ||
Parent := fmPassword; | Parent := fmPassword; | ||
Top := | Top := 70; | ||
Width := 100; | Width := 100; | ||
Left := (fmPassword.Width/2) - 50; | Left := (fmPassword.Width/2) - 50; | ||
Line 2,584: | Line 2,589: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Add DB Check Box=== | ||
Below example is to create DBCheckBox at Header in Sales Order | Below example is to create DBCheckBox at Header in Sales Order | ||
Line 2,636: | Line 2,641: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Set Default 14 days delivery date from DocDate=== | ||
Below example is to set Default 14 Days from Document Date in Sales Quotation | Below example is to set Default 14 Days from Document Date in Sales Quotation | ||
Line 2,668: | Line 2,673: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Add TcxDBTextEdit === | ||
Below example is to Create new TcxDBTextEdit for UDF_Wastage in Maintain Item | Below example is to Create new TcxDBTextEdit for UDF_Wastage in Maintain Item | ||
Line 2,727: | Line 2,732: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Call Report Object In Script === | ||
Below example is to Create new Button to calculate Margin for each Invoice & update to Header UDF_Margin field | Below example is to Create new Button to calculate Margin for each Invoice & update to Header UDF_Margin field | ||
Line 2,967: | Line 2,972: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Set Discount to Empty for next line=== | ||
Below is Example will automatic remove the Discount field value on insert next item line. | Below is Example will automatic remove the Discount field value on insert next item line. | ||
Line 2,999: | Line 3,004: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Prompt Dialog for Discount=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Auto Append ItemCode '''DISC''' | * Auto Append ItemCode '''DISC''' | ||
Line 3,130: | Line 3,135: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Create New Grid Tab on Existing Grid=== | ||
Below is Example are create new Tab in Existing Grid in Customer Due Listing<br /> | Below is Example are create new Tab in Existing Grid in Customer Due Listing<br /> | ||
Line 3,382: | Line 3,387: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===How to Detect what is the Current Doc Type in Document Listing?=== | ||
Last Script Update : 25 Feb 2022<br /> | Last Script Update : 25 Feb 2022<br /> | ||
Level : Basic | Level : Basic | ||
Line 3,420: | Line 3,425: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Simple Copy From Dataset to New Doc === | ||
Below is Example to Copy Quotation Information to Sales Invoice<br /> | Below is Example to Copy Quotation Information to Sales Invoice<br /> | ||
Line 3,627: | Line 3,632: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Create New Column on Existing Grid === | ||
Below is Example to Add UDF_Margin in the Sales Document Listing<br /> | Below is Example to Add UDF_Margin in the Sales Document Listing<br /> | ||
This only work if in Report Designer in Main Pipeline/Table had the field(s)<br /> | This only work if in Report Designer in Main Pipeline/Table had the field(s)<br /> | ||
Line 3,665: | Line 3,670: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Auto Click Apply button and Change the report Grid Data=== | ||
Below Example is to Change Header & Detail Description field in Sales Document Listing | Below Example is to Change Header & Detail Description field in Sales Document Listing | ||
Line 3,745: | Line 3,750: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Update DocNo To other Document=== | ||
Below Example is to Update UDF_ORNo in Sales Invoice for Knock-off Payment from Customer Payment | Below Example is to Update UDF_ORNo in Sales Invoice for Knock-off Payment from Customer Payment | ||
Line 3,832: | Line 3,837: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===How to Reset the Serial Number When update Location Field?=== | ||
Below Example is to Set Back the Serial Number List when Location change/Updated | Below Example is to Set Back the Serial Number List when Location change/Updated | ||
*Applicable for Sales Module Only as Purchase will not reset when location change | |||
Last Script Update : 19 Oct 2020<br /> | Last Script Update : 19 Oct 2020<br /> | ||
Line 3,902: | Line 3,908: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===How to find component in Advance Form?=== | ||
Below Example is to change the label in Advance Form | Below Example is to change the label in Advance Form | ||
Line 3,946: | Line 3,952: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===DropDown List from Maintenance Agent List=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Create Label | * Create Label | ||
Line 4,117: | Line 4,123: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Disable Terms Field=== | ||
Below is Example is disable the Terms Field in Sales Invoice | Below is Example is disable the Terms Field in Sales Invoice | ||
Line 4,150: | Line 4,156: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Export CSV/TXT Data=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Export Data to CSV/TXT from Invoice | * Export Data to CSV/TXT from Invoice | ||
Line 4,244: | Line 4,250: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Run External Application=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Auto Run SQL Payroll | * Auto Run SQL Payroll | ||
Line 4,314: | Line 4,320: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Update Same UDF in Sales Invoice in Customer Invoice=== | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Auto update UDF_VehicleNo in Sales Invoice to UDF_VehicleNo in Customer Invoice | * Auto update UDF_VehicleNo in Sales Invoice to UDF_VehicleNo in Customer Invoice | ||
Last Script Update : | Last Script Update : 26 Nov 2024<br /> | ||
Level : Advance | Level : Advance | ||
Line 4,338: | Line 4,344: | ||
var FComServer : Variant; | var FComServer : Variant; | ||
M : TDataSet; | M : TDataSet; | ||
function ComServer: Variant; | function ComServer: Variant; | ||
begin | begin | ||
Line 4,346: | Line 4,352: | ||
Result := FComServer; | Result := FComServer; | ||
end; | end; | ||
function VarToStrDef(const V: Variant; const ADefault: string): string; | function VarToStrDef(const V: Variant; const ADefault: string): string; | ||
begin | begin | ||
Line 4,354: | Line 4,360: | ||
Result := ADefault; | Result := ADefault; | ||
end; | end; | ||
function VarToStr(const V: Variant): string; | function VarToStr(const V: Variant): string; | ||
begin | begin | ||
Result := VarToStrDef(V, ''); | Result := VarToStrDef(V, ''); | ||
end; | end; | ||
procedure UpdateARIV; | procedure UpdateARIV; | ||
var lDockey, lBizObj, lMain : Variant; | var lDockey, lBizObj, lMain, V : Variant; | ||
lDocNo : String; | lDocNo, lCode : String; | ||
begin | begin | ||
lDocNo := M.FindField('DocNo').AsString; | lDocNo := M.FindField('DocNo').AsString; | ||
lCode := M.FindField('Code').AsString; | |||
try | try | ||
FComServer := null; | FComServer := null; | ||
lBizObj := ComServer.BizObjects.Find('AR_IV'); | lBizObj := ComServer.BizObjects.Find('AR_IV'); | ||
lMain := lBizObj.DataSets.Find('MainDataSet'); | lMain := lBizObj.DataSets.Find('MainDataSet'); | ||
lDocKey := lBizObj.FindKeyByRef('DocNo', | |||
V := FComServer.CreateOleVariantArray(1); | |||
V.SetItem(0, lDocNo); | |||
V.SetItem(1, lCode); | |||
lDocKey := lBizObj.FindKeyByRef('DocNo;Code', V.AsOleVariant); | |||
lBizObj.Params.Find('DocKey').Value := VarToStr(lDocKey); | lBizObj.Params.Find('DocKey').Value := VarToStr(lDocKey); | ||
if not VarIsNull(lDocKey) then begin | if not VarIsNull(lDocKey) then begin | ||
Line 4,383: | Line 4,395: | ||
end; | end; | ||
end; | end; | ||
begin | begin | ||
M := TDataSource(Self.FindComponent('dsDocMaster')).Dataset; | M := TDataSource(Self.FindComponent('dsDocMaster')).Dataset; | ||
Line 4,393: | Line 4,405: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
=== | ===Create Dummy Table === | ||
Below is Example are doing following actions | Below is Example are doing following actions | ||
* Create Button to Prompt out Dialog with grid | * Create Button to Prompt out Dialog with grid | ||
Line 4,647: | Line 4,659: | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
===Example | ===Disable Prompt Dialog for Set Default DocNo Set=== | ||
Last Script Update : 04 May 2024<br /> | |||
Level : Advance | |||
'''Steps - OnAfterNew''' | |||
:01. Click '''Tools | DIY | SQL Control Center...''' | |||
:02. At the left panel look for '''Sales''' | |||
:03. Right Click the '''Sales Invoice''' | |||
:04. Select '''New Event''' | |||
:05. Enter any name (eg Calc) in the '''Name''' field (Only Alphanumeric & no spacing) | |||
:06. Select '''OnAfterNew''' for '''Event''' field | |||
:07. Click OK | |||
:08. Click the Calc (name create at Step 5 above) on the left panel | |||
:09. Copy below script & paste to the Right Panel (Script Section) | |||
{| class="mw-collapsible mw-collapsed wikitable" | |||
! OnAfterNew Script | |||
|- | |||
| | |||
<syntaxhighlight lang="delphi"> | |||
var M : TDataset; | |||
procedure OnNextDocNoChanged(Sender: TField); | |||
begin | |||
// Disable Build in Event | |||
end; | |||
begin | |||
M := TDataSource(Self.FindComponent('dsDocMaster')).DataSet; | |||
M.FindField('DocNoSetKey').OnChange := @OnNextDocNoChanged; | |||
end. | |||
</syntaxhighlight> | |||
|} | |||
:10. Click '''Save''' button | |||
<div style="float: right;"> [[#top|[top]]]</div> | |||
===Example 50=== | |||
* More Coming Soon.... | * More Coming Soon.... | ||
<div style="float: right;"> [[#top|[top]]]</div> | <div style="float: right;"> [[#top|[top]]]</div> | ||
==FAQ== | ==FAQ== | ||
===Why when click | ===Why when click Compile Script button prompt error <code>[Error] (xx:xx):Unknown identifier 'Dataset'</code>=== | ||
: This happen if you doing script on the event '''OnGridColumnValueChanged''' & can ignore the error if you confirm your script is correct. | : This happen if you doing script on the event '''OnGridColumnValueChanged''' & can ignore the error if you confirm your script is correct. | ||
===How do I know my script is correct when using the script on the event | ===How do I know my script is correct when using the script on the event <code>OnGridColumnValueChanged</code> ?=== | ||
: You can add below script at 1st line before you click '''Compile Script''' button but remember to remove it before you click '''Save''' button. | : You can add below script at 1st line before you click '''Compile Script''' button but remember to remove it before you click '''Save''' button. | ||
<syntaxhighlight lang="delphi"> | <syntaxhighlight lang="delphi"> | ||
Line 4,691: | Line 4,739: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Using Form Mode - Split Browse & Detail Windows Option Prompt | ===Using Form Mode - Split Browse & Detail Windows Option Prompt <code>Null Pointer Exception Error</code>=== | ||
: You can use below script | : You can use below script | ||
<syntaxhighlight lang="delphi"> | <syntaxhighlight lang="delphi"> | ||
Line 4,712: | Line 4,760: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===After upgrade to Version 816 prompt error Message <code>Cannot cast an object</code>=== | |||
[[File:DIYScript-03.gif|center]] | |||
==See also== | ==See also== |
Latest revision as of 04:56, 4 December 2024
Menu: Tools | DIY | SQL Control Center...
Introduction
This is Additional Module(DIY Script Module) which allow user to override or customise the SQL System.
The Language use is Pascal
DIY Script
Available Action/Event
Action/Event | Description |
---|---|
OnOpen | The script trigger On Open the Form (eg On Open the Sales Invoice Form) |
OnClose | The script trigger On Close/Exit the Form (eg on Exit Sales Invoice Form) |
OnBeforeNew | The script trigger before the build in New Button action execute. |
OnAfterNew | The script trigger after the build in New Button action Execute. |
OnBeforeEdit | The script trigger before the build in Edit Button action execute. |
OnAfterEdit | The script trigger after the build in Edit Button action Execute. |
OnBeforeDelete | The script trigger before the build in Delete Button action execute. |
OnAfterDelete | The script trigger after the build in Delete Button action Execute. |
OnBeforeSave | The script trigger before the build in Save Button action execute. |
OnAfterSave | The script trigger after the build in Save Button action Execute. |
OnBeforeCancel | The script trigger before the build in Cancel Button action execute. |
OnAfterCancel | The script trigger after the build in Cancel Button action Execute. |
OnBeforePrint | The script trigger before the build in Print or Preview Button action Execute. |
OnGridBeforeInsert | The script trigger before the build in + Button action Execute. |
OnGridAfterInsert | The script trigger after the build in + Button action Execute. |
OnGridBeforePost | The script trigger before post the current row record. |
OnGridAfterPost | The script trigger after post the current row record. |
OnGridBeforeDelete | The script trigger before the build in - Button action Execute. |
OnGridAfteDelete | The script trigger after the build in - Button action Execute. |
OnGridBeforeCancel | The script trigger before cancel the current row record. |
OnGridAfterCancel | The script trigger after cancel the current row record. |
OnGridColumnValueChanged | The script trigger on changes value in the current record. |
Get UDF & Do Calculation
Below is Example are doing following actions
- Get UDF_Length & UDF_Width from Maintain Item UDF Fields
- Do Calculation Qty := UDF_Length * UDF_Width * UDF_Rate
Last Script Update : 23 Oct 2017
Level : Basic
Steps - OnGridColumnValueChanged
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnGridColumnValueChanged for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnGridColumnValueChanged Script |
---|
- 10. Click Save button
- ----------------------------------------------------------------------------------------------------------------------------------------------------
- ----------------------------------------------------------------------------------------------------------------------------------------------------
Change Title Caption
Below is Example are doing following actions
- Change the Sales Quotation Title to My Quotation
Last Script Update : 19 Oct 2015
Level : Basic
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Quotation
- 03. Right Click the Sales Quotation
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Get UDF From Maintain Customer
Below is Example are doing following actions
- At Sales Invoice On Select Customer Code prompt UDF_MSG from Maintain Customer
Last Script Update : 20 Oct 2015
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Get Transfer Information - QT to IV
Below is Example are doing following action
- Quotation direct Transfer to Invoice.
- Get the Invoice number, Date & Qty which had transferred to Invoice in the Quotation and shown it below the Browse button
Last Script Update : 20 Sep 2024
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Quotation
- 03. Right Click the Sales Quotation
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Only Enable Some of the field on Click Edit by User
Below is Example are doing following action in Sales Cash Sales
- Set all Field to Read Only at Header except Agent, DocNo, DocRef1, DocNoEx & UDF_Expired
- Set all Detail Field to Read Only except Description & Account Field
Remember to Enable Back by Disable the GetAuthorised (see below) Script & Insert it to OnBeforeNew script
Cons : It will be delay about 3 to 4 sec. after click Edit & New button
Last Script Update : 03 Nov 2015
Level : Advance
Steps - OnBeforeEdit & OnBeforeNew
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Cash Sales
- 03. Right Click the Sales Cash Sales
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnBeforeEdit for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnBeforeEdit Script |
---|
- 10. Click Save button
Calculate Age between 2 date
Below is Example are doing following actions
- Do Calculation UDF_Age := UDF_DateTo - UDF_DateFrom
Last Script Update : 19 Nov 2015
Level : Basic
Steps - OnGridColumnValueChanged
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnGridColumnValueChanged for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnGridColumnValueChanged Script |
---|
- 10. Click Save button
Simple DropDown Selection List
Below is Example are doing following actions
- Create Label
- Create a drop down list at Maintain Customer for UDF_SearchKey
Last Script Update : 04 Dec 2024
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Customer
- 03. Right Click the Customer
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Auto Add Service Charge
Below is Example are doing following actions
- Auto Append ItemCode SERVICE
- Do Calculation for ItemCode SERVICE UnitPrice := Total Doc Amount (Excluding GST) * 0.1 & Round to 2 decimal point
Last Script Update : 08 Nov 2022
Level : Basic
Steps - OnBeforeSave
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnBeforeSave for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnBeforeSave Script |
---|
- 10. Click Save button
Auto Click Profit Estimator Button
Below is Example are doing following actions
- Auto Click the Profit Estimator button
Last Script Update : 02 Dec 2015
Level : Basic
Steps - OnBeforeSave
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnBeforeSave for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnBeforeSave Script |
---|
- 10. Click Save button
Simulate build-in Calculation using UDF Fields
Below is Example are doing following actions
- Get Discount Amount
- Get Tax Amount
- Do Calculation Amt := (UDF_UnitPrice*UDF_Qty)-UDF_Disc)*(TaxRate)
Last Script Update : 03 Sep 2016
Level : Basic
Steps - OnGridColumnValueChanged
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnGridColumnValueChanged for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnGridColumnValueChanged Script |
---|
- 10. Click Save button
Auto Click Edit, Save & Browse Button
Below is Example are doing following actions
- Select Record at Grid
- Auto Click Browse button
- Auto Click Edit button
- Auto Click Save button
- Auto Click Browse button
Last Script Update : 20 Apr 2019
Level : Basic
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Get Current User Name and Current Working Date
Below is Example are doing following actions
- Set Current Login User ID & Current Working Date to UDF
Last Script Update : 22 Dec 2015
Level : Basic
Steps - OnBeforeSave
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnBeforeSave for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnBeforeSave Script |
---|
- 10. Click Save button
Get Excel Data
Below is Example are doing following actions
- Get Data from Excel & append to detail
Last Script Update : 14 Jan 2016
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Copy To & Paste From Clipboard
Below is Example are doing following actions
- Copy string to Clipboard
- Paste from Clipboard
Last Script Update : 14 Jan 2016
Level : Basic
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Quotation
- 03. Right Click the Sales Quotation
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Get CSV/TXT Data
Below is Example are doing following actions
- Get Data from CSV/TXT & append to detail
Last Script Update : 03 Mar 2018
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Set Default Filtering For Sales Report
Below is Example are doing following actions
- Filter by Agent in Sales Document Listing
- Disable Selection for Agent
Last Script Update : 02 Feb 2016
Level : Basic
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Document Listing
- 03. Right Click the Sales Document Listing
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Copy RefCost to UDF At Maintain Item
Below is Example are doing following actions
- Set UDF_CommCost := RefCost * 1.1 (round to 2 decimal)
Last Script Update : 03 Mar 2016
Level : Basic
Steps - OnBeforeSave
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Stock Item
- 03. Right Click the Stock Item
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnBeforeSave for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnBeforeSave Script |
---|
- 10. Click Save button
Recalculate Formula Done at OnGridColumnValueChanged Script for Transferred Document
Below is Example are doing following actions
- Recalculate the Formula Done at OnGridColumnValueChanged
- Copy Original fields (eg Qty) to UDF fields for Transfer Items
- Copy UDF fields (eg UDF_Qty) to Original fields for Non Transfer Items
Last Script Update : 08 Oct 2024
Level : Basic
Steps - OnBeforeSave
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnBeforeSave for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnBeforeSave Script |
---|
- 10. Click Save button
Hide Stock Opening Grid In Maintain Item
Below is Example are doing following actions
- Hide the Grid & Navigator Button for Opening Balance
Last Script Update : 13 Apr 2016
Level : Basic
Steps - OnBeforeSave
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Stock Item
- 03. Right Click the Stock Item
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Export Data To Excel
Below is Example are doing following actions
- Export Maintain Agent List to Excel
Last Script Update : 26 May 2016
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Agent
- 03. Right Click the Agent
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Change DocRef 1 Label
Below is Example are doing following actions
- Change the Purchase Order DocRef1 Label to C.PO # :
Last Script Update : 21 Jul 2021
Level : Basic
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Purchase Order
- 03. Right Click the Purchase Order
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Add Click Button
Below is Example are doing following actions
- Create 2 buttons at Sales Quotation
- 1 at Beside Up Down Button
- 1 at Below Browse Button
Last Script Update : 29 Mar 2022
Level : Basic
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Quotation
- 03. Right Click the Sales Quotation
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Using TxQuery
Below is Example are doing following actions
- Create 1 button at Sales Quotation to Get Total Base Quantity
Last Script Update : 02 Nov 2016
Level : Basic
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Quotation
- 03. Right Click the Sales Quotation
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
How to find component in different Event?
Below is Example are doing following actions
- Create 1 button at Sales Quotation
- On Before Save will auto Click the New Created button
Last Script Update : 24 Dec 2016
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Quotation
- 03. Right Click the Sales Quotation
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Steps - OnBeforeSave
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Quotation
- 03. Right Click the Sales Quotation
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnBeforeSave for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnBeforeSave Script |
---|
- 10. Click Save button
Simple DropDown Selection List in Document Detail
Below is Example are doing following actions
- Create a drop down list at Sales Invoice Detail for UDF_DeliveryType
Last Script Update : 27 Dec 2016
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Default Company Code & Payment Method In Sales Cash Sales
Below is Example are doing following actions
- On Click New auto Set Default for
- - Customer Code := 300-C0001
- - Payment Method := 320-000
- - Payment Project := ----
Last Script Update : 28 Dec 2016
Level : Basic
Steps - OnAfterNew
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Cash Sales
- 03. Right Click the Sales Cash Sales
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnAfterNew for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnAfterNew Script |
---|
- 10. Click Save button
Get Transfer Information - QT to DO to IV
Below is Example are doing following action
- Quotation Transfer to Delivery Order to Invoice.
- Get the Quotation number, Date & Qty in the Invoice and shown it below the Browse button
Last Script Update : 03 Jun 2017
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Approval by User if Document Amount Exceed Limit
Below example is to prompt Authorised if the Document Amount Exceed the limit (eg 10000) in Sales Invoice
Last Script Update : 18 Sep 2023
Level : Advance
Steps - OnBeforeSave
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnBeforeSave for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnBeforeSave Script |
---|
- 10. Click Save button
Add DB Check Box
Below example is to create DBCheckBox at Header in Sales Order
Last Script Update : 07 Aug 2017
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Order
- 03. Right Click the Sales Order
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Set Default 14 days delivery date from DocDate
Below example is to set Default 14 Days from Document Date in Sales Quotation
Last Script Update : 20 Sep 2017
Level : Basic
Steps - OnGridAfterInsert
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Quotation
- 03. Right Click the Sales Quotation
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnGridAfterInsert for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnGridAferInsert Script |
---|
- 10. Click Save button
Add TcxDBTextEdit
Below example is to Create new TcxDBTextEdit for UDF_Wastage in Maintain Item
Last Script Update : 21 Dec 2017
Level : Basic
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Stock
- 03. Right Click the Stock Item
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Call Report Object In Script
Below example is to Create new Button to calculate Margin for each Invoice & update to Header UDF_Margin field
Last Script Update : 23 Nov 2017
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Set Discount to Empty for next line
Below is Example will automatic remove the Discount field value on insert next item line.
Last Script Update : 27 Nov 2017
Level : Basic
Steps - OnGridAfterInsert
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnGridAfterInsert for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnGridAfterInsert Script |
---|
- 10. Click Save button
Prompt Dialog for Discount
Below is Example are doing following actions
- Auto Append ItemCode DISC
- Do Calculation for ItemCode DISC UnitPrice := Total Doc Amount * Rate Enter
Last Script Update : 29 Nov 2017
Level : Basic
Steps - OnBeforeSave
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnBeforeSave for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnBeforeSave Script |
---|
- 10. Click Save button
Create New Grid Tab on Existing Grid
Below is Example are create new Tab in Existing Grid in Customer Due Listing
Last Script Update : 03 Jan 2018
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Customer Due Document
- 03. Right Click the Customer Due Document
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
How to Detect what is the Current Doc Type in Document Listing?
Last Script Update : 25 Feb 2022
Level : Basic
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Document Listing
- 03. Right Click the Sales Document Listing
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Simple Copy From Dataset to New Doc
Below is Example to Copy Quotation Information to Sales Invoice
Last Script Update : 08 Sep 2018
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Quotation
- 03. Right Click the Sales Quotation
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Create New Column on Existing Grid
Below is Example to Add UDF_Margin in the Sales Document Listing
This only work if in Report Designer in Main Pipeline/Table had the field(s)
Last Script Update : 19 Feb 2019
Level : Basic
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Document Listing
- 03. Right Click the Sales Document Listing
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Auto Click Apply button and Change the report Grid Data
Below Example is to Change Header & Detail Description field in Sales Document Listing
Last Script Update : 21 Mar 2019
Level : Basic
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Document Listing
- 03. Right Click the Sales Document Listing
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Update DocNo To other Document
Below Example is to Update UDF_ORNo in Sales Invoice for Knock-off Payment from Customer Payment
Last Script Update : 03 Jul 2019
Level : Advance
Steps - OnAfterSave
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Customer Payment
- 03. Right Click the Customer Payment
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnAfterSave for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnAfterSave Script |
---|
- 10. Click Save button
How to Reset the Serial Number When update Location Field?
Below Example is to Set Back the Serial Number List when Location change/Updated
- Applicable for Sales Module Only as Purchase will not reset when location change
Last Script Update : 19 Oct 2020
Level : Advance
Steps - OnBeforeSave
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnBeforeSave for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnBeforeSave Script |
---|
- 10. Click Save button
How to find component in Advance Form?
Below Example is to change the label in Advance Form
Last Script Update : 11 Nov 2021
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
DropDown List from Maintenance Agent List
Below is Example are doing following actions
- Create Label
- Create a drop down list at Sales Invoice for UDF_Agent2
Last Script Update : 07 Apr 2020
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Disable Terms Field
Below is Example is disable the Terms Field in Sales Invoice
Last Script Update : 07 Apr 2020
Level : Basic
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Export CSV/TXT Data
Below is Example are doing following actions
- Export Data to CSV/TXT from Invoice
Last Script Update : 14 May 2020
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales Invoice
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Run External Application
Below is Example are doing following actions
- Auto Run SQL Payroll
Last Script Update : 19 Jun 2020
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Agent
- 03. Right Click the Agent
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Update Same UDF in Sales Invoice in Customer Invoice
Below is Example are doing following actions
- Auto update UDF_VehicleNo in Sales Invoice to UDF_VehicleNo in Customer Invoice
Last Script Update : 26 Nov 2024
Level : Advance
Steps - OnAfterSave
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales
- 03. Right Click the Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnAfterSave for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnAfterSave Script |
---|
- 10. Click Save button
Create Dummy Table
Below is Example are doing following actions
- Create Button to Prompt out Dialog with grid
- Save Grid Data to UDF_GList1
Last Script Update : 05 Feb 2022
Level : Advance
Steps - OnOpen
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Customer
- 03. Right Click the Customer
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnOpen for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnOpen Script |
---|
- 10. Click Save button
Disable Prompt Dialog for Set Default DocNo Set
Last Script Update : 04 May 2024
Level : Advance
Steps - OnAfterNew
- 01. Click Tools | DIY | SQL Control Center...
- 02. At the left panel look for Sales
- 03. Right Click the Sales Invoice
- 04. Select New Event
- 05. Enter any name (eg Calc) in the Name field (Only Alphanumeric & no spacing)
- 06. Select OnAfterNew for Event field
- 07. Click OK
- 08. Click the Calc (name create at Step 5 above) on the left panel
- 09. Copy below script & paste to the Right Panel (Script Section)
ExpandOnAfterNew Script |
---|
- 10. Click Save button
Example 50
- More Coming Soon....
FAQ
Why when click Compile Script button prompt error [Error] (xx:xx):Unknown identifier 'Dataset'
- This happen if you doing script on the event OnGridColumnValueChanged & can ignore the error if you confirm your script is correct.
How do I know my script is correct when using the script on the event OnGridColumnValueChanged
?
- You can add below script at 1st line before you click Compile Script button but remember to remove it before you click Save button.
var EditingField, Dataset :Variant;
How many data source (TDatasource) it had for data entry (eg Sales Invoice) & what is each name?
- Generally it had 3 data source & some had extra 1 (i.e. total 4).
Name | Description |
---|---|
dsDocMaster | Header fields |
dsDocDetail | Detail or Item Fields |
dsSerialNumber | Serial Number Fields |
How to check the Record in Edit Mode?
- You can use below script
... //yr other code
var AState : TDataSetState;
M : TDataSource;
begin
M := TDataSource(Self.FindComponent('dsDocMaster'));
AState := M.DataSet.State;
if (AState = dsInsert) or (AState = dsEdit) then
MessageDlg('Yes In Edit Mode', mtInformation, [mbOK], 0);
end;
... //yr other code
Using Form Mode - Split Browse & Detail Windows Option Prompt Null Pointer Exception Error
- You can use below script
... //yr other code
begin
if TWinControl(Self.FindComponent('DetailControl')).Visible then begin
...//yr other code
end;
end.
Message Dialog with Option
... //yr other code
begin
if MessageDlg('Are you sure?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then
MessageDlg('Yes Click', mtInformation, [mbOK],0) else
MessageDlg('No Click', mtInformation, [mbOK],0);
end.
After upgrade to Version 816 prompt error Message Cannot cast an object
See also
- DIY Fields
- Maintain DIY
- Others Customisation