No announcement yet.

Issues with ORM

  • Filter
  • Time
  • Show
Clear All
new posts

  • Issues with ORM


    I'm New at ORM dev, but bassically, I have this:

    I read a xml file in order to insert all records in a table (created manually through mysql in the same ESPO database, is this possible?

    Then, I run a php script using CRON server service, no with the ESPO, to update this table.

    Finally, I move all records from this table to another created from Espo entity manager, but when I browse the entity at Espo CRM, I receive a 500 database error; I see the error is because it says the created ID, modified ID, assigned ID, are not being saved correctly, except the for the last record.

    That's why I'm thinking I'm not doing properly steps.

    So I began to read about ORM, I think this will simplify everything, the problem is, I don't know how to execute this file.

    Can anybody guide me in the how to?

  • #2
    If you can convert your xml file to csv you could just create a table using the entity manager and then import all records. http://​​​​​​​

    ORM is basically a layer ("metalanguage") that Espo uses to centralize and control interactions with the database so you can execute queries using ORM or just using plain vanilla SQL (not officially recommended).


    • #3
      i do +- exactly same .. :

      1) i use document in espocrm
      2) added a custom field for say : itsXML (enum is better) ( yes/done)
      3) create new record document, put xml file, say : itsXML to yes
      4) create a cron job (every 10min) : who list all document itsXML to yes
      5) job transform XML to CSV or .. you read XML and inject in database with ORM
      Introduction The example, convert xml to csv using PHP , shows conversion of xml data to csv data. As the title suggests to convert xml to csv using

      6) job put the itsXML field to 'done'


      • #4
        Great! thank you! will try.