Skip to main content
Solved

Adding to a Tab with a Custom Button and Popup


Forum|alt.badge.img

 

 

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?

 

 

Best answer by Nilkanth Dipak

 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!

View original
Did this topic help you find an answer to your question?

3 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • July 4, 2024

@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.

 


Nilkanth Dipak
Semi-Pro I
Forum|alt.badge.img+10

 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!


Forum|alt.badge.img

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings