Hi,
I added a smart panel for my customized screen. After the customer select, all the purchase order show in smart panel like below.
After I clicked the checkbox and clicked ADD button clicked line need to be add to the grid view Below like that.
But,My issue is when I clicked the add button data is not added to grid.
This is my Action method.
public PXAction<APProforma> addNewOrder;
[PXButton(CommitChanges = true, DisplayOnMainToolbar = false)]
[PXUIField(DisplayName = "", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Visible = false)]
protected virtual IEnumerable AddNewOrder(PXAdapter adapter)
{
APProformaView.AllowInsert = true;
PXSelectBase<POOrder> orders =
new PXSelect<POOrder,
Where<POOrder.orderNbr, Equal<Current<APProformaItemList.ponbr>>>>(Base);
foreach (POOrder item in orders.Select())
{
APProformaItemList newOrder = new APProformaItemList();
newOrder = APProformaView.Insert(newOrder);
newOrder.Ponbr = item.OrderNbr;
newOrder.POLineNbr = 5;
newOrder.ProFormaQty = 100;
newOrder.Itemid = 1;
newOrder.POrderQty = 25;
APProformaView.Update(newOrder);
}
return adapter.Get();
}
For your reference:
APProforma = Parent DAC (customized form)
APProformaItemList = DAC for the grid in the tab
APProformaEntry = screen graph
Can you please help me for the issue.
Thanks you