Solved

Transfer Field from GLTran to PMTran

  • 12 October 2023
  • 3 replies
  • 109 views

Userlevel 4
Badge +1

Hello-

I have a custom field that I am trying to transfer from GLTran (Journal Transaction) to PMTran (Project Transaction) when the native conditions are met to create a project transaction on release of Journal Transaction. The issue I’m running into is that that I can’t find a viable method to attach my logic to- I have tried FieldUpdated and RowPersisting on the RegisterEntryGraph to no avail- releasing the Journal Transaction does not trigger any of the events. Anybody have any suggestions on where to tie my logic to transfer this custom field from the GL to the PM? I’m thinking I might have to override the ‘Release’ of the journal entry.. which I would rather avoid if all possible because that adds more complication if the Journal Transaction was created from a separate module first.

Thanks in advance!

icon

Best answer by vardan22 14 October 2023, 17:57

View original

3 replies

Userlevel 4
Badge +1

You need to create a graph extension based on an existing extension called JournalEntryProjectExt, which is located in the PX.Objects.PM.GraphExtensions namespace. After this, you need to override the InsertProjectTransaction method.

public class JournalEntryProjectExtExt : PXGraphExtension<JournalEntryProjectExt, JournalEntry>
{
public static bool IsActive() => true;

#region PXOverride
public delegate PMTran InsertProjectTransactionDelegate(PMProject project, PMTask task, PMAccountGroup ag, Account acc, GLTran tran, APTran apTran, ARTran arTran);
[PXOverride]
public virtual PMTran InsertProjectTransaction(PMProject project, PMTask task, PMAccountGroup ag, Account acc, GLTran tran, APTran apTran, ARTran arTran, InsertProjectTransactionDelegate insertProject)
{
PMTran pmTran = insertProject(project, task, ag, acc, tran, apTran, arTran);
if (pmTran != null)
{
//TODO: Add your custom logic here
}
return pmTran;
}
#endregion
}

 

Userlevel 4
Badge +1

@vardan22 - I didn’t even know this graph existed, thank you so much! I will give it a shot.

Userlevel 3
Badge +1

Much like the above issue I am trying to copy a Custom field from APTran to PMTran following the normal logic for billable expenses but in my effort to reproduce the logic above I can not seem to fine the right GraphExtention to start with.  I was thinking it would be PX.Objects.AP.APReleaseProcess or PX.Objects.PM.APReleaseProcessExt but can’t seem to find it.  Any help to point me in the right direction would be great.

 

Thanks,

 

 

 

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