Solved

Appointment Summary (FS400100) is sorting by Asec instead of Desc

  • 16 October 2023
  • 6 replies
  • 93 views

Userlevel 2

I am working on a customization that will change the appointments summary (FS400100) page ordering to descending instead of ascending which it is currently (this build is 23.108).  While i was working on this issue, I realized that it is sorting in descending order on Build 23.111.0019. This does not make sense as the business logic is identical. I also unpublished all the builds on both instances to make sure that a different customization wast the causing this.

 

Was this fixed in the new build? or am i missing something.

 

Thank you

icon

Best answer by MarcoL45 24 October 2023, 16:58

View original

6 replies

Userlevel 7
Badge +4

Hi @MarcoL45, Can you please share more details/customization using which we could reproduce the issue?

Userlevel 2

Thank you for the reply!

 

All customization are turned off. Here is the problem I am having. Notice the “Scheduled Start Date” is Desc order on build 23.111.0019 but is ASC on build 23.1080020. The buisness logic is the same on both insistence

Build 23.111.0019

Appointment Summary (FS400100)

 

Business Logic

[PXFilterable]
public PXSelectJoinGroupBy<FSAppointmentFSServiceOrder,
LeftJoin<FSAppointmentEmployee, On<FSAppointmentEmployee.appointmentID, Equal<FSAppointmentFSServiceOrder.appointmentID>>,
LeftJoin<FSAppointmentResource, On<FSAppointmentResource.appointmentID, Equal<FSAppointmentFSServiceOrder.appointmentID>>,
LeftJoin<FSCustomerBillingSetup, On<FSCustomerBillingSetup.cBID, Equal<FSAppointmentFSServiceOrder.cBID>>,
LeftJoin<FSGeoZonePostalCode, On<FSGeoZonePostalCode.postalCode, Equal<FSAppointmentFSServiceOrder.postalCode>>,
LeftJoinSingleTable<Customer, On<Customer.bAccountID, Equal<FSAppointmentFSServiceOrder.customerID>>>>>>>,
Where2<
Where<
Current<AppointmentInqFilter.branchID>, IsNull,
Or<Current<AppointmentInqFilter.branchID>, Equal<FSAppointmentFSServiceOrder.branchID>>>,
And2<
Where<
Current<AppointmentInqFilter.branchLocationID>, IsNull,
Or<Current<AppointmentInqFilter.branchLocationID>, Equal<FSAppointmentFSServiceOrder.branchLocationID>>>,
And2<
Where<
Current<AppointmentInqFilter.customerID>, IsNull,
Or<Current<AppointmentInqFilter.customerID>, Equal<FSAppointmentFSServiceOrder.customerID>>>,
And2<
Where<
Current<AppointmentInqFilter.customerLocationID>, IsNull,
Or<Current<AppointmentInqFilter.customerLocationID>, Equal<FSAppointmentFSServiceOrder.locationID>>>,
And2<
Where<
Current<AppointmentInqFilter.sORefNbr>, IsNull,
Or<Current<AppointmentInqFilter.sORefNbr>, Equal<FSAppointmentFSServiceOrder.soRefNbr>>>,
And2<
Where<
Current<AppointmentInqFilter.serviceContractID>, IsNull,
Or<
Where<
Current<AppointmentInqFilter.serviceContractID>, Equal<FSAppointmentFSServiceOrder.serviceContractID>,
Or<Current<AppointmentInqFilter.serviceContractID>, Equal<FSAppointmentFSServiceOrder.billServiceContractID>>>>>,
And2<
Where<
Current<AppointmentInqFilter.scheduleID>, IsNull,
Or<Current<AppointmentInqFilter.scheduleID>, Equal<FSAppointmentFSServiceOrder.scheduleID>>>,
And2<
Where<
Current<AppointmentInqFilter.staffMemberID>, IsNull,
Or<Current<AppointmentInqFilter.staffMemberID>, Equal<FSAppointmentEmployee.employeeID>>>,
And2<
Where<
Current<AppointmentInqFilter.SMequipmentID>, IsNull,
Or<Current<AppointmentInqFilter.SMequipmentID>, Equal<FSAppointmentResource.SMequipmentID>>>,
And2<
Where2<
Where<
Current<AppointmentInqFilter.fromScheduledDate>, IsNull,
Or<FSAppointmentFSServiceOrder.scheduledDateTimeEnd, GreaterEqual<Current<AppointmentInqFilter.fromScheduledDate>>>>,
And2<
Where<Current<AppointmentInqFilter.toScheduledDate>, IsNull,
Or<FSAppointmentFSServiceOrder.scheduledDateTimeBegin, LessEqual<Current<AppointmentInqFilter.toScheduledDate>>>>,
And<
Current<AppointmentInqFilter.fromScheduledDate>, LessEqual<Current<AppointmentInqFilter.toScheduledDate>>>>>,
And<
Where<
Customer.bAccountID, IsNull,
Or<Match<Customer, Current<AccessInfo.userName>>>>>>>>>>>>>>>,
Aggregate<
GroupBy<FSAppointmentFSServiceOrder.appointmentID,
GroupBy<FSAppointmentFSServiceOrder.scheduledDateTimeBegin>>>,
OrderBy<
Asc<FSAppointmentFSServiceOrder.scheduledDateTimeBegin,
Desc<FSAppointmentFSServiceOrder.srvOrdType,
Desc<FSAppointmentFSServiceOrder.refNbr>>>>> Appointments;

Build 23.108.0020

Appointment Summary (FS400100)

 

Business Logic

[PXFilterable]
public PXSelectJoinGroupBy<FSAppointmentFSServiceOrder,
LeftJoin<FSAppointmentEmployee, On<FSAppointmentEmployee.appointmentID, Equal<FSAppointmentFSServiceOrder.appointmentID>>,
LeftJoin<FSAppointmentResource, On<FSAppointmentResource.appointmentID, Equal<FSAppointmentFSServiceOrder.appointmentID>>,
LeftJoin<FSCustomerBillingSetup, On<FSCustomerBillingSetup.cBID, Equal<FSAppointmentFSServiceOrder.cBID>>,
LeftJoin<FSGeoZonePostalCode, On<FSGeoZonePostalCode.postalCode, Equal<FSAppointmentFSServiceOrder.postalCode>>,
LeftJoinSingleTable<Customer, On<Customer.bAccountID, Equal<FSAppointmentFSServiceOrder.customerID>>>>>>>,
Where2<
Where<
Current<AppointmentInqFilter.branchID>, IsNull,
Or<Current<AppointmentInqFilter.branchID>, Equal<FSAppointmentFSServiceOrder.branchID>>>,
And2<
Where<
Current<AppointmentInqFilter.branchLocationID>, IsNull,
Or<Current<AppointmentInqFilter.branchLocationID>, Equal<FSAppointmentFSServiceOrder.branchLocationID>>>,
And2<
Where<
Current<AppointmentInqFilter.customerID>, IsNull,
Or<Current<AppointmentInqFilter.customerID>, Equal<FSAppointmentFSServiceOrder.customerID>>>,
And2<
Where<
Current<AppointmentInqFilter.customerLocationID>, IsNull,
Or<Current<AppointmentInqFilter.customerLocationID>, Equal<FSAppointmentFSServiceOrder.locationID>>>,
And2<
Where<
Current<AppointmentInqFilter.sORefNbr>, IsNull,
Or<Current<AppointmentInqFilter.sORefNbr>, Equal<FSAppointmentFSServiceOrder.soRefNbr>>>,
And2<
Where<
Current<AppointmentInqFilter.serviceContractID>, IsNull,
Or<
Where<
Current<AppointmentInqFilter.serviceContractID>, Equal<FSAppointmentFSServiceOrder.serviceContractID>,
Or<Current<AppointmentInqFilter.serviceContractID>, Equal<FSAppointmentFSServiceOrder.billServiceContractID>>>>>,
And2<
Where<
Current<AppointmentInqFilter.scheduleID>, IsNull,
Or<Current<AppointmentInqFilter.scheduleID>, Equal<FSAppointmentFSServiceOrder.scheduleID>>>,
And2<
Where<
Current<AppointmentInqFilter.staffMemberID>, IsNull,
Or<Current<AppointmentInqFilter.staffMemberID>, Equal<FSAppointmentEmployee.employeeID>>>,
And2<
Where<
Current<AppointmentInqFilter.SMequipmentID>, IsNull,
Or<Current<AppointmentInqFilter.SMequipmentID>, Equal<FSAppointmentResource.SMequipmentID>>>,
And2<
Where2<
Where<
Current<AppointmentInqFilter.fromScheduledDate>, IsNull,
Or<FSAppointmentFSServiceOrder.scheduledDateTimeEnd, GreaterEqual<Current<AppointmentInqFilter.fromScheduledDate>>>>,
And2<
Where<Current<AppointmentInqFilter.toScheduledDate>, IsNull,
Or<FSAppointmentFSServiceOrder.scheduledDateTimeBegin, LessEqual<Current<AppointmentInqFilter.toScheduledDate>>>>,
And<
Current<AppointmentInqFilter.fromScheduledDate>, LessEqual<Current<AppointmentInqFilter.toScheduledDate>>>>>,
And<
Where<
Customer.bAccountID, IsNull,
Or<Match<Customer, Current<AccessInfo.userName>>>>>>>>>>>>>>>,
Aggregate<
GroupBy<FSAppointmentFSServiceOrder.appointmentID,
GroupBy<FSAppointmentFSServiceOrder.scheduledDateTimeBegin>>>,
OrderBy<
Asc<FSAppointmentFSServiceOrder.scheduledDateTimeBegin,
Desc<FSAppointmentFSServiceOrder.srvOrdType,
Desc<FSAppointmentFSServiceOrder.refNbr>>>>> Appointments;
#endregion

 

Userlevel 7
Badge +4

@MarcoL45 

You sure there is no other setup/preference causing this?

I just tested on my local 23.111.0019 instance with SalesDemo data and it seems to be sorting ASC for me:

 

Userlevel 2

@MarcoL45

You sure there is no other setup/preference causing this?

I just tested on my local 23.111.0019 instance with SalesDemo data and it seems to be sorting ASC for me:

 

I unpublished all customization in both instances. Which setup/preference could cause this?

Userlevel 2

@RohitRattan88 

After investigating I couldn't find anything. What I ended up doing was overriding initialize() in the AppointmentInq_Extension.

 public class AppointmentInq_Extension : PXGraphExtension<PX.Objects.FS.AppointmentInq>
{

public static bool IsActive() => true;


public override void Initialize()
{
base.Initialize();
Base.Appointments.OrderByNew<OrderBy<Desc<FSAppointmentFSServiceOrder.scheduledDateTimeBegin>>>();
}

}

 

Userlevel 7
Badge +4

@MarcoL45 I am glad you figured out a solution but still strange why different behavior for me than yours.

 

Happy coding 😊

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