Automatic loading of data on Invoice

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • binshadme
    Junior Member
    • Oct 2022
    • 13

    Automatic loading of data on Invoice

    Dear team,
    When we create invoice, We can choose a contact from the list. if we select, it will automatically fillup datas in ( shipping address and billing address).
    Similarly i want to auto fillup data from contact to invoice field.

    Howits possible ?
  • lazovic
    Super Moderator
    • Jan 2022
    • 809

    #2
    Hi binshadme,

    Maybe this video instruction can be useful (requires some codding skills): https://www.youtube.com/watch?v=MdaJIGxOWpU.

    Comment

    • rabii
      Active Community Member
      • Jun 2016
      • 1250

      #3
      Please note that there are two relationships between contact and invoice (billingContact => Invoice (Billing) & shippingContact => Invoice (Shipping)) which means you need to create a custom contact detail view which inherits the existing contact detail view and just add your mapping to relatedAttributeMap. Also you will need to add both Invoice (Billing) & Invoice (Shipping) to your contact bottom relationships panel. Please see below an example (tested it and it works)

      Code:
      Espo.define('custom:views/contact/detail', 'crm:views/contact/detail', function (Dep) {
      
      return Dep.extend({
      
      relatedAttributeMap: {
      'invoicesBilling': {
      'addressStreet': 'billingAddressStreet',
      'addressCity': 'billingAddressCity',
      'addressState': 'billingAddressState',
      'addressPostalCode': 'billingAddressPostalCode',
      'addressCountry': 'billingAddressCountry'
      },
      'invoicesShipping': {
      'addressStreet': 'shippingAddressStreet',
      'addressCity': 'shippingAddressCity',
      'addressState': 'shippingAddressState',
      'addressPostalCode': 'shippingAddressPostalCode',
      'addressCountry': 'shippingAddressCountry'
      }
      }
      
      });
      });
      ​
      Rabii
      Web Dev

      Comment

      Working...