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)?
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)?
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.
Hi
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;
}
}
}
}
}
Does anyone know why this is not an out-of-the-box function yet? These fields have been there for a few major versions.
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.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.