Skip to main content
Answer

Activate specific button even in closed invoice

  • February 21, 2022
  • 2 replies
  • 331 views

SadokHanini
Freshman II

Hello Guys,

it’s possible to enable a specific button even in closed invoice?

 

 

Best answer by Dmitrii Naumov

It is possible. 

There are several ways to do this. 

  1. Use workflows. See https://help-2021r2.acumatica.com/(W(2))/Help?ScreenId=ShowWiki&pageid=cbbac950-4172-42c7-b950-a589a87df249
  2. Use something like 
                [ActionName].SetEnabled(true); in RowSelected event
  3. Set access rights in the code
    [PXUIField(DisplayName = “COPIER MARGE”, MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]

2 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • Answer
  • February 21, 2022

It is possible. 

There are several ways to do this. 

  1. Use workflows. See https://help-2021r2.acumatica.com/(W(2))/Help?ScreenId=ShowWiki&pageid=cbbac950-4172-42c7-b950-a589a87df249
  2. Use something like 
                [ActionName].SetEnabled(true); in RowSelected event
  3. Set access rights in the code
    [PXUIField(DisplayName = “COPIER MARGE”, MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]

deebhane
Semi-Pro I
Forum|alt.badge.img+1
  • Semi-Pro I
  • February 22, 2022

hi @SadokHanini  

In continuation to @Dmitrii Naumov  suggestion, to brief more below is the example  for button to get enabled in sales order, you can try similar way on your screen 

 

syntax 

  protected virtual void DACName_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseEvent)

{

   condition and logic 

}

note: here Base Event parameter is required  only when we customized the existing screen for new screen customization this parameter is not required 

 

Example 

  protected virtual void SOOrder_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseEvent)
        {

            if (baseEvent != null)
                baseEvent(cache, e);
            SOOrder row = (SOOrder)e.Row;
            if (row == null) return;

             KNCPAlternateItems.SetEnabled(row.Status == "Completed");

 

}