Skip to content

Instantly share code, notes, and snippets.

View smarenich's full-sized avatar

Sergey Marenich smarenich

View GitHub Profile
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;
declare @stmt nvarchar(max)
declare @restriction nvarchar(max)
declare @companyID int
declare @parent int
declare c cursor for
select CompanyID from Company c
where c.CompanyID > 0
and(Select top 1 CompanyID from Company Where CompanyId > 0 and ParentCompanyID = c.CompanyID) is null
order by CompanyID
--Specific customer data like email info, credit cards info, etc.
update PreferencesSecurity set PasswordMinLength = 3, PasswordComplexity = 0, PasswordSecurityType = 0
update users set password = '123', PasswordChangeOnNextLogin =0, PasswordNeverExpires = 1 where source = 0
delete from userfilter
Update EMailAccount set Password = '123'
UPDATE AUSchedule SET IsActive = 0
update CustomerPaymentMethodDetail set value = '' where detailid in ('CCDNUM', 'ADDLN1', 'ADDLN2', 'NAMEONCC', 'CVV')
update ccproctran set PCResponse = ''
update CCProcessingCenterDetail set Value = '1111' where DetailID='LOGINID' or DetailID = 'TRANKEY'
UPDATE TXAvalaraSetup SET Account = NULL, Licence = NULL WHERE CompanyID > 0
public class SOOrderEntry_Extension:PXGraphExtension<SOOrderEntry>
{
//Lets define additional button than will call automation button.
public PXAction<SOOrder> ButtonExample;
[PXButton()]
[PXUIField(DisplayName = "Button Example")]
public virtual IEnumerable buttonExample(PXAdapter adapter)
{
SOOrder order = Base.Document.Current;
if exists(select * from sys.objects where object_id = object_id('dbo.pp_ChangeBaseCury') and objectproperty(object_id,'IsProcedure')=1)
drop proc dbo.pp_ChangeBaseCury
go
create procedure dbo.pp_ChangeBaseCury @companyID int, @oldCury NVARCHAR(10), @newCury NVARCHAR(10), @description NVARCHAR(255), @symbol NVARCHAR(10) AS
BEGIN
DECLARE @stmt NVARCHAR(MAX)
DECLARE @table NVARCHAR(255)
DECLARE @column NVARCHAR(255)
DECLARE @anyfailed bit
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PX.SM;
using PX.TM;
using PX.Data;
namespace PX.Objects.CR
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using PX.Data;
using System.Text;
using System.Xml;
using System.IO;
using PX.Data.SQLTree;
public PXSelectReadonly2<Contract,
InnerJoin<ContractBillingSchedule, On<ContractBillingSchedule.contractID, Equal<Contract.contractID>>,
InnerJoin<CSAnswers,
On<CSAnswers.entityType, Equal<CSAnswerType.contractAnswerType>,
And<CSAnswers.entityID, Equal<Contract.contractID>,
And<CSAnswers.attributeID, Equal<AttributesConst.RevTypeAttribute>>>>,
InnerJoin<CSAttributeDetail,
On<CSAttributeDetail.attributeID, Equal<AttributesConst.RevTypeAttribute>,
And<CSAttributeDetail.valueID, Equal<CSAnswers.value>>>,
>>>,
public PXAction<MultiPayment> Release;
[PXProcessButton]
[PXUIField(DisplayName = "Release")]
protected virtual void release()
{
this.Actions.PressSave();
PXLongOperation.StartOperation(this, delegate ()
{
CreatePayment(row);