I have a problem in customize screen Release AP Documents (screnid = AP501000). In case I have already create some additional fields in screen AP Bill And Adjusment, I was created 2 fields in DAC APTran (UsrJobOrderNbr and usrNoSeriFaktur). I create DAC Extension as named APTranExtension. and this below is the sintaks :
using PX.Objects.CR;
using PX.Objects.EP;
using PX.Objects.FA;
using PX.Objects.PO;
using System;
using PX.Data;
using PX.Objects.GL;
using PX.Objects.CM;
using PX.Objects.CS;
using PX.Objects.IN;
using PX.Objects.TX;
using PX.Objects.DR;
using PX.Objects.PM;
using System.Collections.Generic;
using PX.Objects;
using PX.Objects.AP;
namespace SGLCustomization
{
[Serializable]
public class APTranExtension: PXCacheExtension<PX.Objects.AP.APTran>
{
#region UsrJobOrderNbr`enter code here`
public abstract class usrJobOrderNbr : IBqlField{}
[PXDBString(25, IsFixed = true, IsUnicode = true)]
[PXUIField(DisplayName="Job Order Nbr")]
[PXSelector(typeof(Search<JobOrderNbr.jobOrderNbrCD,
Where<JobOrderNbr.status,
Equal<statusActive>>>),
typeof(JobOrderNbr.customerID),
typeof(JobOrderNbr.status),
typeof(JobOrderNbr.usrJobOrderNoRef))]
public string UsrJobOrderNbr
{
get;
set;
}
#endregion
}
}
I also create DAC Extension as named APTaxTranExtension, and this below is the sintaks :
using PX.Objects.CR;
using PX.Objects.EP;
using PX.Objects.FA;
using PX.Objects.PO;
using System;
using PX.Data;
using PX.Objects.GL;
using PX.Objects.CM;
using PX.Objects.CS;
using PX.Objects.IN;
using PX.Objects.TX;
using PX.Objects.DR;
using PX.Objects.PM;
using System.Collections.Generic;
using PX.Objects;
using PX.Objects.AP;
using PX.Objects.AR;
namespace SGLCustomization
{
[Serializable]
public class APTaxTranExtension: PXCacheExtension<PX.Objects.AP.APTaxTran>
{
#region UsrNoSeriFaktur
public abstract class usrNoSeriFaktur : IBqlTable{}
[PXDBString(50, IsFixed = true)]
[PXUIField(DisplayName = "No Seri Faktur / Additional Narration")]
public string UsrNoSeriFaktur { get; set; }
#endregion
}
}
I also create Extension DAC in GLTranExtension, to store values from APTranExtension and APTaxTranExtension. This below is the sintaks of my GLTranExtension :
using System;
using PX.Data;
using PX.Objects.CM;
using PX.Objects.CS;
using PX.Objects.PM;
using PX.Objects.CR;
using PX.Objects.TX;
using System.Collections.Generic;
using PX.Objects;
using PX.Objects.GL;
namespace SGLCustomization
{
[Serializable]
public class GLTranExtension: PXCacheExtension<PX.Objects.GL.GLTran>
{
#region UsrJobOrderNbr
public abstract class usrJobOrderNbr : IBqlField{}
[PXDBString(25, IsFixed = true, IsUnicode = true)]
[PXUIField(DisplayName="Job Order Nbr")]
[PXSelector(typeof(Search<JobOrderNbr.jobOrderNbrCD,
Where<JobOrderNbr.status,
Equal<statusActive>>>),
//typeof(JobOrderNbr.jobOrderNbrCD),
typeof(JobOrderNbr.customerID),
typeof(JobOrderNbr.status))]
public string UsrJobOrderNbr{get;set;}
#endregion
#region UsrNoSeriFaktur
public abstract class usrNoSeriFaktur : IBqlTable { }
[PXDBString(75, IsFixed = true)]
[PXUIField(DisplayName = "No Seri Faktur / Additional Narration")]
public string UsrNoSeriFaktur { get; set; }
#endregion
#region UsrInvoiceNbr
public abstract class usrInvoiceNbr : IBqlTable { }
[PXDBString(60, IsFixed = true)]
[PXUIField(DisplayName = "Vendor Ref. / Customer Order")]
public string UsrInvoiceNbr { get; set; }
#endregion
}
}
My goal is when I input transactions and then I release the document in screen Release AP Document (AP501000), all values in my new additional fields already sent into Journal Transaction screen (GL301000) also.
I already create APReleaseProcessExtension BLC to provide it, but it didn't work. This below is my APReleaseProcessExtension code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PX.Data;
using PX.Objects.AP;
using PX.Objects.GL;
using PX.Objects.CM;
using PX.Objects.CA;
using PX.Objects.CR;
using PX.Objects.CS;
using PX.Objects.CT;
using PX.Objects.PM;
using SGLCustomization;
using SGLCustomization1;
namespace SGLCustomization1
{
public class APReleaseProcessExtension: PXGraphExtension<APReleaseProcess>
{
public delegate List<APRegister> ReleaseDocProcDel(JournalEntry je, ref APRegister doc, PXResult<APInvoice, CurrencyInfo, Terms, Vendor, Account> res, out PMRegister pmDoc);
public List<APRegister> ReleaseDocProc(JournalEntry je, ref APRegister doc, PXResult<APInvoice, CurrencyInfo, Terms, Vendor, Account> res, out PMRegister pmDoc, ReleaseDocProcDel del)
{
je.RowInserting.AddHandler<GLTran>((sender, e) =>
{
GLTran glTran = e.Row as GLTran;
APTran apTran = PXResult<APTran>.Current;
if (glTran != null && apTran != null)
{
APTranExtension apTex = PXCache<APTran>.GetExtension<APTranExtension>(apTran);
if (apTran != null && apTex.UsrJobOrderNbr != null)
{
GLTranExtension glTex = PXCache<GLTran>.GetExtension<GLTranExtension>(glTran);
glTex.UsrJobOrderNbr = apTex.UsrJobOrderNbr;
}
}
APInvoice api = PXResult<APInvoice>.Current;
if (api != null && api.InvoiceNbr != null)
{
GLTranExtension glTex = PXCache<GLTran>.GetExtension<GLTranExtension>(glTran);
glTex.UsrInvoiceNbr = api.InvoiceNbr;
}
APTaxTran apTax = PXResult<APTaxTran>.Current;
if (apTax != null)
{
APTaxTranExtension apTaxEx = PXCache<APTaxTran>.GetExtension<APTaxTranExtension>(apTax);
if (apTax != null && apTaxEx.UsrNoSeriFaktur != null)
{
GLTranExtension glTex = PXCache<GLTran>.GetExtension<GLTranExtension>((GLTran)e.Row);
glTex.UsrNoSeriFaktur = apTaxEx.UsrNoSeriFaktur;
}
}
});
return del(je, ref doc, res, out pmDoc);
}
#region Event Handlers
#endregion
}
}
Please help me to provide my goal,