Question

New action button causes AddressLookup to stop working.

  • 28 November 2023
  • 2 replies
  • 91 views

Userlevel 2

I created an action button to create a service order from the customer screen. The customization works great. The only problem is the Address Lookup seemed to stop working. Any Idea what may be causing this?

using PX.Data;
using PX.Objects.CR;
using PX.Objects.FS;
using System.Collections;
using PX.SM;


namespace PX.Objects.AR
{
public class CustomerMaint_Extension : PXGraphExtension<PX.Objects.AR.CustomerMaint>
{

public class CustomerServiceOrderDac : IBqlTable{

[PXString(4, IsFixed = true, InputMask = ">AAAA")]
[PXUIField(DisplayName = "Service Order Type", Required = true)]
[PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
[FSSelectorActiveSrvOrdType]

public virtual string ServiceOrderType{ get; set; }
public abstract class serviceOrderType : PX.Data.BQL.BqlString.Field<serviceOrderType> { }
}

public PXFilter<CustomerServiceOrderDac> pXFilter;

public PXAction<Customer> CreateServiceOrderAction;

[PXButton(CommitChanges = true, DisplayOnMainToolbar = true, Category = "Actions")]

[PXUIField(DisplayName = "Create Service Order", MapViewRights = PXCacheRights.Select, MapEnableRights = PXCacheRights.Update)]


protected virtual IEnumerable createServiceOrderAction(PXAdapter adapter) {

WebDialogResult result = pXFilter.AskExt();

if (result == WebDialogResult.OK){

Customer customer = Base.BAccount.Current;

if (customer == null) return adapter.Get();

var Filter = pXFilter.Current;

if (Filter == null) return adapter.Get();

var serviceOrderEntry = PXGraph.CreateInstance<ServiceOrderEntry>(); //Field Service Graph

if (serviceOrderEntry == null) return adapter.Get();


FSServiceOrder fsServiceOrder = new FSServiceOrder()
{
CustomerID = Base.BAccount.Current.BAccountID,
SrvOrdType = Filter.ServiceOrderType
};

if (fsServiceOrder.SrvOrdType == null)
{
const string ErrorMessage = "Service Order cant be blank";

throw new PXSetPropertyException(ErrorMessage, PXErrorLevel.Error);

}

PXLongOperation.StartOperation(Base, delegate ()
{

fsServiceOrder = serviceOrderEntry.ServiceOrderRecords.Insert(fsServiceOrder);

throw new PXRedirectRequiredException(serviceOrderEntry, null);


});




}
return adapter.Get();
}

public override void Initialize()
{
base.Initialize();

Base.action.AddMenuAction(CreateServiceOrderAction);
}

}

}

the address lookup

 

 


2 replies

Userlevel 7
Badge +8

Hi @MarcoL45 Where you able to find a solution for your issue? I am on 23.206 and am facing the same issue with both Service Order (FS300100) and Appointments (FS300200) screens. As sson as I add any custom control, a panel, a field, an action or smartpanel (in may case I have them all) the AddressLookup stops working. It loads the dialog but doesn’t show the map but rather blank panel. 

@Yuriy Zaletskyy @Dmitrii Naumov @BenjaminCrisman @Zoltan Febert 

Userlevel 7
Badge +8

I am circulating this to the top so hopefully someone from Acumatica team will respond to it. This seems to be a common issue on screens with AddressLookup. I tested this further and code customization as long as they are not adding new control to the UI doesn’t cause any issues but when a control added to UI either programmatically (like Action buttons) or page customization (Field, group, column…) the issue appears.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved