Skip to content

Instantly share code, notes, and snippets.

Avatar

Stéphane Bélanger ste-bel

  • Asgard Alliance Software
  • Montréal, Québec, Canada
View GitHub Profile
View FilterID.cs
// GUID, defaulting by "old" algorithm (timestamp + ethernet MAC address)
[PXDBSequentialGuid(IsKey=true)]
[PXReferentialIntegrityCheck]
[PXUIField(DisplayName="ID")]
public Guid? FilterID { get; set; }
View WebHookID.cs
[PXDBGuid(false, IsKey=true)]
public Guid? WebHookID { get; set; }
View LineNbr.cs
[PXDBInt(IsKey = true)]
[PXUIField(DisplayName = "Line Nbr.", Visible = false)]
public int? LineNbr { get; set; }
View ChildTableKey.cs
// Child Key
[PXDBDefault(typeof(BCBinding.bindingID))]
[PXDBInt(IsKey=true)]
[PXParent(typeof(Select<BCBinding, Where<BCBinding.bindingID, Equal<Current<BCBindingBigCommerce.bindingID>>>>))]
[PXUIField(DisplayName="Store", Visible=false)]
public int? BindingID { get; set; }
// Parent Key
[PXDBIdentity]
[PXUIField(DisplayName="Store ID", Visible=false)]
View PXDBLongIdentity.cs
[PXDBLongIdentity(IsKey=true)]
[PXUIField(DisplayName="Record ID", Enabled=false, Visible=false)]
public long? RecordID { get; set; }
View PXDBIdentity.cs
[PXDBIdentity(IsKey=true)]
[PXUIField(Visible=false)]
public int? LogID { get; set; }
View WebHook.sql
CREATE TABLE [dbo].[WebHook](
[CompanyID] [int] NOT NULL,
[WebHookID] [uniqueidentifier] NOT NULL,
[Name] [nvarchar](128) NOT NULL,
...
CONSTRAINT [WebHook_PK] PRIMARY KEY CLUSTERED
(
[CompanyID] ASC,
[WebHookID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
View WebHook ID vs Name.cs
[PXDBGuid(false)]
[PXDefault]
public Guid? WebHookID { get; set; }
[PXDBString(128, IsUnicode=true, IsKey=true, InputMask="")]
[PXDefault]
[PXSelector(typeof(WebHook.name), new Type[] { typeof(WebHook.name), typeof(WebHook.isActive), typeof(WebHook.isSystem) })]
[PXUIField(DisplayName="Webhook Name")]
public string Name { get; set; }
View BAccount.sql
CREATE TABLE [dbo].[BAccount](
[CompanyID] [int] NOT NULL,
[BAccountID] [int] IDENTITY(1,1) NOT NULL,
[AcctCD] [nvarchar](30) NOT NULL
...
CONSTRAINT [BAccount_PK] PRIMARY KEY CLUSTERED
(
[CompanyID] ASC,
[BAccountID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
View BAccountID vs AcctCD.cs
/// <summary>
/// The identifier of the business account.</summary>
/// <remarks>This field is auto-incremental and not visible
/// This field is a surrogate key, as opposed to the natural key <see cref="AcctCD"/>.
/// </remarks>
[PXDBIdentity]
[PXUIField(Visible = false, Visibility = PXUIVisibility.Invisible, DisplayName = "Account ID")]
[PXReferentialIntegrityCheck]
public int? BAccountID { get; set; }