Question

Show value of Service Order Custom Field on Appt, Part 2

  • 6 June 2022
  • 1 reply
  • 67 views

Userlevel 1
Badge

I have field CustPORefNbr on my Service Orders screen that I wish to display on any Appointments spawned from the parent Service Order. I have created a custom field (UsrCustPORefNbr) on the Appointments screen that I wish to fill with the value from the parent Service Orders CustPORefNbr.

It’s a read-only field on the Appointments screen; I don’t need it to update the database. It’s fine with me if it pulls the value from the Service Orders screen (DAC) every time the Appointment is displayed.

I tried the following, but it caused my server to reboot endlessly:

 

The perpetual reboots happened on both my development and production servers.

Anybody got another suggestion, or know what I did wrong? Thanks much.


1 reply

Userlevel 5
Badge +2

@davidpoole21 Do not use PXUnboundDefault attribute for bound fields, instead, use PXDefault attribute.

In your case, if you want a custom bound field in FSAppointment, you would need also to add a logic in ServiceOrderEntry maybe in FieldUpdated_CustPORefNbr to update the custom field (FSAppointmentExt.UsrCustPORefNbr) in all existing appointments associated to this customer when this value is updated from the Service Order screen.

However, depending on the use of this custom field, you wouldn’t need to create it, i.e., if you only need to display this value (FSServiceOrder.CustPORefNbr) in the Appointment screen, you could add it in the header of the App screen taking the value directly from FSServiceOrder.CustPORefNbr. There’s already a region in the header where some fields from Service Order are displayed. (Check Branch Location field)

If you still need this field in FSAppointment, another option for you would be to have an unbound field in Appointment screen and forget about adding logic in Service order screen to update this field. In this case I suggest to define the attributes as follows:
 

 

Notice this field is defined as unbound (PXString) and PXDefault with PersistingCheck = Nothing + PXDBScalar set and keep the value respectively of this unbound field at all time.

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