createAttributeMap on custom entity not populating

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PhotoMommie
    Member
    • Dec 2019
    • 52

    #1

    createAttributeMap on custom entity not populating

    I am wondering if there is some logic that is keeping this from working.
    I have a custom entity "Reseller" and I need the Invoice to pre-populate the priceBookId for that Reseller in order to apply to the invoice items.
    In Custom/Resources/metadata/clientDefs/Invoice.json I added the following:
    PHP Code:
    "cReseller": {
    "createAttributeMap": {
    "priceBookId""priceBookId",
    "billingAddress""billingAddress",
    "shippingAddress""shippingAddress"

    I rebuilt DB and cleared cache. This is still not working properly. Anyone got some ideas on this?
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9532

    #2
    Did you add it inside the relationshipPanels parameter?
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment


    • PhotoMommie
      PhotoMommie commented
      Editing a comment
      Yes, added within the relationshipPanels section.
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9532

    #3
    Something might be wrong but I'm not sure what. We have this parameter usage in many places and it works fine.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment


    • PhotoMommie
      PhotoMommie commented
      Editing a comment
      Do you have this parameter utilized on the Sales Expansion entities?
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9532

    #4
    'billingAddress' is not an attribute but a field. You should use attributes like 'billingAddressStreet'. You can find all attributes in the entity manager > {Entity} > fields > menu on the field's row > View Details.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • PhotoMommie
      Member
      • Dec 2019
      • 52

      #5
      Is it possible that the issue is the relationship with Invoices and Price Book :: Account and the Price Book :: cReseller?
      The Invoice logic might attempt to override this automatically? I'm not sure how that works.
      I'll try to map out a test field to see if it is specifically the PriceBookId that is not carrying over.

      Comment

      • PhotoMommie
        Member
        • Dec 2019
        • 52

        #6
        I was able to implement the mapping from the cReseller screen, but not from the Invoices screen. None of the custom entity's fields are mapping at all from the Invoice side. Any ideas on this?

        Comment

        • PhotoMommie
          Member
          • Dec 2019
          • 52

          #7
          yuri Any ideas on this? I still cannot get the custom entity to map over to the Invoices.

          Comment

          • yuri
            EspoCRM product developer
            • Mar 2014
            • 9532

            #8
            I don't have ideas. It look correct to me.


            clientDefs/Invoices.json:

            Code:
            {
                "relationshipPanels": {      
                    "cReseller": {
                        "createAttributeMap": {
                            "priceBookId": "priceBookId",
                            "priceBookName": "priceBookName"
                        }
                    }
                }
            }
            You can extend the link field view for the "cReseller" field and debug there.
            If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

            Comment

            Working...