Question

Reg : Vendor Data Always loading Employees

  • 26 March 2023
  • 7 replies
  • 99 views

Dear Team,

We are using vendor Attributes and Selectors as below but it is always showing Employee details. It happening only happening in particular customization form other forms all okie. 

Here is my code.

 [PXSelector(
typeof(Search<Vendor.bAccountID>),
typeof(Vendor.acctCD),
typeof(Vendor.acctName), SubstituteKey = typeof(Vendor.acctCD),
DescriptionField = typeof(Vendor.acctName),
SelectorMode = PXSelectorMode.DisplayModeText)]


[VendorActive(DisplayName = "Account ID", Required = true)]


[VendorNonEmployeeActive(DisplayName = "Account ID", Required = true)]

I tried all the 3 options above but i am always getting as below

 

Work Fine below as in other places

 

Regards,

Sakthi


7 replies

Userlevel 7
Badge +17

@sakthi61 If you wanted to load only VENDORS in the Selector field, you can use  VendorActive attribute.

Below is the example for your reference.

 

 #region UsrVendorID 

[VendorActive(typeof(Search<BAccountR.bAccountID,
Where<Vendor.type, NotEqual<BAccountType.employeeType>>>))]
[PXUIField(DisplayName = "Vendor ID")]
public virtual int? UsrVendorID { get; set; }
public abstract class usrVendorID : PX.Data.BQL.BqlInt.Field<usrVendorID> { }

#endregion

 

Hope this helps!!

Hi Naveen,

 

I try use the above code still having problem. It filter all the employee and showing empty data looks not getting vendor inside.

 

 

Here i have shared my DAC Code

 

using System;
using PX.Data;
using PX.Data.BQL;
using PX.Data.EP;
using PX.Data.ReferentialIntegrity.Attributes;
using PX.Objects.AP;
using PX.Objects.CA;
using PX.Objects.CM;
using PX.Objects.CR;
using PX.Objects.CS;
using PX.Objects.EP;
using PX.Objects.GL;
using PX.Objects.PM;
using PX.TM;
using TradeFacilities.FD.DAC;
//using TradeFacilities.FD.DAC;

