Skip to content

Instantly share code, notes, and snippets.

View BrianMRO's full-sized avatar

Brian Stevens BrianMRO

  • SETECH Supply Chain Solutions, LLC
View GitHub Profile
@BrianMRO
BrianMRO / BarCodeScan.txt
Created November 18, 2020 20:57
BarCodeScan
add field "LotSerialNbr"
{
special = BarCodeScan
}
@BrianMRO
BrianMRO / DHPrint.cs
Created November 18, 2020 20:56
DHPrint
/// <summary>
/// DHPrint - DeviceHub Print - Sends an uploaded file to a printer via Device Hub
/// </summary>
/// <param name="mergedFile">The label control file (as PX.SM.FileInfo)</param>
/// <param name="printer">The SMPrinter for the Device Hub PrinterID</param>
public static void DHPrint(FileInfo mergedFile, SMPrinter printer)
{
Dictionary<string, string> parameters = new Dictionary<string, string> { {
"FILEID",
mergedFile.UID.ToString()
@BrianMRO
BrianMRO / UploadLabelControlFile.cs
Created November 18, 2020 20:54
UploadLabelControlFile
protected virtual bool UploadLabelControlFile(StringBuilder labelSB, string language)
{
byte[] labelBytes = Encoding.ASCII.GetBytes(labelSB.ToString());
// Define a unique filename for the label control file
string filename = "label-" +
Guid.NewGuid().ToString() +
"." +
language.ToLower();
@BrianMRO
BrianMRO / gist:86e23999660ecdae676cbf77f007c457
Created November 25, 2020 00:10
EPApproval Cache Attached
#region EPApproval Cache Attached
[PXDBDate()]
[PXDefault(typeof(SSRQRequisition.requestDate), PersistingCheck = PXPersistingCheck.Nothing)]
protected virtual void EPApproval_DocDate_CacheAttached(PXCache sender)
{
}
[PXDBInt()]
[PXDefault(typeof(SSRQRequisition.customerID), PersistingCheck = PXPersistingCheck.Nothing)]
protected virtual void EPApproval_BAccountID_CacheAttached(PXCache sender)
@BrianMRO
BrianMRO / Refactor_OwnerID_Step1
Created February 4, 2021 18:55
Refactor OwnerID - Step 1
USE [MyDatabase]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF COL_LENGTH('dbo.XXMyTable', 'OldOwnerID') IS NULL
@BrianMRO
BrianMRO / Refactor_OwnerID_Step2
Created February 4, 2021 19:03
Refactor OwnerID - Step 2
USE [MyDatabase]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF COL_LENGTH('dbo.XXMyTable', 'OwnerID') IS NOT NULL AND COL_LENGTH('dbo.XXMyTable', 'OldOwnerID') IS NOT NULL
@BrianMRO
BrianMRO / Refactor_OwnerID_Step3
Last active February 4, 2021 19:32
Refactor OwnerID - Step 3
#region OwnerID
[Owner(DisplayName = "Owner")]
public virtual int? OwnerID { get; set; }
public abstract class ownerID : PX.Data.BQL.BqlInt.Field<ownerID> { }
#endregion
#region IAssign Members
int? PX.Data.EP.IAssign.OwnerID
{
get { return OwnerID; }
@BrianMRO
BrianMRO / PXRestrictor
Created February 9, 2021 20:44
Restrictors for Selectors
[PXMergeAttributes(Method = MergeMethod.Append)]
[PXRestrictor(typeof(
Where<INLocationExt.usrXXMyCondition, NotEqual<ConditionType.condition1>>
), "")]
protected virtual void INTran_ToLocationID_CacheAttached(PXCache sender) { }
@BrianMRO
BrianMRO / dynamic_list
Last active February 9, 2021 20:54
Dynamic Lists
protected void _(Events.RowSelected<XXMyDAC> e)
{
XXMyDAC row = x.Row;
if(*condition*) // Substitute your conditional logic here
{
SelectableValues2 listattr = new SelectableValues2();
PXStringListAttribute.SetList<XXMyDAC.myField>
(e.Cache, row, listattr.AllowedValues, listattr.AllowedLabels);
}
@BrianMRO
BrianMRO / Acumatica_Mobile_SmartPanel_Example.txt
Created May 12, 2021 17:59
Acumatica Mobile 2021R1 Smart Panel Example
add screen IN202500 {
add container "StockItemSummary" {
...
add recordAction "CreateTagAction" {
displayName = "Create Tag"
redirect = true
redirectToDialog = "IN202500D1"
}
}
add dialog IN202500D1 {