Skip to main content
Answer

Can you configure the system to carry the Default Location from an Opportunity through to the Project Address on a Project?

  • July 27, 2021
  • 6 replies
  • 410 views

cwalton3
Freshman II

Is there an easy way to get the Project Address to auto-populate with the Default Location (the shipping Location ID specified on the Opportunity)?

 

 

Best answer by Naveen Boga

Hi @cwalton3   Here is the customization code. Please add this to package package and deploy. 

Hope this helps!!

 

 public class ProjectEntryExt : PXGraphExtension<ProjectEntry>
{

protected virtual void _(Events.FieldUpdated<PMProject, PMProject.locationID> e, PXFieldUpdated InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(e.Cache, e.Args);

PMProject row = e.Row as PMProject;
if (row != null)
{
Address objAddress = PXSelectJoin<Address, InnerJoin<Location, On<Location.bAccountID, Equal<Address.bAccountID>,
And<Location.defAddressID, Equal<Address.addressID>>>>,
//Where<Address.bAccountID, Equal<Required<Address.bAccountID>>,
Where<Location.locationID, Equal<Required<Location.locationID>>>>.Select(Base, /*row.CustomerID,*/ row.LocationID);
if (objAddress != null)
{
if (Base.Site_Address.Current != null)
{
Base.Site_Address.Current.AddressLine1 = objAddress.AddressLine1;
Base.Site_Address.Current.AddressLine2 = objAddress.AddressLine2;
Base.Site_Address.Current.City = objAddress.City;
Base.Site_Address.Current.State = objAddress.State;
Base.Site_Address.Current.CountryID = objAddress.CountryID;
Base.Site_Address.Current.PostalCode = objAddress.PostalCode;
}
}
}
}
}

6 replies

Forum|alt.badge.img+4

Do you have access to a developer resource?  If the business case is approved for development, they should be able to add a FieldUpdated event handler (into a customization project) on the location field to lookup the address information of the location and push it into the project address.  I’m not sure of any other ways this could be done “in-line” during data entry.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • July 27, 2021

Hi @cwalton3   Here is the customization code. Please add this to package package and deploy. 

Hope this helps!!

 

 public class ProjectEntryExt : PXGraphExtension<ProjectEntry>
{

protected virtual void _(Events.FieldUpdated<PMProject, PMProject.locationID> e, PXFieldUpdated InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(e.Cache, e.Args);

PMProject row = e.Row as PMProject;
if (row != null)
{
Address objAddress = PXSelectJoin<Address, InnerJoin<Location, On<Location.bAccountID, Equal<Address.bAccountID>,
And<Location.defAddressID, Equal<Address.addressID>>>>,
//Where<Address.bAccountID, Equal<Required<Address.bAccountID>>,
Where<Location.locationID, Equal<Required<Location.locationID>>>>.Select(Base, /*row.CustomerID,*/ row.LocationID);
if (objAddress != null)
{
if (Base.Site_Address.Current != null)
{
Base.Site_Address.Current.AddressLine1 = objAddress.AddressLine1;
Base.Site_Address.Current.AddressLine2 = objAddress.AddressLine2;
Base.Site_Address.Current.City = objAddress.City;
Base.Site_Address.Current.State = objAddress.State;
Base.Site_Address.Current.CountryID = objAddress.CountryID;
Base.Site_Address.Current.PostalCode = objAddress.PostalCode;
}
}
}
}
}


cwalton3
Freshman II
  • Author
  • Freshman II
  • July 29, 2021

@brianstevens  @Naveen B I wanted to thank you both for your responses. both were very helpful as a non-developer/techno-functional consultant. 


KellyBurns74
Freshman I
Forum|alt.badge.img

Does anyone know why this is not an out-of-the-box function yet?  These fields have been there for a few major versions.  @Naveen Boga thanks for the code, but I hope this is on the roadmap as a default feature when using CRM with Projects.  


Forum|alt.badge.img+1
  • Acumatica Moderator
  • October 19, 2023

This is similar to the following.  Please up-vote this idea.  There is in fact a permanent solution coming.

 

On 23R1, please use the work around of selecting the Override option on the Project Quotes form (PM304500) in the Project Address section (see the screenshot below). This will preserve the address and it will be carried on to the project.

screenshot-1.png


Forum|alt.badge.img
  • Jr Varsity II
  • October 8, 2025

@Naveen Boga 

Hello Naveen,

You did a customization for this a few years ago. Since Acumatica has been through some changes in construction. Do you have this customization that works for 2025R1? I have a customer that wants this exact feature. I noticed the feature to vote on is removed. Can you please help? You are awesome.

Thank you!