namespace YTLDBFCustomization
{
[Serializable]
[PXCacheName("CRTDBFApplication")]
[PXPrimaryGraph(typeof(DigitalBankFacilitiesMaint))]
[PXEMailSource]
public class CRTDBFApplication : IBqlTable, IAssign
{
#region Dbfrefnbr
[PXDBString(50, InputMask = "", IsKey = true, IsUnicode = true)]
[PXCheckUnique]
[PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
[AutoNumber(typeof(CASetupExt.usrDBFNumberingSequence), typeof(AccessInfo.businessDate))]
[PXUIField(DisplayName = "DBF Ref No", Required = true, Visibility = PXUIVisibility.SelectorVisible)]
[PXSelector(typeof(Search3<dbfrefnbr, OrderBy<Desc<dbfrefnbr>>>), typeof(dbfrefnbr), typeof(description), SubstituteKey = typeof(dbfrefnbr), Filterable = true)]
public virtual string Dbfrefnbr { get; set; }
public abstract class dbfrefnbr : PX.Data.BQL.BqlString.Field<dbfrefnbr> { }
#endregion



#region Dbfrefnbr
[PXDBString(50, InputMask = "", IsUnicode = true)]
[PXUIField(DisplayName = "AP Bill No")]
public virtual string APBillNo { get; set; }
public abstract class apBillNo : PX.Data.BQL.BqlString.Field<apBillNo> { }
#endregion

#region Type
[PXDBString(20, IsUnicode = true)]
[PXDefault(DBFType.BankDraft)]
[PXUIField(DisplayName = "Type")]
[PXStringList(
new string[]
{
DBFType.BankDraft,
DBFType.Cheque,
DBFType.Cash,
DBFType.BankGuarantee,
DBFType.EPayment,
DBFType.Others
},
new string[]
{
"BankDraft",
"Cheque",
"Cash",
"BankGuarantee",
"EPayment",
"Others"
})]
public virtual string Type { get; set; }
public abstract class type : PX.Data.BQL.BqlString.Field<type> { }
#endregion

#region Status
[PXDBString(20, IsUnicode = true, InputMask = "")]
[PXDefault(StatusType.OnHold)]
[PXUIField(DisplayName = "Status")]
[PXStringList(
new string[]
{
StatusType.OnHold,
StatusType.New,
StatusType.PendingVerification,
StatusType.PendingApproval,
StatusType.AccountProcessing,
StatusType.Readytocollect,
StatusType.CollectedbyApplicant,
StatusType.Terminated,
StatusType.Expired,
StatusType.Claimable,
StatusType.Cancelled,
StatusType.Refunded,
StatusType.Approved,
StatusType.Rejected,
},
new string[]
{
"OnHold",
"New",
"PendingVerification",
"PendingApproval",
"AccountProcessing",
"Readytocollect",
"CollectedbyApplicant",
"Terminated",
"Expired",
"Claimable",
"Cancelled",
"Refunded",
"Approved",
"Rejected"
})]
public virtual string Status { get; set; }
public abstract class status : PX.Data.BQL.BqlString.Field<status> { }
#endregion

#region ApplicationDate
[PXDBDate()]
[PXUIField(DisplayName = "Date")]
public virtual DateTime? ApplicationDate { get; set; }
public abstract class applicationDate : PX.Data.BQL.BqlDateTime.Field<applicationDate> { }
#endregion

#region Description
[PXDBString(500, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Description")]
public virtual string Description { get; set; }
public abstract class description : PX.Data.BQL.BqlString.Field<description> { }
#endregion

#region ApplicationInfo
[PXDBString(500, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Company", Enabled = false)]
[PXDefault(typeof(AccessInfo.companyName))]
public virtual string ApplicationInfo { get; set; }
public abstract class applicationInfo : PX.Data.BQL.BqlString.Field<applicationInfo> { }
#endregion

#region CashAccount
[PXDBString(32)]
[PXUIField(DisplayName = "Cash Account", Visibility = PXUIVisibility.SelectorVisible)]
[PXSelector(typeof(Search<PX.Objects.CA.CashAccount.cashAccountCD>))]
public virtual string CashAccount { get; set; }
public abstract class cashAccount : PX.Data.BQL.BqlString.Field<cashAccount> { }
#endregion

#region CashAccountExtRefNo
[PXDBString(50)]
[PXUIField(DisplayName = "Cash Account - Ext.Ref.No", Visibility = PXUIVisibility.SelectorVisible)]
public virtual string CashAccountExtRefNo { get; set; }
public abstract class cashAccountExtRefNo : PX.Data.BQL.BqlString.Field<cashAccountExtRefNo> { }
#endregion

#region GauranteeDraft
[PXDBString(255, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Gaurantee Draft")]
public virtual string GauranteeDraft { get; set; }
public abstract class gauranteeDraft : PX.Data.BQL.BqlString.Field<gauranteeDraft> { }
#endregion

#region CreatedBy
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Created By")]
public virtual string CreatedBy { get; set; }
public abstract class createdBy : PX.Data.BQL.BqlString.Field<createdBy> { }
#endregion

#region Date
[PXDBDate()]
[PXUIField(DisplayName = "Date", Required = true)]
[PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
public virtual DateTime? Date { get; set; }
public abstract class date : PX.Data.BQL.BqlDateTime.Field<date> { }
#endregion


#region CuryID

public abstract class curyID : PX.Data.BQL.BqlString.Field<curyID> { }
protected String _CuryID;
[PXDBString(5, IsUnicode = true, InputMask = ">LLLLL")]
[PXUIField(DisplayName = "Currency", Visibility = PXUIVisibility.SelectorVisible)]
[PXDefault(typeof(AccessInfo.baseCuryID))]
[PXSelector(typeof(Currency.curyID))]
public virtual String CuryID
{
get
{
return this._CuryID;
}
set
{
this._CuryID = value;
}
}
#endregion
#region CuryInfoID
public abstract class curyInfoID : PX.Data.BQL.BqlLong.Field<curyInfoID> { }

/// <summary>
/// The identifier of the exchange rate record for the deposit.
/// </summary>
/// <value>
/// Corresponds to the <see cref="CurrencyInfo.CuryInfoID"/> field.
/// </value>
[PXDBLong()]
[CurrencyInfo()]
public virtual long? CuryInfoID
{
get;
set;
}
#endregion

#region Amount
[PXDBDecimal()]
[PXUIField(DisplayName = "Bank Facilities Amount")]
public virtual Decimal? Amount { get; set; }
public abstract class amount : PX.Data.BQL.BqlDecimal.Field<amount> { }
#endregion

#region TenorFrom
[PXDBDate()]
[PXUIField(DisplayName = "Tenor From", Required = true)]
[PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
public virtual DateTime? TenorFrom { get; set; }
public abstract class tenorFrom : PX.Data.BQL.BqlDateTime.Field<tenorFrom> { }
#endregion

#region TenorTo
[PXDBDate()]
[PXUIField(DisplayName = "Tenor To")]
[PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
public virtual DateTime? TenorTo { get; set; }
public abstract class tenorTo : PX.Data.BQL.BqlDateTime.Field<tenorTo> { }
#endregion

#region TotalTenor
[PXDBInt()]
[PXUIField(DisplayName = "Total Tenor(Days)")]
public virtual int? TotalTenor { get; set; }
public abstract class totalTenor : PX.Data.BQL.BqlInt.Field<totalTenor> { }
#endregion

#region IsRefundable
[PXDBBool()]
[PXUIField(DisplayName = "Refundable")]
public virtual bool? IsRefundable { get; set; }
public abstract class isRefundable : PX.Data.BQL.BqlBool.Field<isRefundable> { }
#endregion

#region Remarks
[PXDBString(500, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Refund Remarks")]
public virtual string RefundRemarks { get; set; }
public abstract class refundRemarks : PX.Data.BQL.BqlString.Field<refundRemarks> { }
#endregion

#region Refund Amount
[PXDBDecimal()]
[PXUIField(DisplayName = "Refund Amount")]
public virtual Decimal? RefundAmount { get; set; }
public abstract class refundAmount : PX.Data.BQL.BqlDecimal.Field<refundAmount> { }
#endregion

#region RefundDate
[PXDBDate()]
[PXUIField(DisplayName = "Refund Date")]
public virtual DateTime? RefundDate { get; set; }
public abstract class refundDate : PX.Data.BQL.BqlDateTime.Field<refundDate> { }
#endregion

#region Remarks
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Confirm Received By Accounts")]
public virtual string ConfirmReceivedByAccounts { get; set; }
public abstract class confirmReceivedByAccounts : PX.Data.BQL.BqlString.Field<confirmReceivedByAccounts> { }
#endregion

#region ConfirmReceivedDate
[PXDBDate()]
[PXUIField(DisplayName = "Confirm Received Date")]
public virtual DateTime? ConfirmReceivedDate { get; set; }
public abstract class confirmReceivedDate : PX.Data.BQL.BqlDateTime.Field<confirmReceivedDate> { }
#endregion


#region
[PXDBBool()]
[PXUIField(DisplayName = "Amendment", Enabled = false)]
public virtual bool? IsAmendment { get; set; }
public abstract class isAmendment : PX.Data.BQL.BqlBool.Field<isAmendment> { }
#endregion

#region
[PXDBBool()]
[PXUIField(DisplayName = "Renewal", Enabled = false)]
public virtual bool? IsRenewal { get; set; }
public abstract class isRenewal : PX.Data.BQL.BqlBool.Field<isRenewal> { }
#endregion

#region AmendmentIndex
[PXDBInt]
[PXUIField(DisplayName = "Amendment Count", Enabled = false)]

public virtual int? AmendmentIndex { get; set; }
public abstract class amendmentIndex : PX.Data.BQL.BqlInt.Field<amendmentIndex> { }
#endregion

#region AmendmentNo
[PXDBString(50)]
[PXUIField(DisplayName = "AmendmentNo", Enabled = false)]

public virtual string AmendmentNo { get; set; }
public abstract class amendmentNo : PX.Data.BQL.BqlString.Field<amendmentNo> { }
#endregion

#region ProgramEndDate
[PXDBDate()]
[PXUIField(DisplayName = "Project Master Program End Date", Required = true)]
[PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
public virtual DateTime? ProgramEndDate { get; set; }
public abstract class programEndDate : PX.Data.BQL.BqlDateTime.Field<programEndDate> { }
#endregion

#region ClaimPeriod
[PXDBInt()]
[PXUIField(DisplayName = "Claim Period")]
public virtual int? ClaimPeriod { get; set; }
public abstract class claimPeriod : PX.Data.BQL.BqlInt.Field<claimPeriod> { }
#endregion

#region ClaimDate
[PXDBDate()]
[PXUIField(DisplayName = "Claim Date")]
public virtual DateTime? ClaimDate { get; set; }
public abstract class claimDate : PX.Data.BQL.BqlDateTime.Field<claimDate> { }
#endregion

#region AccountID

public abstract class glaccountID : PX.Data.BQL.BqlInt.Field<glaccountID> { }

[PXDefault(1149, PersistingCheck = PXPersistingCheck.NullOrBlank)]
[Account(Visibility = PXUIVisibility.SelectorVisible, AvoidControlAccounts = true, DisplayName = "GL Account")]
public virtual int? GLAccountID
{
get;
set;
}
#endregion


#region SubID
[PXDBInt()]
[PXUIField(DisplayName = "Sub Account")]
public abstract class subID : PX.Data.BQL.BqlInt.Field<subID> { }
public virtual int? SubID
{
get;
set;
}
#endregion

#region AccountID
[PXDBInt()]
[PXUIField(DisplayName = "Account ID")]
[PXSelector(
typeof(Search<Vendor.bAccountID>),
typeof(Vendor.acctCD),
typeof(Vendor.acctName), SubstituteKey = typeof(Vendor.acctCD),
DescriptionField = typeof(Vendor.acctName),
SelectorMode = PXSelectorMode.DisplayModeText)]
//[VendorActive(DisplayName = "Account ID", Required = true)]
// [VendorNonEmployeeActive(DisplayName = "Account ID", Required = true)]
[RestrictVendorByBranch(typeof(AccessInfo.branchID))]
[PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
public virtual int? AccountID { get; set; }
public abstract class accountID : PX.Data.BQL.BqlInt.Field<accountID> { }
#endregion


#region Account
[PXInt()]
[PXUIField(DisplayName = "Account")]
[PXSelector(
typeof(Search<Vendor.bAccountID>),
typeof(Vendor.acctCD),
typeof(Vendor.acctName), SubstituteKey = typeof(Vendor.acctCD),
DescriptionField = typeof(Vendor.acctName),
SelectorMode = PXSelectorMode.DisplayModeText)]
//[VendorActive(DisplayName = "Account ID", Required = true)]
// [VendorNonEmployeeActive(DisplayName = "Account ID", Required = true)]

public virtual int? Account { get; set; }
public abstract class account : PX.Data.BQL.BqlInt.Field<account> { }
#endregion



#region VendorID
[VendorActive(typeof(Search<BAccountR.bAccountID,
Where<Vendor.type, NotEqual<BAccountType.employeeType>>>))]
[PXUIField(DisplayName = "Vendor ID")]
[PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
public virtual int? VendorID { get; set; }
public abstract class vendorID : PX.Data.BQL.BqlInt.Field<vendorID> { }
#endregion

#region UsrVendorName
[VendorRaw(DisplayName = "Account ID", Required = true)]
[PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
public virtual string UsrVendorName { get; set; }
public abstract class usrVendorName : PX.Data.BQL.BqlString.Field<usrVendorName> { }
#endregion

#region AccountName
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Account Name", Enabled = false)]
public virtual string AccountName { get; set; }
public abstract class accountName : PX.Data.BQL.BqlString.Field<accountName> { }
#endregion

#region Attention
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Attention", Enabled = false)]
public virtual string Attention { get; set; }
public abstract class attention : PX.Data.BQL.BqlString.Field<attention> { }
#endregion

#region Phone1
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Phone1", Enabled = false)]
public virtual string Phone1 { get; set; }
public abstract class phone1 : PX.Data.BQL.BqlString.Field<phone1> { }
#endregion

#region Email
[PXDBString(200, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Email", Enabled = false)]
public virtual string Email { get; set; }
public abstract class email : PX.Data.BQL.BqlString.Field<email> { }
#endregion

#region BeneficiaryAddress
[PXDBString(500, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Beneficiary Address")]
public virtual string BeneficiaryAddress { get; set; }
public abstract class beneficiaryAddress : PX.Data.BQL.BqlString.Field<beneficiaryAddress> { }
#endregion

#region ProjectCodeID
[Project(DisplayName = "Project Code", Required = true)]
[PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
public virtual int? ProjectCodeID { get; set; }
public abstract class projectCodeID : PX.Data.BQL.BqlInt.Field<projectCodeID> { }
#endregion

#region PurposeCode
[PXDBString(50)]
[PXUIField(DisplayName = "Purpose")]
[PXSelector(
typeof(Search<DBFPurpose.code>),
typeof(DBFPurpose.code),
typeof(DBFPurpose.description), SubstituteKey = typeof(DBFPurpose.code),
DescriptionField = typeof(DBFPurpose.description),
SelectorMode = PXSelectorMode.DisplayModeText)]
public virtual String PurposeCode { get; set; }
public abstract class purposeCode : PX.Data.BQL.BqlString.Field<purposeCode> { }
#endregion

#region Remarks
[PXDBString(500, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Applicant's Remark (If Any)")]
public virtual string Remarks { get; set; }
public abstract class remarks : PX.Data.BQL.BqlString.Field<remarks> { }
#endregion

#region ConsultantID
[VendorNonEmployeeActive(DisplayName = "Consultant")]
public virtual int? ConsultantID { get; set; }
public abstract class consultantID : PX.Data.BQL.BqlInt.Field<consultantID> { }
#endregion

#region ApplicationID

[PXDBInt]
[PXUIField(DisplayName = "Applicant Name")]
[PXDefault(typeof(Search<EPEmployee.bAccountID, Where<EPEmployee.userID, Equal<Current<AccessInfo.userID>>>>))]
[PXEPEPEmployeeSelector]
public virtual int? ApplicationID { get; set; }
public abstract class applicationID : PX.Data.BQL.BqlInt.Field<applicationID> { }
#endregion

#region ApplicationID

[PXDBInt]
[PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
[PXUIField(DisplayName = "Reporting HOD")]
public virtual int? ReportingHOD { get; set; }
public abstract class reportingHOD : PX.Data.BQL.BqlInt.Field<reportingHOD> { }
#endregion


#region PromisedDate
[PXDBDate()]
[PXUIField(DisplayName = "Promised Date")]
public virtual DateTime? PromisedDate { get; set; }
public abstract class promisedDate : PX.Data.BQL.BqlDateTime.Field<promisedDate> { }
#endregion

#region ReceiptAddressTo
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Receipt Address To")]
public virtual string ReceiptAddressTo { get; set; }
public abstract class receiptAddressTo : PX.Data.BQL.BqlString.Field<receiptAddressTo> { }
#endregion

#region AddressOverride
[PXDBBool()]
[PXUIField(DisplayName = "Override")]
public virtual bool? AddressOverride { get; set; }
public abstract class addressOverride : PX.Data.BQL.BqlBool.Field<addressOverride> { }
#endregion

#region AddressLine1
[PXDBString(100, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Address Line 1")]
public virtual string AddressLine1 { get; set; }
public abstract class addressLine1 : PX.Data.BQL.BqlString.Field<addressLine1> { }
#endregion

#region AddressLine2
[PXDBString(100, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Address Line 2")]
public virtual string AddressLine2 { get; set; }
public abstract class addressLine2 : PX.Data.BQL.BqlString.Field<addressLine2> { }
#endregion

#region City
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "City")]
public virtual string City { get; set; }
public abstract class city : PX.Data.BQL.BqlString.Field<city> { }
#endregion

#region Country
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Country")]
public virtual string Country { get; set; }
public abstract class country : PX.Data.BQL.BqlString.Field<country> { }
#endregion

#region State
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "State")]
public virtual string State { get; set; }
public abstract class state : PX.Data.BQL.BqlString.Field<state> { }
#endregion

#region PostalCode
[PXDBString(10, IsFixed = true, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Postal Code")]
public virtual string PostalCode { get; set; }
public abstract class postalCode : PX.Data.BQL.BqlString.Field<postalCode> { }
#endregion

#region ChecklistNo
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Authority Checklist No")]
public virtual string ChecklistNo { get; set; }
public abstract class checklistNo : PX.Data.BQL.BqlString.Field<checklistNo> { }
#endregion

#region TradeFacilitiesNo
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Trade Facilities No")]
[PXSelector(typeof(Search<FDDrawdown.refNbr>))]
public virtual string TradeFacilitiesNo { get; set; }
public abstract class tradeFacilitiesNo : PX.Data.BQL.BqlString.Field<tradeFacilitiesNo> { }
#endregion

#region Bank
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Bank")]
public virtual string Bank { get; set; }
public abstract class bank : PX.Data.BQL.BqlString.Field<bank> { }
#endregion

#region BankAddress
[PXDBString(200, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Bank Address")]
public virtual string BankAddress { get; set; }
public abstract class bankAddress : PX.Data.BQL.BqlString.Field<bankAddress> { }
#endregion

#region AccountNo
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Account No")]
public virtual string AccountNo { get; set; }
public abstract class accountNo : PX.Data.BQL.BqlString.Field<accountNo> { }
#endregion

#region DateReceived
[PXDBDate()]
[PXUIField(DisplayName = "Date Received")]
public virtual DateTime? DateReceived { get; set; }
public abstract class dateReceived : PX.Data.BQL.BqlDateTime.Field<dateReceived> { }
#endregion

#region DateCollected
[PXDBDate()]
[PXUIField(DisplayName = "Date Collected")]
public virtual DateTime? DateCollected { get; set; }
public abstract class dateCollected : PX.Data.BQL.BqlDateTime.Field<dateCollected> { }
#endregion

#region DBFExternalNo
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "DBF External No")]
public virtual string DBFExternalNo { get; set; }
public abstract class dBFExternalNo : PX.Data.BQL.BqlString.Field<dBFExternalNo> { }
#endregion

#region InterestRate
[PXDBDecimal()]
[PXUIField(DisplayName = "Int. Rate %")]
public virtual Decimal? InterestRate { get; set; }
public abstract class interestRate : PX.Data.BQL.BqlDecimal.Field<interestRate> { }
#endregion

#region MinRate
[PXDBDecimal()]
[PXUIField(DisplayName = "Min. Rate", Enabled = false)]
public virtual Decimal? MinRate { get; set; }
public abstract class minRate : PX.Data.BQL.BqlDecimal.Field<minRate> { }
#endregion

#region FinanceOverride
[PXDBBool()]
[PXUIField(DisplayName = "Override")]
public virtual bool? FinanceOverride { get; set; }
public abstract class financeOverride : PX.Data.BQL.BqlBool.Field<financeOverride> { }
#endregion

#region StampDuty
[PXDBDecimal()]
[PXUIField(DisplayName = "Stamp Duty")]
[PXDefault(TypeCode.Decimal, "10.0")]
public virtual Decimal? StampDuty { get; set; }
public abstract class stampDuty : PX.Data.BQL.BqlDecimal.Field<stampDuty> { }
#endregion

#region Postage
[PXDBDecimal()]
[PXUIField(DisplayName = "Postage")]
[PXDefault(TypeCode.Decimal, "5.0")]
public virtual Decimal? Postage { get; set; }
public abstract class postage : PX.Data.BQL.BqlDecimal.Field<postage> { }
#endregion

#region BankCommission
[PXDBDecimal()]
[PXUIField(DisplayName = "Bank Commission", Enabled = false)]
public virtual Decimal? BankCommission { get; set; }
public abstract class bankCommission : PX.Data.BQL.BqlDecimal.Field<bankCommission> { }
#endregion

#region TotalBGChargeable
[PXDBDecimal()]
[PXUIField(DisplayName = "Total BG Chargeable", Enabled = false)]
public virtual Decimal? TotalBGChargeable { get; set; }
public abstract class totalBGChargeable : PX.Data.BQL.BqlDecimal.Field<totalBGChargeable> { }
#endregion

#region BGImage
[PXDBString(255, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Upload BG")]
public virtual string BGImage { get; set; }
public abstract class bGImage : PX.Data.BQL.BqlString.Field<bGImage> { }
#endregion

#region SupportDocument
[PXDBString(255, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Upload Supporting Documents")]
public virtual string SupportDocument { get; set; }
public abstract class supportDocument : PX.Data.BQL.BqlString.Field<supportDocument> { }
#endregion

#region UploadReceipt
[PXDBString(255, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Upload Receipt")]
public virtual string UploadReceipt { get; set; }
public abstract class uploadReceipt : PX.Data.BQL.BqlString.Field<uploadReceipt> { }
#endregion

#region PreContruction
[PXDBString(255, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Pre Construction")]
public virtual string PreConstruction { get; set; }
public abstract class preConstruction : PX.Data.BQL.BqlString.Field<preConstruction> { }
#endregion

#region PreContruction
[PXDBString(255, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Post Construction")]
public virtual string PostConstruction { get; set; }
public abstract class postConstruction : PX.Data.BQL.BqlString.Field<postConstruction> { }
#endregion

#region IsPreConstruction
[PXDBBool()]
[PXUIField(DisplayName = "IsPreConstruction")]
public virtual bool? IsPreConstruction { get; set; }
public abstract class isPreConstruction : PX.Data.BQL.BqlBool.Field<isPreConstruction> { }
#endregion

#region IsPostConstruction
[PXDBBool()]
[PXUIField(DisplayName = "IsPostConstruction")]
public virtual bool? IsPostConstruction { get; set; }
public abstract class isPostConstruction : PX.Data.BQL.BqlBool.Field<isPostConstruction> { }
#endregion



#region CreatedDateTime
[PXDBCreatedDateTime()]
public virtual DateTime? CreatedDateTime { get; set; }
public abstract class createdDateTime : PX.Data.BQL.BqlDateTime.Field<createdDateTime> { }
#endregion

#region CreatedByID
[PXDBCreatedByID()]
public virtual Guid? CreatedByID { get; set; }
public abstract class createdByID : PX.Data.BQL.BqlGuid.Field<createdByID> { }
#endregion

#region CreatedByScreenID
[PXDBCreatedByScreenID()]
public virtual string CreatedByScreenID { get; set; }
public abstract class createdByScreenID : PX.Data.BQL.BqlString.Field<createdByScreenID> { }
#endregion

#region LastModifiedDateTime
[PXDBLastModifiedDateTime()]
public virtual DateTime? LastModifiedDateTime { get; set; }
public abstract class lastModifiedDateTime : PX.Data.BQL.BqlDateTime.Field<lastModifiedDateTime> { }
#endregion

#region LastModifiedByID
[PXDBLastModifiedByID()]
public virtual Guid? LastModifiedByID { get; set; }
public abstract class lastModifiedByID : PX.Data.BQL.BqlGuid.Field<lastModifiedByID> { }
#endregion

#region LastModifiedByScreenID
[PXDBLastModifiedByScreenID()]
public virtual string LastModifiedByScreenID { get; set; }
public abstract class lastModifiedByScreenID : PX.Data.BQL.BqlString.Field<lastModifiedByScreenID> { }
#endregion

#region Tstamp
[PXDBTimestamp()]
public virtual byte[] Tstamp { get; set; }
public abstract class tstamp : PX.Data.BQL.BqlByteArray.Field<tstamp> { }
#endregion

#region Noteid
[PXNote]
public virtual Guid? Noteid { get; set; }
public abstract class noteid : PX.Data.BQL.BqlGuid.Field<noteid> { }
#endregion

#region Hold
public abstract class hold : PX.Data.BQL.BqlBool.Field<hold> { }
protected Boolean? _Hold;
[PXDBBool]
[PXUIField(DisplayName = "Hold", Visibility = PXUIVisibility.Visible)]
[PXDefault(true, PersistingCheck = PXPersistingCheck.Nothing)]
public virtual Boolean? Hold
{
get
{
return this._Hold;
}
set
{
this._Hold = value;
}
}
#endregion

#region Approved
public abstract class approved : PX.Data.BQL.BqlBool.Field<approved> { }
protected Boolean? _Approved;
[PXDBBool()]
[PXDefault(false, PersistingCheck = PXPersistingCheck.Nothing)]
[PXUIField(DisplayName = "Approved", Visibility = PXUIVisibility.Visible, Enabled = false)]
public virtual Boolean? Approved
{
get
{
return this._Approved;
}
set
{
this._Approved = value;
}
}
#endregion

#region Rejected
public abstract class rejected : PX.Data.BQL.BqlBool.Field<rejected> { }
protected bool? _Rejected = false;
[PXBool]
[PXDefault(false, PersistingCheck = PXPersistingCheck.Nothing)]
[PXUIField(DisplayName = "Reject", Visibility = PXUIVisibility.Visible)]
public bool? Rejected
{
get
{
return _Rejected;
}
set
{
_Rejected = value;
}
}
#endregion
#region WorkgroupID
public abstract class workgroupID : PX.Data.BQL.BqlInt.Field<workgroupID> { }
protected int? _WorkgroupID;
[PXDBInt]
[PXDefault(typeof(workgroupID), PersistingCheck = PXPersistingCheck.Nothing)]
[PXCompanyTreeSelector]
public virtual int? WorkgroupID
{
get
{
return this._WorkgroupID;
}
set
{
this._WorkgroupID = value;
}
}
#endregion

#region OwnerID
public abstract class ownerID : PX.Data.BQL.BqlInt.Field<ownerID> { }
protected int? _OwnerID;
[PXDefault(typeof(ownerID), PersistingCheck = PXPersistingCheck.Nothing)]
[Owner(IsDBField = false, DisplayName = "Approver", Enabled = false)]
public virtual int? OwnerID
{
get
{
return this._OwnerID;
}
set
{
this._OwnerID = value;
}
}
#endregion

#region ApprovalWorkgroupID
public abstract class approvalWorkgroupID : PX.Data.BQL.BqlInt.Field<approvalWorkgroupID> { }
protected int? _ApprovalWorkgroupID;
[PXInt]
[PXSelector(typeof(Search<EPCompanyTree.workGroupID>), SubstituteKey = typeof(EPCompanyTree.description))]
[PXUIField(DisplayName = "Approval Workgroup ID", Enabled = false)]
public virtual int? ApprovalWorkgroupID
{
get
{
return this._ApprovalWorkgroupID;
}
set
{
this._ApprovalWorkgroupID = value;
}
}
#endregion

#region ApprovalOwnerID
public abstract class approvalOwnerID : PX.Data.BQL.BqlGuid.Field<approvalOwnerID> { }
protected int? _ApprovalOwnerID;
[PX.TM.Owner(IsDBField = false, DisplayName = "Approver", Enabled = false)]
public virtual int? ApprovalOwnerID
{
get
{
return this._ApprovalOwnerID;
}
set
{
this._ApprovalOwnerID = value;
}
}
#endregion


#region IsApprover
public abstract class isApprover : BqlDecimal.Field<isApprover>
{
}
[PXBool]
public virtual bool? IsApprover { get; set; }
#endregion

#region IAssign Members
int? PX.Data.EP.IAssign.WorkgroupID
{
get { return ApprovalWorkgroupID; }
set { ApprovalWorkgroupID = value; }
}

int? PX.Data.EP.IAssign.OwnerID
{
get { return ApprovalOwnerID; }
set { ApprovalOwnerID = value; }
}
#endregion
}
}

 

Regards,

Sakthi

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using PX.Data;
using PX.Objects.AP;
using PX.Objects.CA;
using PX.Objects.CR;
using PX.Objects.EP;
using YTLDBFCustomization.DAC;

namespace YTLDBFCustomization
{
    public class DigitBankFacilitiesMaint : PXGraph<DigitBankFacilitiesMaint, CRTDBFApplication>
    {

        [PXViewName("DBF")]
        public PXSelect<CRTDBFApplication> MasterView;
        public PXSelect<CRTDBFApplication, Where<CRTDBFApplication.dbfrefnbr, Equal<Current<CRTDBFApplication.dbfrefnbr>>>> Finance;
        [PXViewName("General")]
        public PXSelect<CRTDBFApplication, Where<CRTDBFApplication.dbfrefnbr, Equal<Current<CRTDBFApplication.dbfrefnbr>>>> General;
        public PXSelect<CRTDBFApplication, Where<CRTDBFApplication.dbfrefnbr, Equal<Current<CRTDBFApplication.dbfrefnbr>>>> Informations;
        //[PXFilterable]
        public PXSelect<CRTDBFApplication, Where<CRTDBFApplication.promisedDate, LessEqual<Current<AccessInfo.businessDate>>>> Details;
        public PXSelect<DBFDocument> Documents;
        [PXViewName("Employee")]
        public PXSetup<EPEmployee, Where<EPEmployee.bAccountID, Equal<Optional<CRTDBFApplication.applicationID>>>> employee;

        public virtual IEnumerable documents()
        {
            CRTDBFApplication filter = MasterView.Current;
            PXSelectBase<DBFDocument> cmd;
            cmd = new
              PXSelect<DBFDocument>(this);

            if (typeof(PXSelectBase<DBFDocument>).IsAssignableFrom(cmd.GetType()))
            {
                int startRow = PXView.StartRow;
                int totalRows = 0;
                foreach (var res in cmd.View.Select(null, null, PXView.Searches, PXView.SortColumns, PXView.Descendings, PXView.Filters, ref startRow, PXView.MaximumRows, ref totalRows).RowCast<DBFDocument>())
                {
                    if (!string.IsNullOrEmpty(res.Dbfrefnbr) && res.Dbfrefnbr == filter.Dbfrefnbr)
                    {
                        yield return res;
                    }
                }
                PXView.StartRow = 0;
            }
        }

        public virtual IEnumerable details()
        {
            CRTDBFApplication filter = MasterView.Current;
            PXSelectBase<CRTDBFApplication> cmd;
            cmd = new
              PXSelect<CRTDBFApplication>(this);

            if (typeof(PXSelectBase<CRTDBFApplication>).IsAssignableFrom(cmd.GetType()))
            {
                int startRow = PXView.StartRow;
                int totalRows = 0;
                foreach (var res in cmd.View.Select(null, null, PXView.Searches, PXView.SortColumns, PXView.Descendings, PXView.Filters, ref startRow, PXView.MaximumRows, ref totalRows).RowCast<CRTDBFApplication>())
                {
                    if (!string.IsNullOrEmpty(res.Dbfrefnbr) && res.Type == DBFType.BankGuarantee && res.Status == DBFApprovalStatus.Approved)
                    {
                        yield return res;
                    }
                }
                PXView.StartRow = 0;
            }
        }


        public PXSetup<CASetup> CashAccountSetup;

        public static bool IsActive() => true; // Insert your own logic here for when to enable

        #region Override GetEntityTypeScreens - Enable Approval Maps for New Screens
        public delegate IEnumerable<String> GetEntityTypeScreensDelegate();
        // [PXOverride]
        public IEnumerable<String> GetEntityTypeScreens(GetEntityTypeScreensDelegate baseMethod)
        {
            IEnumerable<string> entities = baseMethod();
            List<string> list = new List<string>();

            foreach (string s in entities)
            {
                list.Add(s);
            }
            list.Add("DB201004"); // The screen id for your custom screen to enable approvals
                                  // list.Add("ZZ302000"); // The screen id for your next custom screen to enable approvals
            return list;

        }


        #endregion

        public PXSetup<DBFSetup> Setup;
        public PXSetup<DBFApprovalSetup> SetupApproval;
        [PXViewName("Approval")]
        public EPApprovalAutomation<CRTDBFApplication, CRTDBFApplication.approved, CRTDBFApplication.rejected, CRTDBFApplication.hold, DBFApprovalSetup> Approval;

        protected void CRTDBFApplication_TenorTo_FieldUpdating(PXCache cache, PXFieldUpdatingEventArgs e, PXFieldUpdating InvokeBaseHandler)
        {
            if (InvokeBaseHandler != null)
                InvokeBaseHandler(cache, e);
            var row = (CRTDBFApplication)e.Row;
            if (e.NewValue != null)
            {
                row.TenorTo = (DateTime)e.NewValue;
                if (row.TenorFrom.Value != null && row.TenorTo.Value != null)
                {
                    if (row.TenorTo < row.TenorFrom)
                    {
                        cache.RaiseExceptionHandling<CRTDBFApplication.tenorFrom>(row, row.TenorFrom,
                      new PXSetPropertyException("Tenor from should be less than Tenor to.", PXErrorLevel.Error));
                        cache.RaiseExceptionHandling<CRTDBFApplication.tenorFrom>(row, row.TenorFrom,
                     new PXSetPropertyException("Tenor to should be greater than Tenor from.", PXErrorLevel.Error));
                    }
                    else
                    {
                        row.TotalTenor = (row.TenorTo.Value - row.TenorFrom.Value).Days;
                    }
                }
            }
        }

       

Userlevel 7
Badge +17

@sakthi61  The above DAC field is the working code.

Do you have active vendors in your instance?

Dear Team,

Please find active vendors in my instance.

 

Same instance other package vendor is loading fine

 

Regards,

Sakthi

Userlevel 7
Badge +17

@sakthi61  Possible to share the customization package here?

Userlevel 7
Badge

Hi @sakthi61 were you able to find a solution? Thank you!

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