I am trying to create a Field to store 'VendorID', in my own DAC.
First I tried using Acumatica attributes to show the selector, like the below
[VendorNonEmployeeActive(Visibility = PXUIVisibility.SelectorVisible, DescriptionField = typeof(Vendor.acctName), CacheGlobal = true, Filterable = true)]
AND
[POVendor(Visibility = PXUIVisibility.SelectorVisible, DescriptionField = typeof(Vendor.acctName), CacheGlobal = true, Filterable = true)]
AND other few attributes. but either it shows employee data or nothing. I even tried to write a selector of my own as below where BAccountRef is a class derived from BAccount.
[PXSelector(typeof(Search2<Vendor.bAccountID,
InnerJoin<BAccountRef, On<Vendor.bAccountID, Equal<BAccountRef.bAccountID>>>,
Where<Vendor.status, Equal<BAccountRef.status.active>,
And<Vendor.type, Equal<BAccountType.vendorType>>>>), new Type[] { typeof(BAccountRef.acctCD), typeof(BAccountRef.acctName) },
SubstituteKey = typeof(BAccountRef.acctCD))]
Unfortunately no luck, from the behaviour, it seems like the records are auto filtered to show employee info. I cant figure out how this is happening. How to make the selector show vendor info? How this is auto filtering the employees in this graph?
Most likely your BQL queries towards Vendor DAC are translated into SQL queries to EPEmployee table. This behavior is caused by the EPEmployee cache (and therefore the BAccount cache) initialized prior to Vendor cache.
Try using PX.Objects.AP.VendorAttribute together with the BAccountR DAC - use of BAccountR will break inheritance between the Vendor and BAccount' DACs and should be translated into SQL queries towardsBAccountandVendor` tables:
[Vendor(typeof(Search<BAccountR.bAccountID,
Where<BAccountR.type, Equal<BAccountType.companyType>,
Or<Vendor.type, NotEqual<BAccountType.employeeType>>>>),
Visibility = PXUIVisibility.SelectorVisible, CacheGlobal = true, Filterable = true)]
[PXRestrictor(typeof(Where<Vendor.status, IsNull,
Or<Vendor.status, Equal<BAccount.status.active>,
Or<Vendor.status, Equal<BAccount.status.oneTime>>>>),
AP.Messages.VendorIsInStatus, typeof(Vendor.status))]
Thanks All,
#Ruslan's answer helped to get the correct definition for the selector. When we use BAccountR or VendorR DAC's the SQL is not translating to EPEmployee and hence i am able to get the correct information.
[PXDimensionSelectorAttribute("VENDOR", typeof(Search<VendorR.bAccountID, Where<VendorR.type, Equal<BAccountType.vendorType>,
And<VendorR.status, Equal<BAccount.status.active>>>>), typeof(VendorR.acctCD), new Type[] { typeof(VendorR.acctCD), typeof(VendorR.acctName) })]
In one of my recent projects I've used the following in order to get VendorCD:
#region vendor
public abstract class vendor : PX.Data.IBqlField
{
}
protected string _Vendor;
[VendorRaw(typeof(Where<Vendor.vendorClassID, Equal<Current<VendorFilter.vendorClassID>>>),
DescriptionField = typeof(Vendor.acctName), DisplayName = "Vendor ID")]
[PXDefault("", PersistingCheck = PXPersistingCheck.Nothing)]
public virtual string Vendor
{
get
{
return this._Vendor;
}
set
{
this._Vendor = value;
}
}
#endregion
recently I had to add a Vendor Selector on the ExpenseClaimsDetails DAC, after trying several options, this is the one that worked for me:
[PXDBInt()]
[PXUIField(DisplayName = "Vendor", Enabled = true)]
[PXDimensionSelector("VENDOR", typeof(Search<VendorR.bAccountID, Where<VendorR.vStatus, Equal<VendorStatus.active>>>),
typeof(VendorR.acctCD),
new Type[] { typeof(VendorR.acctCD),
typeof(VendorR.acctName),
typeof(VendorR.vendorClassID),
typeof(VendorR.taxRegistrationID)},
Filterable = true,
SelectorMode = PXSelectorMode.TextModeSearch,
DescriptionField = typeof(VendorR.acctName))]
public int? UsrEVVendorID { get; set; }
public abstract class usrEVVendorID : PX.Data.BQL.BqlInt.Field<usrEVVendorID> { }
Related
I have implemented CRM activity on the Custom page where the Key Field is SOOrder Type, SOOrder Nbr & Job Code which are stored in custom DAC. I have tried to add the Entity Type listed on Related Entity and I am not able to figure out how to do it. Pls let me know where to add or override the method to Implement the functionality
The following cod used to implement the CRM Activity
public sealed class SOOrderJobActivities : CRActivityList<PSSOOrderJob>
{
public SOOrderJobActivities(PXGraph graph)
: base(graph) { }
protected override RecipientList GetRecipientsFromContext(NotificationUtility utility, string type, object row, NotificationSource source)
{
var recipients = new RecipientList();
var order = _Graph.Caches[typeof(PSSOOrderJob)].Current as PSSOOrderJob;
if (order == null || source == null)
return null;
SOOrder ord = SOOrder.PK.Find(_Graph, order.OrderType, order.OrderNbr);
var contact = SOOrder.FK.Contact.FindParent(_Graph, ord);
if (contact == null || contact.EMail == null)
return null;
recipients.Add(new NotificationRecipient()
{
Active = true,
AddTo = RecipientAddToAttribute.To,
Email = contact.EMail
});
source.RecipientsBehavior = RecipientsBehaviorAttribute.Override;
return recipients;
}
}
Update
After going through the Acumatica code, I have done the following changes
#region Noteid
[PXNote(ShowInReferenceSelector =true,Selector =typeof(Search2<PSSOOrderJob.jobCode,
InnerJoin<SOOrder,On<PSSOOrderJob.orderType,Equal<SOOrder.orderType>,And<PSSOOrderJob.orderNbr, Equal<SOOrder.orderNbr>>>>,
Where<SOOrder.orderType,Equal<Current<PSSOOrderJob.orderType>>,And<SOOrder.orderNbr, Equal<Current<PSSOOrderJob.orderNbr>>>>>))]
public virtual Guid? Noteid { get; set; }
public abstract class noteid : PX.Data.BQL.BqlGuid.Field<noteid> { }
#endregion
The entity comes into selection, But I am not able to select the relative entity document and the value is not getting updated in the related entity field.
The above screenshot the select is missing and not able to select the document
The following steps I have done to add relative Entity for any Activity using custom DAC
1. Added ShowInReferenceSelector = true in PXNoteID field.
2. Added Selector in PXNoteID field
3. Decorated [PX.Data.EP.PXFieldDescription] attribute for Key fields
#region NoteID
[PXNote(ShowInReferenceSelector = true, Selector = typeof(Search2<PSSOOrderJob.jobCode,
InnerJoin<SOOrder, On<PSSOOrderJob.orderType, Equal<SOOrder.orderType>, And<PSSOOrderJob.orderNbr, Equal<SOOrder.orderNbr>>>>,
Where<SOOrder.orderType, Equal<Current<PSSOOrderJob.orderType>>, And<SOOrder.orderNbr, Equal<Current<PSSOOrderJob.orderNbr>>,And<PSSOOrderJob.jobType,Equal<Current<PSSOOrderJob.jobType>>>>>>), DescriptionField = typeof(PSSOOrderJob.jobCode))]
//[PXNote(ShowInReferenceSelector = true)]
public virtual Guid? NoteID { get; set; }
public abstract class noteID : PX.Data.BQL.BqlGuid.Field<noteID> { }
#endregion
#region JobCode
[PXDBString(15, IsKey = true, IsUnicode = true, InputMask = ">CCCCCCCCCCCCCCC")]
[PXUIField(DisplayName = "Job Code")]
[PXDefault()]
[PXSelector(typeof(Search<PSSOOrderJob.jobCode, Where<PSSOOrderJob.orderType, Equal<Current<PSSOOrderJob.orderType>>, And<PSSOOrderJob.orderNbr, Equal<Current<PSSOOrderJob.orderNbr>>,And<PSSOOrderJob.jobType, Equal<Current<PSSOOrderJob.jobType>>>>>>), typeof(PSSOOrderJob.jobCode), ValidateValue = false)]
[PSSOOrderJobNbr.Numbering()]
[PX.Data.EP.PXFieldDescription]
public virtual string JobCode { get; set; }
public abstract class jobCode : PX.Data.BQL.BqlString.Field<jobCode> { }
#endregion
This automatically fills the related entity field with Jobcode.
There still one issue I am facing is not able to access the selector due to Entity field width is more than the popup window and I do not know how to fix it.
This answer is to address the popup size only.
First, give browser zoom a try 'control' + 'minus' key. It might work as a quick workaround.
Otherwise, use the browser debugger feature. Open it with F12 key. Then use the browser debugger inspect element feature (1). Click on the smart panel (2). Go up a bit in html control hierarchy until you reach and select the smart panel root which is a table element (3). Change the width of the smart panel popup using the debugger CSS properties editor (4).
If selector control size increases automatically with window size; change the selector control width instead of popup width using browser debugger CSS property editor.
I'm customizing the Release Time Activities screen (EP507020) in the following ways:
First, I'm putting the Appointment Number in the grid via the 'Add Data Fields' option in the screen customization.
Second, I want to tie back to the Appointments screen (FS300200) via the Appointment Nbr to get the status.
Third, I want to add a user field to the Time Activities grid to hold this obtained status so that the grid can be filtered by the status.
I've run into several problems, the largest of which is that even though I can add the Appointment Number to the Release Time Activities screen grid - and upon inspection it shows that it belongs to the same DAC as all the other fields in that grid - it show NO WHERE in the DAC when I bring up the source code. It isn't in any table I can find either. This is a complete mystery - how can a field show on the inspection window as part of a DAC when it really isn't?
Next - there are two fields in the DAC for the Appointments screen DAC (FSAppointment) - RefNbr (which is the Appointment Number) and the AppointmentID (which is an auto-incrementing identity field). Which one would I use to tie back to the Appointments screen to link the Appointment Nbr (if that's even possible)?
The main issue is that I cannot find the Appointment Nbr in the DAC (EPActivityApprove) to even tie back to the Appointments screen.
Is this something doable?
The Activity dataview bound to Release Time Activities screen (EP507020) grid contains multiple DACs:
public PXFilteredProcessingJoin<
EPActivityApprove,
EPActivityFilter,
LeftJoin<EPEarningType,
On<EPEarningType.typeCD, Equal<EPActivityApprove.earningTypeID>>,
InnerJoin<EPEmployee,
On<EPEmployee.userID, Equal<EPActivityApprove.ownerID>,
And<Where<EPEmployee.timeCardRequired, NotEqual<True>, Or<EPEmployee.timeCardRequired, IsNull>>>>,
LeftJoin<CRActivityLink,
On<CRActivityLink.noteID, Equal<EPActivityApprove.refNoteID>>,
LeftJoin<CRCase,
On<CRCase.noteID, Equal<CRActivityLink.refNoteID>>,
LeftJoin<CRCaseClass,
On<CRCaseClass.caseClassID, Equal<CRCase.caseClassID>>,
LeftJoin<ContractEx,
On<CRCase.contractID, Equal<ContractEx.contractID>>>>>>>>
[...]
Looking at the main DAC we see it extends PMTimeActivity so it will contain all fields of that DAC too:
public class EPActivityApprove : PMTimeActivity
PMTimeActivity doesn't contain AppointmentID either but another DAC named FSxPMTimeActivity does and it also extends PMTimeActivity. That's the reason why you're seeing that field available in EPActivityApprove:
public class FSxPMTimeActivity : PXCacheExtension<PMTimeActivity>
{
#region AppointmentID
public abstract class appointmentID : PX.Data.IBqlField
{
}
[PXDBInt]
[PXUIField(DisplayName = "Appointment Nbr.")]
[PXSelector(typeof(Search<FSAppointment.appointmentID>),
SubstituteKey = typeof(FSAppointment.refNbr))]
public virtual int? AppointmentID { get; set; }
#endregion
}
Given an EPActivityApprove object I think you can get a reference to the extension containing AppointmentID like this:
EPActivityApprove row = ???;
FSxPMTimeActivity rowExt = row.GetExtension<FSxPMTimeActivity>();
int? appointmentID = rowExt.AppointmentID;
As for the joins, you must specify each key field (IsKey = true) from the DAC.
For FSAppointment these would be SrvOrdType and RefNbr (appointmentID is not a key field in that DAC):
#region SrvOrdType
public abstract class srvOrdType : PX.Data.IBqlField
{
}
[PXDBString(4, IsFixed = true, IsKey = true, InputMask = ">AAAA")]
[PXDefault(typeof(FSSetup.dfltSrvOrdType))]
[PXUIField(DisplayName = "Service Order Type")]
[FSSelectorSrvOrdTypeNOTQuote]
[PX.Data.EP.PXFieldDescription]
public virtual string SrvOrdType { get; set; }
#endregion
#region RefNbr
public abstract class refNbr : PX.Data.IBqlField
{
}
[PXDBString(20, IsKey = true, IsUnicode = true, InputMask = "CCCCCCCCCCCCCCCCCCCC")]
[PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
[PXUIField(DisplayName = "Appointment Nbr.", Visibility = PXUIVisibility.SelectorVisible, Visible = true, Enabled = true)]
[PXSelector(typeof(
Search2<FSAppointment.refNbr,
LeftJoin<FSServiceOrder,
On<FSServiceOrder.sOID, Equal<FSAppointment.sOID>>,
LeftJoin<Customer,
On<Customer.bAccountID, Equal<FSServiceOrder.customerID>>,
LeftJoin<Location,
On<Location.locationID, Equal<FSServiceOrder.locationID>>>>>,
Where<
FSAppointment.srvOrdType, Equal<Optional<FSAppointment.srvOrdType>>>,
OrderBy<Desc<FSAppointment.refNbr>>>),
new Type[] {
typeof(FSAppointment.refNbr),
typeof(Customer.acctCD),
typeof(Customer.acctName),
typeof(Location.locationCD),
typeof(FSAppointment.docDesc),
typeof(FSAppointment.status),
typeof(FSAppointment.scheduledDateTimeBegin)
})]
[AppointmentAutoNumber(typeof(
Search<FSSrvOrdType.srvOrdNumberingID,
Where<
FSSrvOrdType.srvOrdType, Equal<Optional<FSAppointment.srvOrdType>>>>),
typeof(AccessInfo.businessDate))]
[PX.Data.EP.PXFieldDescription]
public virtual string RefNbr { get; set; }
#endregion
EDIT:
Took a better look at it, I don't think you'll be able to join on the key fields. Because AppointmentID is a Unique Identifier field you can make an exception in this case and join only on that field because it will behave as a single key field.
In Numbering Sequences settings (CS201010), there is an option for manual numbering.
However, depending on the document type. There are instances where the reference number can be left blank. If it's blank, I'd want the auto numbering to kick in. Or something like call the NextNumber() function before saving the document. Is it possible ? How do I do that ?
At the moment, if I enforce the auto numbering. It doesn't allow me to type anything on the Reference number for example.
TIA
There are two ways: easy and little bit more complicated. Easy one will be attach to FieldDefaulting, and inside of that event check if that field is empty then assign some value into it.
Another way which better feet to Acumatica style is to implement your own AutoNumbering attribute and then apply that Autonumbering attribute to your DAC class. N.B. you can substitute Acumatica autonumbering attribute with yours with PXCacheExtension
below goes example of code with removing default autonumbering with implementing autonumbering via FieldDefaulting:
public class ARInvoiceEntryExt : PXGraphExtension<ARInvoiceEntry>
{
[PXDBString(15, InputMask = ">CCCCCCCCCCCCCCC", IsKey = true, IsUnicode = true)]
[PXDefault]
[PXUIField(DisplayName = "Reference Nbr.", TabOrder = 1, Visibility = PXUIVisibility.SelectorVisible)]
//[ARInvoiceType.RefNbr(typeof(Search2<ARRegisterAlias.refNbr, InnerJoinSingleTable<ARInvoice, On<ARInvoice.docType, Equal<ARRegisterAlias.docType>, And<ARInvoice.refNbr, Equal<ARRegisterAlias.refNbr>>>, InnerJoinSingleTable<Customer, On<ARRegisterAlias.customerID, Equal<Customer.bAccountID>>>>, Where<ARRegisterAlias.docType, Equal<Optional<ARInvoice.docType>>, And2<Where<ARRegisterAlias.origModule, Equal<BatchModule.moduleAR>, Or<ARRegisterAlias.released, Equal<True>>>, And<Match<Customer, Current<AccessInfo.userName>>>>>, OrderBy<Desc<ARRegisterAlias.refNbr>>>), Filterable = true, IsPrimaryViewCompatible = true)]
//[ARInvoiceType.Numbering]
//This is example of throwing away Acumatica autonumbering
//[ARInvoiceNbr]
[PXFieldDescription]
protected void ARInvoice_RefNbr_Cacheattached()
{
}
protected void ARInvoice_RefNbr_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
{
//here you can implement your way of initialization of this field
}
}
Or with attribute you can try something like this:
//somewhere in your code
public class RickAutonumberingAttribute : ARInvoiceNbrAttribute
{
//Here you'll need to play with implementation of your autonumbering
}
public class ARInvoiceEntryExt : PXGraphExtension<ARInvoiceEntry>
{
[PXDBString(15, InputMask = ">CCCCCCCCCCCCCCC", IsKey = true, IsUnicode = true)]
[PXDefault]
[PXUIField(DisplayName = "Reference Nbr.", TabOrder = 1, Visibility = PXUIVisibility.SelectorVisible)]
[ARInvoiceType.RefNbr(typeof(Search2<ARRegisterAlias.refNbr, InnerJoinSingleTable<ARInvoice, On<ARInvoice.docType, Equal<ARRegisterAlias.docType>, And<ARInvoice.refNbr, Equal<ARRegisterAlias.refNbr>>>, InnerJoinSingleTable<Customer, On<ARRegisterAlias.customerID, Equal<Customer.bAccountID>>>>, Where<ARRegisterAlias.docType, Equal<Optional<ARInvoice.docType>>, And2<Where<ARRegisterAlias.origModule, Equal<BatchModule.moduleAR>, Or<ARRegisterAlias.released, Equal<True>>>, And<Match<Customer, Current<AccessInfo.userName>>>>>, OrderBy<Desc<ARRegisterAlias.refNbr>>>), Filterable = true, IsPrimaryViewCompatible = true)]
//[ARInvoiceType.Numbering]
//This is example of throwing away Acumatica autonumbering
[RickAutonumberingAttribute]
[PXFieldDescription]
protected void ARInvoice_RefNbr_Cacheattached()
{
}
}
I have a requirement to create a opportunity like screen and I do not know how to implement the auto generating the document number for newly created document
I am looking forward someone to help me on this issue.
The following steps I have used and I have attached the code for review. I am getting error while saving and not generating the number
I have create a numbering sequence for Memo In document
I have created a DAC for Sequence number setup
region MemoInOrderId
public abstract class memoInOrderId : PX.Data.IBqlField
{
}
protected string _MemoInOrderId;
[PXDBString(10, IsUnicode = true)]
[PXDefault("MEMOIN")]
[PXSelector(typeof(Numbering.numberingID),
DescriptionField = typeof(Numbering.descr))]
[PXUIField(DisplayName = "Memo In Order Nbr")]
public virtual string MemoInOrderId
{
get
{
return this._MemoInOrderId;
}
set
{
this._MemoInOrderId = value;
}
}
#endregion
I have added Auto Generation Sequence number to MemoIn DAC
`
#region OrderNbr
public abstract class orderNbr : PX.Data.IBqlField
{
}
[PXDBString(10, IsUnicode = true, IsKey = true, InputMask = ">CCCCCCCCCCCCCCC")]
[PXUIField(DisplayName = "Order Nbr", Visibility = PXUIVisibility.SelectorVisible)]
[AutoNumber(typeof(MemoSetUp.memoInOrderId), typeof(AccessInfo.businessDate))]
[PXSelector(typeof(MemoIN.orderNbr),
new Type[]
{
typeof(MemoIN.orderNbr),
typeof(MemoIN.orderDate),
typeof(MemoIN.vendorId)
})]
public virtual string OrderNbr { get; set; }
#endregion
In the configuration Screen I have selected numbering sequence used for memo in document
While saving the Memo In document I am getting the following error
I have noticed the Order number is not initialized to "NEW" and it is showing "SELECT"
I have gone through CASetup , CMSetup , ARSetup DAC code and not able to figure out the difference.
If we want to use a numbering sequence it is very straight forward in Acumatica. You should have a setup/preferences field somewhere that defines which numbering sequence you will use for your document number field.
Here is an example of a setup field using a selector to pick a numbering sequence:
// Setup field indicating which numbering sequence to use.
public abstract class myNumberingID : PX.Data.IBqlField
{
}
protected String _MyNumberingID;
[PXDBString(10, IsUnicode = true)]
[PXSelector(typeof(Numbering.numberingID), DescriptionField = typeof(Numbering.descr))]
[PXUIField(DisplayName = "My Numbering Sequence")]
public virtual String MyNumberingID
{
get
{
return this._MyNumberingID;
}
set
{
this._MyNumberingID = value;
}
}
Next, in your document number field you will use the AutoNumberAttribute to define the field as a consumer of a numbering sequence. Below is an example of a number field using the defined number sequence configured in the setup table above (Assumes "MyNumberingID" exists in DAC/Table "MySetup").
// Field using the numbering sequence...
public abstract class myNumberField : PX.Data.IBqlField
{
}
protected String _MyNumberField;
[PXDBString(15, IsUnicode = true, IsKey = true, InputMask = ">CCCCCCCCCCCCCCC")]
[PXUIField(DisplayName = "My Number", Visibility = PXUIVisibility.SelectorVisible)]
[AutoNumber(typeof (MySetup.myNumberingID), typeof (AccessInfo.businessDate))]
[PXDefault]
public virtual String MyNumberField
{
get
{
return this._MyNumberField;
}
set
{
this._MyNumberField = value;
}
}
Edit: Make sure in the graph building the documents to include a PXSetup view to the setup table.
Now when you insert and persist a new record on the DAC that contains your number field, the next numbering sequence value will be used (unless the numbering sequence is configured for manual numbering then the user must provide a value).
For a more complex configuration when there are multiple numbering sequences used based on specific conditions/field values, you can look at PX.Objects.IN.INRegister.RefNbr for an example. Look at INDocType.Numbering and how it changes the numbering sequence based on INRegister.docType (shown below). Another example would be sales order order types related to the sales order document.
public class NumberingAttribute : AutoNumberAttribute
{
public NumberingAttribute()
: base(typeof(INRegister.docType), typeof(INRegister.tranDate),
new string[] { Issue, Receipt, Transfer, Adjustment, Production, Change, Disassembly },
new Type[] { typeof(INSetup.issueNumberingID), typeof(INSetup.receiptNumberingID), typeof(INSetup.receiptNumberingID), typeof(INSetup.adjustmentNumberingID), typeof(INSetup.kitAssemblyNumberingID), typeof(INSetup.kitAssemblyNumberingID), typeof(INSetup.kitAssemblyNumberingID) }) { ; }
}
In Cash Sales (AR304000 screen) i want to set it's auto numbering sequence from invoice number sequence to payment number sequence.
i tried the following code but to no avail. saving new sales throws an error. see attached photo for the error.
here is my DAC code:
public class ARCashSaleExtension : PXCacheExtension<ARCashSale>
{
#region RefNumber
[PXDBString(15, IsKey = true, InputMask = ">CCCCCCCCCCCCCCC", IsUnicode = true, BqlField = typeof(**PX.Objects.AR.ARPayment.refNbr**))]
[PXDefault()]
[PXUIField(DisplayName = "Reference Nbr.", Visibility = PXUIVisibility.SelectorVisible)]
[ARPaymentType.RefNbr(typeof(Search2<ARCashSale.refNbr,
InnerJoinSingleTable<Customer, On<ARCashSale.customerID, Equal<Customer.bAccountID>>>,
Where<ARCashSale.docType, Equal<Current<ARCashSale.docType>>,
And2<Where<ARCashSale.origModule, NotEqual<BatchModule.moduleSO>, Or<ARCashSale.released, Equal<boolTrue>>>,
And<Match<Customer, Current<AccessInfo.userName>>>>>, OrderBy<Desc<ARCashSale.refNbr>>>), Filterable = true)]
[**ARPaymentType.Numbering()**]
[PXFieldDescription]
public String RefNbr
{
get;
set;
}
#endregion
}
I think you should use AutoNumberAttribute instead of ARPaymentType.Numbering attribute.
[AutoNumber(typeof(ARCashSale.docType), typeof(ARCashSale.docDate),
new string[] { CashSale, CashReturn },
new Type[] { typeof(ARSetup.paymentNumberingID), typeof(ARSetup.paymentNumberingID) })]
Besides, I can't see any reasons to use ARPaymentType.RefNbr attribute instead of ARCashSaleType.RefNbr attribute.
One more thing: from my point, it's better to use Cache_Attached on graph extension for rewriting attributes on one field instead of creating DAC extension.
Here is an example of Graph extension with CacheAttached:
public partial class ARCashSaleEntryExt : PXGraphExtension<ARCashSaleEntry>
{
[PXMergeAttributes(Method = MergeMethod.Merge)] // that attribute is here to keep all attributes of base field except the one that should be replaced.
[AutoNumber(typeof(ARCashSale.docType), typeof(ARCashSale.docDate),
new string[] { ARDocType.CashSale, ARDocType.CashReturn },
new Type[] { typeof(ARSetup.paymentNumberingID), typeof(ARSetup.paymentNumberingID) })]
public virtual void ARCashSale_RefNbr_CacheAttached(PXCache sender)
{
}
}
To learn more about cache_attached events see T200 training