Question

New action button causes AddressLookup to stop not show up and stop working

  • 29 November 2023
  • 0 replies
  • 28 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

 

 


0 replies

Be the first to reply!

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