Skip to main content
Answer

Change the transaction description for intercompany balancing entries

  • December 2, 2025
  • 3 replies
  • 25 views

Forum|alt.badge.img

Is it possible to change the transaction description that is automatically generated by intercompany transactions?

Currently the transaction description is “Balancing entry for: BRANCH” but the branch is the same branch that the transaction posts to.  It would be more helpful to people reviewing the general ledger transactions to know what branch that the balancing entry was from.  

These two descriptions should be swapped to be useful:

It is not helpful to see PRODWHOLE has a transaction that is a balancing entry for PRODWHOLE.  It would be more useful to the person reviewing the transaction to know that the branch PRODWHOLE has a balancing entry that came from PRODRETAIL. 

This issue is sort of related to these:

Change the transaction description of invoices created with multiple installment credit terms (Build 2024.2) | Community

Posting meaningful description for journal entries | Community

Does anyone have the code to update the Intercompany transactions? 

Best answer by aleksandrsechin

Hi ​@rena98
Here is how you can implement this logic.
It’s quite difficult to customize this process, since I haven’t found any simple methods to override in order to change the description. But I finally found one that works:

Adding code file
using PX.Data;
using PX.Objects.GL;
using System;
using System.Linq;

namespace MyProject
{
public class PostGraphExt : PXGraphExtension<PostGraph>
{
[PXOverride]
public virtual Batch CreateInterCompany(Batch b, Func<Batch, Batch> baseMethod)
{
var batch = baseMethod?.Invoke(b);

var trans = Base.GLTran_Module_BatNbr.Select().FirstTableItems
.Where(t => t.TranDesc.Contains("Balancing entry for:"));
var descriptions = trans.Select(t => t.TranDesc).ToHashSet();
var firstDescription = descriptions.FirstOrDefault();
var lastDescription = descriptions.LastOrDefault();

foreach (var tran in trans)
{
if (tran.TranDesc == firstDescription)
{
tran.TranDesc = lastDescription;
}
else if (tran.TranDesc == lastDescription)
{
tran.TranDesc = firstDescription;
}
}

return batch;
}

[PXProtectedAccess]
public abstract class PostGraphProtectedExt : PXGraphExtension<PostGraphExt, PostGraph>
{
[PXProtectedAccess(typeof(PostGraph))]
protected abstract Batch CreateInterCompany(Batch b);
}
}
}
Result

FYI: This solution is based on 25R2. If you are using a different version, the code above may need some adjustments. Let me know if that’s the case.

3 replies

Forum|alt.badge.img+3
  • Jr Varsity I
  • Answer
  • December 4, 2025

Hi ​@rena98
Here is how you can implement this logic.
It’s quite difficult to customize this process, since I haven’t found any simple methods to override in order to change the description. But I finally found one that works:

Adding code file
using PX.Data;
using PX.Objects.GL;
using System;
using System.Linq;

namespace MyProject
{
public class PostGraphExt : PXGraphExtension<PostGraph>
{
[PXOverride]
public virtual Batch CreateInterCompany(Batch b, Func<Batch, Batch> baseMethod)
{
var batch = baseMethod?.Invoke(b);

var trans = Base.GLTran_Module_BatNbr.Select().FirstTableItems
.Where(t => t.TranDesc.Contains("Balancing entry for:"));
var descriptions = trans.Select(t => t.TranDesc).ToHashSet();
var firstDescription = descriptions.FirstOrDefault();
var lastDescription = descriptions.LastOrDefault();

foreach (var tran in trans)
{
if (tran.TranDesc == firstDescription)
{
tran.TranDesc = lastDescription;
}
else if (tran.TranDesc == lastDescription)
{
tran.TranDesc = firstDescription;
}
}

return batch;
}

[PXProtectedAccess]
public abstract class PostGraphProtectedExt : PXGraphExtension<PostGraphExt, PostGraph>
{
[PXProtectedAccess(typeof(PostGraph))]
protected abstract Batch CreateInterCompany(Batch b);
}
}
}
Result

FYI: This solution is based on 25R2. If you are using a different version, the code above may need some adjustments. Let me know if that’s the case.


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • December 4, 2025

Thanks so much!  


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • December 4, 2025

@aleksandrsechin that works perfectly, thank you so much!  Now the information is so much more useful when reviewing the transactions. I appreciate you sharing!