Menu

Manipulating data while import

2023-12-07
2023-12-13
  • Abdullah Noman

    Abdullah Noman - 2023-12-07

    Hello,

    I have a Bill History class/object where I have a 'monthly_rental" field that is AttributeDecimal . While I bulk import data through csv file , the 'monthly_rental' column has a $ sign infront of the numbers ( this format $123.3), Hence I am unable to upload the data. So I wrote a method in the Bill History class that will take the monthly_rental field value and strip the dollar sign while inserting and update the class accordingly. Here is the code I wrote but it isn't working and the data import process gets stuck in a loop for no reason. This is the code:

    [cid:image001.png@01DA2917.16E4A200]

    This is the field definition:
    [cid:image002.png@01DA2917.16E4A200]

    Abdullah Al Noman

     
  • Abdullah Noman

    Abdullah Noman - 2023-12-11

    @pgoiffon Hello, Any idea if this is something that can be executed?

     
  • Abdullah Noman

    Abdullah Noman - 2023-12-12

    @cisou Please let me know if this is something I can execute.

     
  • Vincent @ Combodo

    No, it's not possible to process data just before CSV import, you must do it before.
    By the way, within an OnInsert method never call $this->DBInsert, as it's useless because you are already inside that method.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.