Skip to content

Instantly share code, notes, and snippets.

View smarenich's full-sized avatar

Sergey Marenich smarenich

View GitHub Profile
select
CompanyID,
BatchID,
ChangeID,
ScreenID,
(Select top 1 username from Users u where PKID = UserID),
ChangeDate,
Operation,
REPLACE(CAST(CAST(CombinedKey AS VARCHAR(max)) AS VARBINARY(max)), 0x0, ','),
REPLACE(CAST(CAST(ModifiedFields AS VARCHAR(max)) AS VARBINARY(max)), 0x0, ',')
//PXSearchable for GL Batch
[PXSearchable(
SM.SearchCategory.GL,
"{0} {1} - {2}",
new Type[] { typeof(Batch.module), typeof(Batch.batchNbr), typeof(Batch.branchID) },
new Type[] { typeof(Batch.ledgerID), typeof(Batch.description), typeof(BatchExt.usrExternarLeference) },
NumberFields = new Type[] { typeof(Batch.batchNbr) },
Line1Format = "{0}{1}{2:d}",
Line1Fields = new Type[] { typeof(Batch.ledgerID), typeof(Batch.finPeriodID), typeof(Batch.dateEntered) },
Line2Format = "{0}", Line2Fields = new Type[] { typeof(Batch.description) }
public class SomeMaint : PXGraph<SomeMaint>
{
public PXSelect<UnionTable> UnionSelect;
protected IEnumerable unionSelect()
{
List<UnionTable> result = new List<UnionTable>();
foreach (SomeTable1 row in PXSelect<SomeTable1>.Select(this))
{
//Defining action DataView
public PXAction<MyDAC> MyButton;
//Defining Button Attribute with tooltip
[PXButton(Tooltip = PX.Data.Update.Messages.MyTooltip)]
//Providing title and mapping action access rights
[PXUIField(DisplayName = "MyTitle", MapEnableRights = PXCacheRights.Delete, MapViewRights = PXCacheRights.Delete)]
protected void myButton()
{
WebDialogResult result = Companies.Ask(ActionsMessages.Warning, PXMessages.LocalizeFormatNoPrefix("My Message"),
MessageButtons.OKCancel, MessageIcon.Warning, true);
public PXAction<MyDAC> MyButton;
[PXButton(Tooltip = PX.Data.Update.Messages.MyTooltip)]
[PXUIField(DisplayName = "MyTitle", MapEnableRights = PXCacheRights.Delete, MapViewRights = PXCacheRights.Delete)]
protected void myButton()
{
if (MyPanel.AskExt(true) != WebDialogResult.OK) return;
//Do some useful Stuff
}
<px:PXSmartPanel ID="pnlCopyCompany" runat="server" CaptionVisible="True" Caption="My Command"
Style="position: static" LoadOnDemand="True" Key="MyPanel" AutoCallBack-Target="frmMyCommand"
AutoCallBack-Command="Refresh" DesignView="Content">
<px:PXFormView ID="frmMyCommand" runat="server" SkinID="Transparent" DataMember="MyPanel" DataSourceID="ds" EmailingGraph="">
<Template>
<px:PXLayoutRule runat="server" ControlSize="M" LabelsWidth="M" StartColumn="True" />
<px:PXLabel ID="lblWarning" runat="server" Encode="True">
WARNING: Some Action.
</px:PXLabel>
<px:PXSelector ID="edMyField" runat="server" AutoRefresh="True" DataField="MyField" DataSourceID="ds" />
static void Main(string[] args)
{
using (DefaultSoapClient client = new DefaultSoapClient())
{
client.Endpoint.Address = new System.ServiceModel.EndpointAddress("https://localhost/demo/entity/Default/5.30.001");
client.Login("admin", "123", "Demo", null, null);
Console.WriteLine("Get all Stock Items");
//retrieveAllEntities force system to retrive details and linked entities
Entity[] items = client.GetList(new StockItem(), false);
public const string SessionKey = "MyFileImportSessionKey";
public PXAction<GLTran> UploadFileBatch;
[PXUIField(DisplayName = "Upload File as Batches", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Visible = true)]
[PXButton()]
public virtual IEnumerable uploadFileBatch(PXAdapter adapter)
{
//Ask user to upload file, continue if it is OK
if (this.NewFilePanel.AskExt() == WebDialogResult.OK)
{
private static void ImportTransactionsFromFile(PX.SM.FileInfo file)
{
ImportTest graph = new ImportTest();
Byte[] bytes = file.BinData;
using(PX.Data.XLSXReader reader = new XLSXReader(bytes))
{
//Initialising Reader
reader.Reset();
//Creating a dictionary to find column index by name
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using PX.Data;
using PX.Common;
using PX.Objects.GL;
using PX.Objects.IN;
using PX.Objects.CM;
using PX.Export;