Skip to main content

Hi,

 

I am working with a customization project and we have added custom fields on the Shipments screen. We have a DAC class set up in Visual Studio, the Database Scripts for these fields have been added in the Project Editor, and the fields have also been added to the screen in the Project Editor. We have added custom fields for seven other screens in this way and they are working just fine. However, with Shipments it seems whenever changes are made to the project in Visual Studio and the new DLL is loaded into the Project Editor, the custom Shipment fields disappear from the Customization Project. The fields will remain in the Screen Editor, under the Form tree, but are removed in the Custom Data Fields section in the Screen Editor. They are also not visible on the Shipments page in the Acumatica instance. This occurs when a new DLL is loaded into the Project Editor, even with changes unrelated to the Shipment fields.

I have tried removing the artifacts of these fields in the Form tree, adding the fields in through the Screen Editor, publishing the project, adding the fields back into the tree, then publishing again. This worked in the past, but only until a new DLL was loaded into the project. After trying this the most recent time, the Shipment Extension class seems to not work with these fields.

Is anyone familiar with what could be going on with these fields and how this can be fixed?

 

Thank you,

Noah

Hi Noah,

Can you please share your code here?


Hi Naveen, here is the code for the custom fields. Thank you for taking a look.

[PXCopyPasteHiddenFields(typeof(MYSOShipmentExt.usrLocked))]
public class MYSOShipmentExt : PXCacheExtension<PX.Objects.SO.SOShipment>
{
#region UsrDLTimeStamp
[PXDate(DisplayMask = "G", InputMask = "G")]
[PXUIField(DisplayName = "Downloaded", Enabled = false)]
[PXDBScalar(typeof(Search<CustomPage.lastModifiedDateTime, Where<CustomPage.docNbr, Equal<SOShipment.shipmentNbr>,
And<CustomPage.docType, Equal<MYConstants.ShipDocType>>>>))]
public virtual DateTime? UsrDLTimeStamp { get; set; }
public abstract class usrDLTimeStamp : Data.BQL.BqlString.Field<usrDLTimeStamp> { }
#endregion

#region UsrLocked
[PXBool]
[PXUIField(DisplayName = "Locked", Enabled = false)]
[PXDBScalar(typeof(Search<CustomPage.locked, Where<CustomPage.docNbr, Equal<SOShipment.shipmentNbr>,
And<CustomPage.docType, Equal<MYConstants.ShipDocType>>>>))]
public virtual bool? UsrLocked { get; set; }
public abstract class usrLocked : Data.BQL.BqlBool.Field<usrLocked> { }
#endregion

#region UsrStatus
[PXString(20)]
[PXUIField(DisplayName = "Status", Enabled = false)]
[PXDBScalar(typeof(Search<CustomPage.message, Where<CustomPage.docNbr, Equal<SOShipment.shipmentNbr>,
And<CustomPage.docType, Equal<MYConstants.ShipDocType>>>>))]
public virtual string UsrStatus { get; set; }
public abstract class usrStatus : Data.BQL.BqlString.Field<usrStatus> { }
#endregion

#region UsrDnloadForm
public abstract class usrDnloadForm : IBqlField { }
[PXDBBool]
[PXUIField(DisplayName = "Download Form", Enabled = true)]
public virtual bool? UsrDnloadForm { get; set; }
#endregion
}

 


Hi Noah,

You have added 4 custom fields and out of that 3 are unbound fields (which cannot save in the database) except the UsrDnloadForm field (Bound field). You said that you have added the database scripts but actually, database scripts are not required for the unbound fields.

Once you moved from the customization project to DLL, then it will be removed from the customization project and available in the DLL.

 


Hi Naveen,

Looks like I got a bit mixed up. I have the database script for the single bound field, but not the unbound fields. The database side is working correctly, but the four custom fields are removed from the UI and aren’t available for selection to place into a column or row in the Screen Editor.

I just tried republishing the Customization Project and it ended up solving the issue. The fields are working as they should be. I am not sure what the issue is with this page.

These fields are also removed when publishing to a different instance. It can be working on one instance but exporting that Project and publishing it on a second instance will remove the fields from the UI again.

Thank you.


HI, @noahmiller02  NOT sure what would be the root cause here and there is no issue with the DAC fields, which you shared above.

Can you please let me know where exactly you are adding these fields on the screen?


Hi @Naveen Boga,

I am adding these fields to the Shipments screen under the “Form: Document” section. This is next to fields such as Shipment Nbr, Status, ect. Originally, I created the DAC and the fields showed up in the available custom fields for the Shipments screen. I was able to add these to the tree, under Form, and everything worked well. Now, publishing causes the fields to disappear from the available custom fields list. I have included a picture below for reference. The left marks the custom fields that had been working, and the right shows that they are missing.

Thank you for your time,

Noah

 


Just an update. I have been using an Acumatica instance on a 22r1 release. I just tried importing and publishing the customization package into a 21r2 release and the fields are showing up and working as expected. Not sure what could be going on.


I spoke with a member of the Developer Support Team and they spotted an issue with the IsActive() methods we override in our DACs and graph extensions. We create graphs in these methods which can cause deadlocks and return false. Thus, not loading our custom fields or business logic. It was suggested to implement caching using database slots to read data instead of creating graphs. I hope this helps someone.

 

Noah


Reply