Modify Data

文件资料 •
在此文中

The Accounting files content can be be modified using specific API functions.

Banana Accounting Extension can modify the data, but the user has full control of it:

  • Changes to the file are first displayed to the user.
  • The user must approve the changes.
  • The user can undo the changes.

This approach put the user on full control. Once the changes are displayed, the user can decide whether to apply them or not. In addition, the user can also undo changes.
It's a different approach from Excel where scripts makes direct changes to the sheets and user cannot preview and undo them. 

Extension for changing data

The process to change data is the following: 

  • The extension creates a DocumentChange JSON object that contains the information regarding the change:
    • Add new rows with the possibility of also defining the style (colors, font size, ...).
    • Modify existing rows with the possibility of also defining the style (colors, font size, ...).
    • Delete rows.
    • Modify File properties data.
  • The exec() function of the extension returns the DocumentChange Object (see the Example of an Extension using a DocumentChange).
  • When you run the extension, the program displays a dialog box where the user can see a preview of the data that will be changed. 

    documentChange preview
    Preview example where a new row is added to the Transactions table
     
  • The user need to confirm the changes. 
  • The changes will be added to the undo/redo mechanism. 
    The user can therefore undo and redo the change, similar to all other commands.
  • The changes are applied to the accounting file.

    documentChange add row
    The row with the style is added to the Transactions table
     

 

请帮助我们完善必备文件

我们非常欢迎您发送宝贵的反馈意见

请告诉我们什么主题需要更好的解释或如何才能更好的对其诠释。

分享这篇文章: Twitter | Facebook | LinkedIn | Email