Skip to main content
Answer

Grid values disappear until refresh of the screen

  • April 17, 2025
  • 4 replies
  • 116 views

Forum|alt.badge.img

Good day,

In shipments screen I added in the header an unbound field with a button and a tab named Labels with a grid. When entering a quantity of labels to be made the button is pressed and it creates the label record in the custom table and appears in the grid,  but my problem is that when creating labels the first time they appear and a few seconds later they disappear until I refresh the screen, the records are in the database and the labels are created just fine, but I don't know why they randomly disappear from the screen, I am not sure if I missed a configuration for the grid in the editor.

  public class SOShipmentEntry_Extension : PXGraphExtension<PX.Objects.SO.SOShipmentEntry>
{
public PXSelect<EVTCCustomLabels,
Where<EVTCCustomLabels.shipmentNbr, Equal<Current<SOShipment.shipmentNbr>>>> LabelsView;

public PXAction<SOShipment> generateLabel;
[PXButton (CommitChanges = true)]
[PXUIField(DisplayName = "Generate Labels", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]

protected virtual IEnumerable GenerateLabel(PXAdapter adapter)
{
SOShipment ship = Base.Document.Current;

if (ship != null)
{
if(ship.ShipmentNbr != null)
{
SOShipmentExt labelsQty = PXCache<SOShipment>.GetExtension<SOShipmentExt>(ship);
if (labelsQty.UsrLabelsQty > 0)
{
for (int i = 0; i < labelsQty.UsrLabelsQty.Value; i++)
{
EVTCCustomLabels newLabel = new EVTCCustomLabels
{
ShipmentNbr = ship.ShipmentNbr,
ShipmentType = ship.ShipmentType,
Label = "Label"
};
LabelsView.Cache.Insert(newLabel);
}
Base.Actions.PressSave();
LabelsView.Cache.Clear();
LabelsView.View.RequestRefresh();
}
}
}
return adapter.Get();
}
#region Event Handlers

#endregion
}

 

Best answer by darylbowman

You need to set the grid Height (or Min-Height, if auto-sizing)

4 replies

Forum|alt.badge.img+7
  • Captain II
  • April 17, 2025

I haven’t figured out the exact cause of this but I think it is rooted in the properties of the grid. Make sure that it is configured similarly to one of the other grids and it should clear up this issue.


darylbowman
Captain II
Forum|alt.badge.img+15
  • Answer
  • April 18, 2025

You need to set the grid Height (or Min-Height, if auto-sizing)


Forum|alt.badge.img

You need to set the grid Height (or Min-Height, if auto-sizing)

Yes!, this solved the issue, thank you


Forum|alt.badge.img

I haven’t figured out the exact cause of this but I think it is rooted in the properties of the grid. Make sure that it is configured similarly to one of the other grids and it should clear up this issue.

At first I was checking out the Syncposition and other attributes but it was the Height and the width, I used the same values from Details grid and it worked, Thank you.