Skip to main content
Solved

Adding to a Tab with a Custom Button and Popup

  • 4 July 2024
  • 3 replies
  • 61 views

 

 

I need to implement the same logic on a custom screen. When I click the custom button, it should pop up a dialog box like the inventory lookup (see the image below). I need to select from the grid and have options to Add, Add & Close to the detail tab.


What are the steps to implement this, and where can I find the relevant code?

 

 

3 replies

Userlevel 7
Badge +19

@rashmikamudalinayake10  Please  refer to the below link so that you will basic idea to build a popup and modify the logic according to your requirement.

 

Userlevel 6
Badge +4

 Hi @rashmikamudalinayake10 ,

You can find the this logic under the below graph extension, if you are using 24 R1.

 PX.Objects.Extensions.AddItemLookup.AddItemLookupBaseExt<TGraph, TDocument, TItemInfo, TItemFilter> abstract graph extension. It is implemented by PX.Objects.SO.GraphExtensions.SOOrderEntryExt.SOOrderSiteStatusLookupExt for SOOrderEntry

For previous versions, there is an action button command you can easily find in Aspx file.

 <CustomItems>
<px:PXToolBarButton Text="Add Items" Key="cmdASI">
<AutoCallBack Command="AddInvBySite" Target="ds">
<Behavior CommitChanges="True" PostData="Page" />
</AutoCallBack>
</px:PXToolBarButton>

And here is the source code for that action command.

public PXAction<SOOrder> addInvBySite;
[PXUIField(DisplayName = "Add Items", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
[PXLookupButton]
public virtual IEnumerable AddInvBySite(PXAdapter adapter)
{
if (sitestatus.AskExt((PXGraph g, string viewName) => sitestatusfilter.Cache.Clear()) == WebDialogResult.OK)
{
return AddInvSelBySite(adapter);
}
sitestatusfilter.Cache.Clear();
sitestatus.Cache.Clear();
return adapter.Get();
}

Hope, it helps!

Userlevel 4
Badge

Thank you @Naveen Boga , @Dipak Nilkanth. I'll try this and update the thread here.

Reply