Solved

How can I customize Release Process logic in Release AP Documents Screen

  • 27 June 2023
  • 3 replies
  • 116 views

Userlevel 4
Badge +1

I want to customize Release process logic on Release AP Documents screen. Although I override the Release logic using ReleaseDelegate method on APInvoiceEntry Graph, the logic is not triggering when I Release AP Documents from Release AP Documents screen. 

Any idea or suggestion?

icon

Best answer by Naveen Boga 27 June 2023, 11:13

View original

3 replies

Userlevel 4
Badge +1

@Naveen Boga  Yes it worked!. Thank you.

@jinin Thanks for the response. I tried that. But it didn’t work. 

Userlevel 7
Badge +11

Hi @charithalakshan49 ,

You can try the below alternate approach also. Overriding the release button.
 

 public class APInvoiceEntryExt : PXGraphExtension<APInvoiceEntry>
    {
        public static bool IsActive() => true;
      
        [PXUIField(DisplayName = "Release", MapEnableRights = PXCacheRights.Update, MapViewRights = PXCacheRights.Update)]
        [PXProcessButton]
        [APMigrationModeDependentActionRestriction(
            restrictInMigrationMode: false,
            restrictForRegularDocumentInMigrationMode: true,
            restrictForUnreleasedMigratedDocumentInNormalMode: true)]
        public virtual IEnumerable Release(PXAdapter adapter)
        {
            PXCache cache = Base.Document.Cache;
            List<APRegister> list = new List<APRegister>();

            throw new PXException("Release Action");

            //return list;
        }
    }

Userlevel 7
Badge +17

Hi @charithalakshan49  Have you tried like below and not invoking?

 

ublic class APReleaseProcess_Extension : PXGraphExtension<PX.Objects.AP.APReleaseProcess>
{
#region Event Handlers
public delegate List<APRegister> ReleaseDocProcDelegate(JournalEntry je, APRegister doc, Boolean isPrebooking, ref List<INRegister> inDocs);
[PXOverride]
public List<APRegister> ReleaseDocProc(JournalEntry je, APRegister doc, Boolean isPrebooking, ref List<INRegister> inDocs, ReleaseDocProcDelegate baseMethod)
{
var retVal = baseMethod(je,doc,isPrebooking,ref inDocs);
//Your code goes here.
PXTrace.WriteInformation("My override worked!");
return retVal;
}


#endregion
}

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved