Siebel (escript) Study:
Data type of 1.Siebel
Primitive (original)---number,integer,hexadecimal (hexadecimal), octal (octal), floating point (float), Decimal (decimal), Scientific (System), Boolean, String
Composite (compound)---object,array,
Special (Special)----Undefined (undefined), Null,nan (non-numeric)
2. typeof method
typeof variable or typeof (variable)
The return values are: "Undefined", "Boolean", "string", "Object", "number", "function", or "buffer"
3. Refresh Record Methods
var obs=theapplication (). GetService ("FINS Teller UI Navigation").
obs.invokemethod ("Refreshcurrentapplet", Inputs, Outputs);
/* if the parameter of input has set refresh all to Y, then all applet* of the current view are refreshed /
BC has two method:
Buscomp.invokemehtod ("Refreshbuscomp") refreshes the current query record
4.theapplication (). Trace Method
theapplication (). TraceOn (filename,type,selection)
filename for log file, absolute path
1.allocation.traces allocations and deallocations of Siebel objects. This option is useful if your suspect memory leaks in your code.
2.sql. Traces SQL statements generated by the Siebel application.
selection generally we use all to do it.
5. Configure MVL Attention Points
You need to tick the use primary join when configuring MVL, or it will cause problems generating n+1 SQL statements.
Mvl.use the role of primary join:
Use primary join is not ticked, and each associated data is queried.
Use primary join has a tick and will only query the main associated data.
6.About Get BO\BC
About Get BO
1.TheApplication (). Activebusobject ();
Returns the business object for the business component of the active applet
2.this. Busobject ();
Returns the business object for the business component of the applet.
3.TheApplication (). Getbusobject ("BO NAME");
Instantiates and returns a new instance of the argument specified business object
---------------------------------------------------------------------------------------------
about Get BC
1.theapplication (). Activebuscomp ();
returns the business component associated with the active Applet.
2.this. Buscomp ();
eg:this. Buscomp (). GetFieldValue ("Id"); Use it-get current record ID
3.boxxx.getbuscomp ("BC NAME ");
instantiates and returns a new instance of the argument Specified business component
7.BC operation
cleartoquery ();
setviewmode (AllView);//viewmode, generally used as Organization Catelog
activatefield ("Status");
setsearchspec ("Id", sordid);//or setsearchexpr (Ssearch);
//pay special attention to SETSEARCHSPEC and setsearchexpr alternating use is the case that will overwrite the query condition, Self Test
executequery (forwardonly);
}
/ /deleterecord do not need NextRecord
8. Using PickList in Escript
When assigning a field with PickList in a script, do not directly assign a value to field using SetFieldValue, you need to use the Pick method
How to assign the wrong value:
Bc. SetFieldValue ("FieldName", "value"),
The correct way to assign the value:
With (Obcca) {
var Obcpick = Getpicklistbuscomp ("state");
with (Obcpick)
cleartoquery ();
setsearchspec ("Value", "CA");
executequery (forwardonly);
i F (Firstrecord ())
}//end with (Obcpick)
}//end with (Obcca)
Use of the Split method in 9.eScript
Looping through the Split method can cause a memory leak and, once used, destory the object in time. As shown below:
while (Bhasrecord)
{
Sspilttext = Getsplittext ();
var asplit = Ssplittext.split (",");
TODO Business
Asplit = null;
}//end while
10. How to import and export code
Open a File selection dialog box
var cdl = new ActiveXObject ("Mscomdlg.commondialog");
Cdl. MaxFileSize = 256;
CDL. DialogTitle = "Select Data File";
CDL. Filter= "Excel Files (*.xls) |*.xls| Batch Files (*.csv) |*.csv| Text Files (*.txt) |*.txt| Other Files (*. *) |*.* ";
CDL. ShowOpen ();
var sfilename = CDL. FileName;
//get data from Excel
var Excelbook = ExcelApp.Workbooks.Open (sfilename);
var ExcelSheet = Excelbook.worksheets ("Sheet1");
var stemp = Excelsheet.cells (UP). Value
Siebel Escript Learning notes