AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • Rolodex
    • Podcast
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Everything Else
Customer Contacts i...
 
Notifications
Clear all

Questions Customer Contacts in Sales Orders

 
Everything Else
Last Post by Ryan Brown @xByte Hosting 6 years ago
2 Posts
2 Users
3 Reactions
2,906 Views
RSS
Netesh Gohil
Posts: 10
 Netesh Gohil
Topic starter
November 15, 2019 9:47 am
(@netesh-gohil)
Active Member
Joined: 6 years ago

I'm trying to force my users to update contact information for customers including email, etc... However, when we enter sales orders, and select a customer there is no way to select a contact for the customer to auto populate the attention and email fields. I can manually type a name and email address to have this show up on the print out and have this email automatically show up on the SEND function. Does anyone know how to have these fields populate with the contact data we are already adding?


1 Reply
Ryan Brown @xByte Hosting
Posts: 84
 Ryan Brown @xByte Hosting
November 18, 2019 1:48 pm
(@ryanxbyte)
Estimable Member
Joined: 6 years ago

We needed something similar and ended up customizing a solution.  You could have a drop of the contacts for the customer and then create an event that updates the contact info when something is selected.  It should be fairly straightforward. 

 

 

Here is our code for the contact selector.  You will have to add the field after you create it.  And then change commit changes to true on the field after added.

        [PXDBInt()]
        [PXUIField(DisplayName = "Contact")]      
        [PXSelector(typeof(Search<Contact.contactID, Where<Contact.bAccountID, Equal<Current<SOOrder.customerID>>,
                                And<Contact.contactType, Equal<ContactTypesAttribute.person>>>>),
                    typeof(Contact.displayName),
                    typeof(Contact.eMail),
                    typeof(Contact.webSite),
                    typeof(Contact.fax),
                    typeof(Contact.phone1),
                    SubstituteKey = typeof(Contact.displayName))]

 

and then here is some code to update the billing contact info

 

public virtual void SOOrder_UsrDefContact_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
        {
            SOOrder row = e.Row as SOOrder;
            if (row == null)
                return;

            SOOrderPXExt rowExt = PXCache<SOOrder>.GetExtension<SOOrderPXExt>(row);
            if (rowExt.UsrDefContact != null)
            {

                    Base.Billing_Contact.Current.OverrideContact = true;
                    Base.Billing_Contact.Update(Base.Billing_Contact.Current);

                    Contact rowContact = (Contact)PXSelect<Contact, Where<Contact.contactID, Equal<Required<Contact.contactID>>>>.Select(Base, rowExt.UsrDefContact);
                    if (rowContact != null)
                    {
                        Base.Billing_Contact.Current.Email = rowContact.EMail;
                        Base.Billing_Contact.Update(Base.Billing_Contact.Current);
                    }
                
            }

        }

 

 


Reply
JLange, Franz Marktl and Tim Rodman reacted
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,527 Topics
  • 10.9 K Posts
  • 42 Online
  • 2,412 Members
Our newest member: Peter Paasch
Latest Post: Can't export GI's to excel that contain the FATrans DAC after upgrade to 2025 R1 in less than 25 min
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

  • Tim Rodman amassey
Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2026 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×