Hi @ramya15 If you wanted to update the existing line, then you need to the conditions and update the line. Just like below.
Hope this helps!
public PXAction<ARPayment> release;
[PXUIField(DisplayName = "Release", MapEnableRights = PXCacheRights.Update, MapViewRights = PXCacheRights.Update)]
[PXButton()]
public IEnumerable Release(PXAdapter adapter)
{
PXGraph.InstanceCreated.AddHandler<JournalEntry>(graph =>
{
graph.RowUpdated.AddHandler<GLTran>((cache, e) =>
{
var crline = (GLTran)e.Row;
graph.GLTranModuleBatNbr.Current = crline;
if (crline.AccountID == cond1 && row.SubID == Cond2)
{
crline.TranType = ARDocType.Payment;
crline.RefNbr = Base.Document.Current.RefNbr;
crline.CuryCreditAmt = 10;
crline.CuryDebitAmt = 0;
crline.Released = true;
graph.GLTranModuleBatNbr.Cache.Update(crline);
}
});
});
return Base.release.Press(adapter);
}