Script FAQ

该文档是已过时的旧文档

The most complete and up-to-date documentation is the one of Banana Accounting Plus: Try it now

In this article

How can I get the start and end date of the accounting?

var openingDate = Banana.document.info("AccountingDataBase","OpeningDate");
var closureDate = Banana.document.info("AccountingDataBase","ClosureDate");

Note: the keywords "AccountingsDataBase", "OpeningDate" and "ClosureDate" correspond to the values in the columns "Section Xml" and ID Xml" of the table "Info file". See command "Info table" under the menu "Tools".

 

Can I save and recall in a script the values entered by the user?

Yes, use the functions Banana.Document.scriptSaveSettings and Banana.Document.scriptReadSettings.

Settings are saved and restore under the script id, if you change the id your settings will not be retrieved.

// Initialise parameter
param = {
   "searchText": "",
   "matchCase": "false",
   "wholeText": "false"
};

// Read script settings
var data = Banana.document.scriptReadSettings();
if (data.length > 0) {
   param = JSON.parse(data);
}

...

// Save script settings
var paramToString = JSON.stringify(param);
var value = Banana.document.scriptSaveSettings(paramToString);

 

Accented letters are displayed wrong

Save the script file in UTF-8.