Save Parent-Child - acumatica

I am creating a graph using Acumatica Framework and I am trying to save changes to the database but I am getting an error on Save.
I have a typical parent/child (i.e. master/detail) relationships and everything should be set correctly.
My child DAC has the PXDBDefault and the PXParent entries:
[PXDBInt()]
[PXDBDefault(typeof(DCRuleHeader.ruleHeaderID))]
[PXParent(typeof(Select<DCRuleHeader, Where<DCRuleHeader.ruleHeaderID, Equal<Current<DCRule.ruleHeaderID>>>>))]
public virtual int? RuleHeaderID
{
get
{
return this._RuleHeaderID;
}
set
{
this._RuleHeaderID = value;
}
}
In the header, the ID is an identity in the database and defined as a key in the DAC as follows:
[PXDBIdentity(IsKey = true)]
[PXUIField(Enabled = false)]
public virtual int? RuleHeaderID
{
get
{
return this._RuleHeaderID;
}
set
{
this._RuleHeaderID = value;
}
}
The View is also configured accordingly:
public class RulesMaint : PXGraph<RulesMaint, DCRuleHeader>
{
public PXSelect<DCRuleHeader> RuleHeader;
public PXSelect<DCRule, Where<DCRule.ruleHeaderID, Equal<Current<DCRuleHeader.ruleHeaderID>>>> Rules;
public PXAction<DCRuleHeader> ViewRule;
However, the below code is not working
RulesMaint rulesGraph = PXGraph.CreateInstance<RulesMaint>();
DCRuleHeader newHeader = rulesGraph.RuleHeader.Insert();
...
DCRule rule = rulesGraph.Rules.Insert();
...
rulesGraph.Actions.PressSave();
When I try the above, I get the error 'Error "RuleHeaderID" cannot be empty'
Shouldn't the framework handle everything itself and set the Parent ID of the child object automatically? Isn't that what PXDBDefault is for ?

Here is example how you can get Parent/Child DACs working with Form Detail view in Acumatica ERP.
For the begging let's create SQL Tables for Parent and Child in the following way:
Parent:
/****** Object: Table [dbo].[SOCustomParentTable] Script Date: 07/03/2017 12:55:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SOCustomParentTable](
[CompanyID] [int] NOT NULL,
[ParentID] [int] IDENTITY(1,1) NOT NULL,
[Description] [nvarchar](255) NULL,
[SomeOtherField] [nvarchar](50) NULL,
[ParentCD] [nvarchar](15) NOT NULL
) ON [PRIMARY]
GO
And the child
/****** Object: Table [dbo].[SOCustomChildTable] Script Date: 07/03/2017 12:54:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SOCustomChildTable](
[CompanyID] [int] NOT NULL,
[ChildID] [int] IDENTITY(1,1) NOT NULL,
[ParentID] [int] NOT NULL,
[Description] [nvarchar](255) NULL,
[SomeOtherField] [nvarchar](50) NULL
) ON [PRIMARY]
GO
Now as we have SQL Tables ready let's create DAC's as the following classes:
Parent :
using System;
using PX.Data;
namespace DemoParentChild
{
[Serializable]
public class SOCustomParentTable: IBqlTable
{
#region ParentID
[PXDBIdentity()]
public int? ParentID { get; set; }
public class parentID : IBqlField{}
#endregion
#region Description
[PXDBString(255, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Description")]
public string Description { get; set; }
public class description : IBqlField{}
#endregion
#region SomeOtherField
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Some Other Field")]
public string SomeOtherField { get; set; }
public class someOtherField : IBqlField{}
#endregion
#region ParentCD
[PXDBString(15,IsKey = true, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Parent ID")]
public string ParentCD { get; set; }
public class parentCD : IBqlField{}
#endregion
}
}
And the child:
using System;
using PX.Data;
namespace DemoParentChild
{
[Serializable]
public class SOCustomChildTable: IBqlTable
{
#region ChildID
[PXDBIdentity(IsKey=true)]
public int? ChildID { get; set; }
public class childID : IBqlField{}
#endregion
#region ParentID
[PXDBInt()]
[PXDBDefault(typeof(SOCustomParentTable.parentID))]
[PXParent(typeof(Select<SOCustomParentTable, Where<SOCustomParentTable.parentID, Equal<Current<SOCustomChildTable.parentID>>>>))]
public int? ParentID { get; set; }
public class parentID : IBqlField{}
#endregion
#region Description
[PXDBString(255, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Description")]
public string Description { get; set; }
public class description : IBqlField{}
#endregion
#region SomeOtherField
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Some Other Field")]
public string SomeOtherField { get; set; }
public class someOtherField : IBqlField{}
#endregion
}
}
And to finish our work let's create a page of FormDetail type with the following Graph:
using System;
using PX.Data;
namespace DemoParentChild
{
public class tmp : PXGraph<tmp>
{
public PXSave<SOCustomParentTable> Save;
public PXCancel<SOCustomParentTable> Cancel;
public PXPrevious<SOCustomParentTable> Prev;
public PXNext<SOCustomParentTable> Next;
public PXSelect<SOCustomParentTable> MasterView;
public PXSelect<SOCustomChildTable,Where<SOCustomChildTable.parentID,Equal<Current<SOCustomParentTable.parentID>>>> DetailsView;
}
}
Now let's understand how this all is working.
As you can see the ParentID is Identity in SQL and is set to PXDBIdentity in DAC, but it's not set to be a Key for our DAC as we will use ParentCD as visible Key.
Also in the Child class the ChildID is set to PXDBIdentity, but it is set to be Key also as we don't need the line to have visible key for user.
Also in the Child class we have the following for creation of the Parent/Child relation:
[PXDBInt()]
[PXDBDefault(typeof(SOCustomParentTable.parentID))]
[PXParent(typeof(Select<SOCustomParentTable, Where<SOCustomParentTable.parentID, Equal<Current<SOCustomChildTable.parentID>>>>))]
public int? ParentID { get; set; }
Where PXDefault is setting ParendID of the Child to current Parent's ID and PXParent is creating the Relation between current Child and the Parent.
Commonly there are being created Line Number for child and Line Counter on the Parent to know the count of the Childs.
The full customization you can download here

I was having trouble with this before, because i have a habit of putting new code at the top of the editor, turns out that the data view selection (child) should always be at the bottom (after pxselect)

Related

Acumatica APInvoice Extension Breaks Quick Checks

Version is 19.110.0013
I have created an inner join extension table for APInvoice. This has caused an issue with the Quick Checks flow. Specifically, creation of a Quick Check creates a record within the APInvoice table, but not a corresponding record in the extension table.
My DAC
using PX.Data;
using PX.Objects.AP;
namespace MyProject.DAC
{
[PXTable(IsOptional = false)]
[Serializable()]
public class ApInvoiceExtension : PXCacheExtension<APInvoice>
{
#region MyCustomFlag
public abstract class myCustomFlag : IBqlField { }
[PXDBBool()]
[PXUIField(DisplayName = "Custom Flag")]
public virtual bool? MyCustomFlag { get; set; }
#endregion
}
}
My Table
CREATE TABLE [dbo].[ApInvoiceExtension](
[CompanyID] [int] NOT NULL,
[DocType] [char](3) NOT NULL,
[RefNbr] [nvarchar](15) NOT NULL,
[MyCustomFlag] [bit] NULL,
CONSTRAINT [ApInvoiceExtension_PK] PRIMARY KEY CLUSTERED
(
[CompanyID] ASC,
[DocType] ASC,
[RefNbr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ApInvoiceExtension] ADD DEFAULT ((0)) FOR [CompanyID]
GO
I'm quite sure this has to do with the definition of APQuickCheck which is a DAC with the following attribute
[PXProjection(typeof(Select2<APRegister,
InnerJoin<APInvoice, On<APInvoice.docType, Equal<APRegister.docType>,
And<APInvoice.refNbr, Equal<APRegister.refNbr>>>,
InnerJoin<APPayment, On<APPayment.docType, Equal<APRegister.docType>,
And<APPayment.refNbr, Equal<APRegister.refNbr>>>>>,
Where<APRegister.docType, Equal<APDocType.quickCheck>,
Or<APRegister.docType, Equal<APDocType.voidQuickCheck>>>>), Persistent = true)]
The saving against this projection ignores the required extension records. I wondered if the issue was because the APInvoice referenced here was from the PX.Objects.AP.Standalone namespace instead of the PX.Objects.AP namespace which I extended, so I did attempt to get around this by creating a DAC extension for this namespace as well. My extension looked like this
using PX.Data;
using PX.Objects.AP.Standalone;
namespace MyProject.DAC.Standalone
{
[PXTable(IsOptional = false)]
[Serializable()]
public class ApInvoiceExtension : PXCacheExtension<APInvoice>
{
#region MyCustomFlag
public abstract class myCustomFlag : IBqlField { }
[PXDBBool()]
[PXUIField(DisplayName = "Custom Flag")]
public virtual bool? MyCustomFlag { get; set; }
#endregion
}
}
This addition didn't change the behavior, Quick Checks still created an entry in APInvoice but not in my APInvoiceExtension table.
You are absolutely right and this is because of PXProjection attribute. Please note that PXProjection is not a real table but like SQL view with a set of fields taken from several tables. You can see that APQuickCheck projection is a child APRegister class - as a result, it knows nothing about extended APInvoice fields and you should add them manually using PXDBFieldAttribute.BqlField property.
[PXNonInstantiatedExtension]
public class APQuickCheckExtension : PXCacheExtension<APQuickCheck>
{
#region MyCustomFlag
public abstract class myCustomFlag : IBqlField { }
[PXDBBool(BqlField = typeof(ApInvoiceExtension.myCustomFlag))]
[PXUIField(DisplayName = "Custom Flag")]
public virtual bool? MyCustomFlag
{
get;
set;
}
#endregion
}
[PXTable(IsOptional = false)]
[Serializable()]
public class ApInvoiceExtension : PXCacheExtension<APInvoice>
{
#region MyCustomFlag
public abstract class myCustomFlag : IBqlField { }
[PXDBBool()]
[PXUIField(DisplayName = "Custom Flag")]
public virtual bool? MyCustomFlag { get; set; }
#endregion
}
When doing an extension table you need to indicate the base table keys as the link in PXTable (or at least this was required back in 5.X when we first started using table extensions).
So your DAC extension might look like this:
[PXTable(typeof(APInvoice.docType), typeof(APInvoice.refNbr), IsOptional = false)]
[Serializable]
public class ApInvoiceExtension : PXCacheExtension<APInvoice>
{
#region MyCustomFlag
public abstract class myCustomFlag : IBqlField { }
[PXDBBool()]
[PXUIField(DisplayName = "Custom Flag")]
public virtual bool? MyCustomFlag { get; set; }
#endregion
}
Another note: Because your table is not optional you will need to pre-fill the extension table from the base table so you have all rows 1 for 1. I would recommend setting the IsOptional to true. When false and you have an APInvoice record without a matching APInvoiceExtension record the displayed values in screens and selectors might not display or function correctly.
Ended up opening a case with Acumatica. Response was that I needed to extend APRegister not APInvoice. Ended up changing APInvoice to APRegister (had to backfill my records) and it worked.
using PX.Data;
using PX.Objects.AP;
namespace MyProject.DAC
{
[PXTable(IsOptional = false)]
[Serializable()]
public class ApRegisterExtension : PXCacheExtension<ApRegister>
{
#region MyCustomFlag
public abstract class myCustomFlag : IBqlField { }
[PXDBBool()]
[PXUIField(DisplayName = "Custom Flag")]
public virtual bool? MyCustomFlag { get; set; }
#endregion
}
}
CREATE TABLE [dbo].[ApRegisterExtension](
[CompanyID] [int] NOT NULL,
[DocType] [char](3) NOT NULL,
[RefNbr] [nvarchar](15) NOT NULL,
[MyCustomFlag] [bit] NULL,
CONSTRAINT [ApRegisterExtension_PK] PRIMARY KEY CLUSTERED
(
[CompanyID] ASC,
[DocType] ASC,
[RefNbr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ApRegisterExtension] ADD DEFAULT ((0)) FOR [CompanyID]
GO

Need help in selector control

I created a selector control which displays a list of all serial #s from INItemLotSerial table, it works fine, the problem is the description field is showing InventoryID, how to show InventoryCD. Please have a look at below sample code.
[PXSelector(typeof(Search<INItemLotSerial.lotSerialNbr>),
new Type[] { typeof(INItemLotSerial.lotSerialNbr), typeof(INItemLotSerial.inventoryID) },
SubstituteKey = typeof(INItemLotSerial.lotSerialNbr), DescriptionField = typeof(INItemLotSerial.inventoryID))]
// i also joined with InventoryItem but this doesn't works.
[PXSelector(typeof(Search2<INItemLotSerial.lotSerialNbr,
LeftJoinSingleTable<InventoryItem, On<InventoryItem.inventoryID,Equal<INItemLotSerial.inventoryID>>>>),
new Type[] { typeof(INItemLotSerial.lotSerialNbr), typeof(INItemLotSerial.inventoryID) },
SubstituteKey = typeof(INItemLotSerial.lotSerialNbr), DescriptionField = typeof(InventoryItem.inventoryCD))]
The main problem with DescriptionField property is that it is waiting for getting the field from the same table for which Selector is written. But in the case of ID/CD usually, the CD is not present in the table where ID is present, except the main table.
UPDATED I have removed previous code (implementation using custom attributes and FieldSelecting event handler) because of the performance issues which it is bringing with it. The code below is resulting with the same lookup but getting the data with one inner join instead of all the requests which the previous code was doing.
You can do the following to get this lookup with description:
Create a PXProjection on INItemLotSerial and InventoryItem tables like below:
[PXCacheName("Lot Serials with Inventory CD")]
[PXProjection(typeof(Select2<INItemLotSerial,
InnerJoin<InventoryItem,
On<INItemLotSerial.inventoryID, Equal<InventoryItem.inventoryID>>>>))]
public class INItemLotSerialWithInventoryItem : IBqlTable
{
[PXDBInt(BqlField = typeof(INItemLotSerial.inventoryID))]
[PXUIField(DisplayName = "Inventory ID", Visibility = PXUIVisibility.Visible, Visible = false)]
public virtual int? InventoryID { get; set; }
public abstract class inventoryID : IBqlField { }
[PXDBString(InputMask = "", IsUnicode = true, BqlField = typeof(InventoryItem.inventoryCD))]
[PXUIField(DisplayName = "Inventory ID")]
public virtual string InventoryCD { get; set; }
public abstract class inventoryCD : IBqlField { }
[PXDBString(InputMask = "", IsUnicode = true, BqlField = typeof(INItemLotSerial.lotSerialNbr))]
[PXUIField(DisplayName = "Lot/Serial Nbr")]
public virtual string LotSerialNbr { get; set; }
public abstract class lotSerialNbr : IBqlField { }
}
Set your selector to use this PXProjection like below:
[PXSelector(typeof(Search<INItemLotSerialWithInventoryItem.lotSerialNbr>),
new Type[] { typeof(INItemLotSerialWithInventoryItem.lotSerialNbr) },
SubstituteKey = typeof(INItemLotSerialWithInventoryItem.lotSerialNbr),
DescriptionField = typeof(INItemLotSerialWithInventoryItem.inventoryCD))]
As a result, you will get lookup like below:

Enabling "AllowAddNew" and/or "AllowEdit" on selector for custom DAC

I have created a custom DAC, Graph, and Screen to manage tracking of new entity for client, called "Management Company." New screen is simple Grid with CRUD controls. Selector on Customer screen allows me to choose from list of "Management Company" entries. I also added new field to Contact DAC and DB table to track which "Management Company" is assigned to a given contact. This field is where the selector is configured.
I am trying to enable the "AllowAddNew" and/or "AllowEdit" properties of this selector. When I set to "True," the buttons show up but they don't do anything.
I can create and save new entries to this DB table via the new screen and I can retrieve them with the Selector just fine. I just can't create new from selector.
I have tried looking this up and I'm not finding much information.
How can I achieve this?
Sample of DAC:
namespace PX.Objects.CR
{
[Serializable]
public class UsrCustomerManagementCompany : IBqlTable
{
#region MancompID
[PXDBString(16, IsUnicode = true, InputMask = ">LLLLLLLLLLLLLLLL", IsKey = true)]
[PXUIField(DisplayName = "Company ID")]
[PXDefault]
public virtual string MancompID { get; set; }
public abstract class mancompID : IBqlField { }
#endregion
#region MancompName
[PXDBString(60, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Company Name")]
[PXDefault]
public virtual string MancompName { get; set; }
public abstract class mancompName : IBqlField { }
#endregion
#region MancompDescr
[PXDBString(4000, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Description")]
public virtual string MancompDescr { get; set; }
public abstract class mancompDescr : IBqlField { }
#endregion
}
}
Graph:
using System;
using PX.Data;
using PX.Objects.CR;
namespace ClientCode
{
public class ManagementCompanyMaint : PXGraph<ManagementCompanyMaint, UsrCustomerManagementCompany>
{
public PXSelect<UsrCustomerManagementCompany> ManagementCompanies;
}
}
Contact DAC Extension and Selector:
namespace PX.Objects.CR
{
public class ContactExt : PXCacheExtension<PX.Objects.CR.Contact>
{
#region UsrManagementCompany
[PXDBString]
[PXUIField(DisplayName = "Management Company")]
[PXSelector(
typeof(Search<UsrCustomerManagementCompany.mancompID>),
new Type[]
{
typeof(UsrCustomerManagementCompany.mancompID),
typeof(UsrCustomerManagementCompany.mancompName)
},
SubstituteKey = typeof(UsrCustomerManagementCompany.mancompName)
)]
public virtual string UsrManagementCompany { get; set; }
public abstract class usrManagementCompany : IBqlField { }
#endregion
}
}
I think all you are missing is the PXPrimaryGraph attribute on your DAC to indicate for that record type what is the main graph to refer to.
In your case try adding...
[PXPrimaryGraph(typeof(ClientCode.ManagementCompanyMaint))]
[Serializable]
public class UsrCustomerManagementCompany : IBqlTable
{
//...
}
Here are some related questions that might also help:
How to create a hyperlink user field
how to use AllowEdit in Acumatica

Acumatica - Possible to create several numberingId with existing numberingId

i have some problems with AutoNumberAttribute in Acumatica. In my Project Issue screen i can create new entity with existing numberingId (see screenshot below)
Field selector with AutoNumberAttribute
But other entities like POOrder, Case haven't this promlems. Code for this shown below:
[Serializable]
[PXEMailSource]
[PXPrimaryGraph(typeof(ProjectIssueMaint))]
[PXCacheName(Messages.ProjectIssue.CacheName)]
public class ProjectIssue : BaseCache, IBqlTable, IAssign, IPXSelectable
{
[PXDBIdentity]
[PXUIField(Visible = false, Visibility = PXUIVisibility.Invisible, DisplayName = Messages.ProjectIssue.NumberId)]
public virtual int? ProjectIssueId
{
get;
set;
}
[PXDefault]
[PXFieldDescription]
[PXDBString(10, IsKey = true, IsUnicode = true, InputMask = ">CCCCCCCCCCCCCCC")]
[PXUIField(DisplayName = Messages.ProjectIssue.NumberId, Required = true)]
[PXSelector(typeof(Search<projectIssueCd>),
typeof(projectIssueCd),
typeof(projectId),
typeof(projectTaskId),
typeof(classId),
typeof(summary),
typeof(status),
typeof(ownerID),
Filterable = true)]
[AutoNumber(typeof(ProjectManagementSetup.projectIssueNumberingId), typeof(createdDateTime))]
public virtual string ProjectIssueCd
{
get;
set;
}
public abstract class projectIssueCd : IBqlField
{
}
public abstract class projectIssueId : IBqlField
{
}
}
[Serializable]
[PXCacheName(Messages.ProjectManagementSetup.CacheName)]
public class ProjectManagementSetup : BaseCache, IBqlTable
{
[PXDBString(10, IsUnicode = true, InputMask = ">aaaaaaaaaa")]
[PXDefault(Constants.ProjectIssue.NumberingId)]
[PXSelector(typeof(Numbering.numberingID), DescriptionField = typeof(Numbering.descr))]
[PXUIField(DisplayName = Messages.ProjectManagementSetup.ProjectIssueNumberingSequence)]
public virtual string ProjectIssueNumberingId
{
get;
set;
}
public abstract class projectIssueNumberingId : IBqlField
{
}
}
public class ProjectIssueMaint : PXGraph<ProjectIssueMaint, ProjectIssue>
{
[PXViewName(Messages.ProjectIssue.CacheName)]
[PXCopyPasteHiddenFields(typeof(ProjectIssue.status))]
public PXSelect<ProjectIssue> ProjectIssue;
[PXHidden]
[PXCheckCurrent]
public PXSetup<ProjectManagementSetup> ProjectManagementSetup;}
public class ProjectManagementSetupMaint : PXGraph<ProjectManagementSetupMaint>
{
public PXSave<ProjectManagementSetup> Save;
public PXCancel<ProjectManagementSetup> Cancel;
public PXSelect<ProjectManagementSetup> ProjectManagementSetup;
}
I reproproduce this issue by change the last number field in the numbering sequence screen (see screenshot https://snag.gy/UpIe8a.jpg).
So somebody know why this maybe happend? Any information will help me)
The AutoNumberAttribute completely relies on the configuration of the associated Numbering Sequence and does not have built-in validation to prevent insertion of the record with the duplicated number, which was generated by the AutoNumberAttribute. Since your table is built with A Pair of Columns with Key Substitution in the UI, you must add a unique index consisting of the CompanyID and ProjectIssueCd columns to prevent the insertion of multiple ProjectIssue records with the same ProjectIssueCd on the database level.
CREATE UNIQUE NONCLUSTERED INDEX [ProjectIssue_ProjectIssueCd_Uindex] ON [dbo].[ProjectIssue]
(
[CompanyID] ASC,
[ProjectIssueCd] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)

PXSelect returns a POReceipt with a wrong VendorID

This is inside an extension of a BLC (extending PXGraphExtension):
[PXOverride]
protected virtual IEnumerable resultRecords()
{
foreach (PXResult<InventoryTranHistEnqResult, INTran> item in list)
{
PXResult<POReceipt> receiptResult = PXSelect<POReceipt, Where<POReceipt.receiptNbr, Equal<Required<POReceipt.receiptNbr>>>>.Select(Base, "999");
POReceipt receipt = (POReceipt)receiptResult;
PXTrace.WriteInformation(receipt.ReceiptNbr); // CORRECT
PXTrace.WriteInformation(receipt.VendorID); // INCORRECT
}
}
The Vendor ID of the receipt seems to be wrong, but the other details from the record seem to be correct? Here is the DAC for POReceipt. Do I need to do something to make the right Vendor ID get selected?
public partial class POReceipt : PX.Data.IBqlTable, PX.Data.EP.IAssign {
#region Selected
#region ReceiptType
#region ReceiptNbr
#region SiteID
public abstract class siteID : IBqlField { }
[IN.Site(DisplayName = "Warehouse")]
public int? SiteID
{
get;
set;
}
#endregion
#region VendorID
public abstract class vendorID : PX.Data.IBqlField
{
}
protected Int32? _VendorID;
[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))]
[PXDefault()]
[PXFormula(typeof(Switch<Case<Where<POReceipt.receiptType, Equal<POReceiptType.transferreceipt>>, Selector<POReceipt.siteID, Selector<INSite.branchID, Branch.branchCD>>>, POReceipt.vendorID>))]
public virtual Int32? VendorID
{
get
{
return this._VendorID;
}
set
{
this._VendorID = value;
}
}
#endregion

Resources