Importing Sales Orders and Sales Order Items. How to turn on SO Items for this?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jeffreysgrossman
    Member
    • Jan 2025
    • 70

    Importing Sales Orders and Sales Order Items. How to turn on SO Items for this?

    I am trying to build a way to have the sales orders and sales order items be imported from an excel document .csv I am able to export out the sales orders and have chosen all fields. However, the items do not seem to export or show up on an import as an option. Can anyone tell me how to turn Sales Order Items on for export and import from Espo?

    I had found this article from the search: Sales Pack: Import Sales Orders and Sales Order Items - EspoCRM Open Source Community Forum
    It was mentioned that they turned on Sales Order Items for Import. Love some info about that?

    My hope is to be able to take a .csv and create a series of Sales Orders that were taken using that excel template. Reducing the amount of work needed by the sales people who get a filled in excel doc sent to them. Rather than having to recreate using the UI..

    Thank You!

  • victor
    Active Community Member
    • Aug 2022
    • 865

    #2
    There are several options for solving this problem. Please clarify where exactly you are getting the data (.csv files for import)? If you are simply trying to transfer data from one instance to another, then there is simply no better option than the Export-Import extension: https://docs.espocrm.com/extensions/...port/overview/.

    Comment

    • jeffreysgrossman
      Member
      • Jan 2025
      • 70

      #3
      Hello victor

      Thank you for the reply. We have some excel templates that the teams use and send out thru email. These "menus" have columns and the information needed to create a Sales Order.

      I was playing with the import feature in the UI to see if I could map the template data to import and create a sales order. Originally when I wrote the post I had missed the field called "Item List" in the choices of the mapping. I now think that is where you map the items? Do you mind letting me know if I am right in that assumption? If so, what is the correct format for that mapping field?

      The screen shot below shows the Item List Field from the dropdown. If this is the right mapping what is the format it should be in the csv?
      Click image for larger version  Name:	image.png Views:	0 Size:	26.3 KB ID:	116969
      Last edited by jeffreysgrossman; Yesterday, 03:03 AM.

      Comment

      • victor
        Active Community Member
        • Aug 2022
        • 865

        #4
        In this case, there are 2 more options:

        Option 1 (without interfering with the code):
        Your import file for Sales Order in Item List column should contain information about Item List:
        Code:
        [{"name":"test name for forum","quantity":1,"listPrice":15,"unitPrice":15,"discount":0,"createdByName":"Admin"}]
        A very simple example of such a file is in the attachments (Option-1-SalesOrder.csv). You can use this file for a test import or simply export an existing Sales Order and create your own import file based on it.

        Option 2:
        - In your_instance_name/custom/Espo/Custom/Resources/metadata/scopes create SalesOrderItem.json (or use the example from the attachments) in which the option should be specified:
        Code:
        "importable": true
        - Give this file the required Permissions: https://docs.espocrm.com/administrat...n/#permissions and make Rebuild.
        - Clear the cache of the browser used to work with your instance. You will see Sales Order Items in the list of entities available for Import.

        Import procedure for Option 2:
        1. Import Sales Order without Item List (Option-2-SalesOrderItem-1-file.csv).
        2. In a separate import file for Sales Order Item in the salesOrderId column for each line (each Item) specify the Sales Order id from step 1. An example of such a file is in the attachment Option-2-SalesOrderItem-2-file.csv (note that you must have the id of your existing Sales Order in the salesOrderId column). You can also export from #SalesOrderItem several Sales Order Items to have an example of a correct file that can be used for Import.
        3. Make Import for Sales Order Item entity.

        Note that for examples I am using a very small number of fields. In your case, it may be a much larger number for each of your import files.
        Attached Files
        Last edited by victor; Yesterday, 08:59 AM.

        Comment

        • jeffreysgrossman
          Member
          • Jan 2025
          • 70

          #5
          victor this is amazing! thank you so much. Very much appreciate all this information. This was the info I was looking for..

          Comment

          Working...