I am trying to change the “Create Appointment” button on the Service Order screen so it opens up in a new window instead of the current. Is there a way I can only override part of the action?
Best answer by Vignesh Ponnusamy
View originalI am trying to change the “Create Appointment” button on the Service Order screen so it opens up in a new window instead of the current. Is there a way I can only override part of the action?
Best answer by Vignesh Ponnusamy
View originalHi
You can invoke the base in the try and catch the PXRedirectRequiredException then use the information to redirect to the new window. Following is an example,
public class ServiceOrderEntry_Extension : PXGraphExtension<PX.Objects.FS.ServiceOrderEntry>
{
#region Event Handlers
public delegate IEnumerable ScheduleAppointmentDelegate(PXAdapter adapter);
[PXOverride]
public IEnumerable ScheduleAppointment(PXAdapter adapter, ScheduleAppointmentDelegate baseMethod)
{
try
{
baseMethod(adapter);
}
catch (PXRedirectRequiredException e)
{
throw new PXRedirectRequiredException(e.Graph, false, "Appt") { Mode = PXBaseRedirectException.WindowMode.New };
}
return baseMethod(adapter);
}
#endregion
}
Good Luck.!
Thank you so much this worked as expected!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.