QAD 2017 Enterprise Edition > User Guides > System Administration > Customizing Business Logic > Creating Customizations > Examples of Customization
  
Examples of Customization
This section describes some sample customizations.
Example: Customize the default value for GLExchangeMethod when creating a G/L account:
/**/
PROCEDURE BGL.InitialValues.after:
/* tgl is a shared buffer on table t_ogl */
if t_Parameter.icTableName = "gl"
then assign tgl.GLExchangeMethod = "USERDEFINED".
 
END PROCEDURE.
/**/
Example: Add default values for SAF codes when creating a G/L account:
/**/
PROCEDURE BGL.InitialValues.after:
 
define variable viReturn as integer no-undo.
 
if t_Parameter.icTableName = "gl"
then do:
/* AddDetailLine will create a record in tGLSafDefault */
run AddDetaiLLine (input "GLSafDefault",
input tgl.tc_Rowid,
output viReturn).
/* parent rowid */
/* error handling */
if viReturn < 0
then assign t_Parameter.oiReturnStatus = viReturn.
else assign tGLSafDefault.GL_ID = tgl.GL_ID
tGLSafDefault.tcSafConceptCode = "<CustomValue>"
tGLSafDefault.tcSafCode = "<CustomValue>".
end.
END PROCEDURE.
/**/
 
Example: Add a custom table to a report dataset:
/* define the custom table */
define temp-table glhistoryCustomData no-undo
field MyCustomCode as character
field MyCustomValue as character
index ip is primary unique MyCustomCode.
 
/* create custom data */
PROCEDURE BGLReport.GLHistory.after:
create glhistoryCustomData.
assign glhistoryCustomData.MyCustomCode = "demo-code"
glhistoryCustomData.MyCustomValue = "demo-value".
END PROCEDURE.
/**/
 
/* publish the custom data */
PROCEDURE BGLReport.ApiProcessReportLogic.after:
if t_Parameter.icReportName = "glhistory"
then t_Parameter.ozReportData:add-buffer(temp-table glhistoryCustomData:default-buffer-handle).
END PROCEDURE.
/**/