Skip to content

Instantly share code, notes, and snippets.

View hasokeric's full-sized avatar
👋

Haso Keric hasokeric

👋
View GitHub Profile
@hasokeric
hasokeric / why.cs
Created February 16, 2019 05:26
www
Ice.Lib.Report.EpiReportFunctions.GetWorkStationID((Ice.Core.Session)oTrans.Session)
@hasokeric
hasokeric / EpicorGetMemoBO.cs
Last active February 27, 2019 08:25
Epicor GetMemo
private string GetMemo(string QuoteNum)
{
//
// Ice.Contracts.Lib.BOReader Must be Added to Assembly
//
Ice.Proxy.Lib.BOReaderImpl bor = WCFServiceSupport.CreateImpl<Ice.Proxy.Lib.BOReaderImpl>((Ice.Core.Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.BOReaderSvcContract>.UriPath);
string whereClause = string.Format(" Key1 = '{0}' and RelatedToFile = 'Quote'", QuoteNum);
DataSet dsMemo = bor.GetRows("Ice:BO:Memo", whereClause, string.Empty);
if (dsMemo.Tables[0].Rows.Count > 0)
@hasokeric
hasokeric / FailedSOCode.cs
Created January 31, 2019 23:44
My FAILED Attempt at Sales Order Entry Mass Update due to Epicor Weird Logic
// **************************************************
// Custom code for SalesOrderForm
// Created: 1/31/2019 2:09:52 PM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
@hasokeric
hasokeric / SearchAllColsTablesSQLValue.sql
Created January 20, 2019 16:34
Search All Columns and Tables for a value MS SQL
DECLARE @SearchStrTableName nvarchar(255), @SearchStrColumnName nvarchar(255), @SearchStrColumnValue nvarchar(255), @SearchStrInXML bit, @FullRowResult bit, @FullRowResultRows int
SET @SearchStrColumnValue = '%searchthis%' /* use LIKE syntax */
SET @FullRowResult = 1
SET @FullRowResultRows = 3
SET @SearchStrTableName = NULL /* NULL for all tables, uses LIKE syntax */
SET @SearchStrColumnName = NULL /* NULL for all columns, uses LIKE syntax */
SET @SearchStrInXML = 0 /* Searching XML data may be slow */
IF OBJECT_ID('tempdb..#Results') IS NOT NULL DROP TABLE #Results
CREATE TABLE #Results (TableName nvarchar(128), ColumnName nvarchar(128), ColumnValue nvarchar(max),ColumnType nvarchar(20))
@hasokeric
hasokeric / AvoidSubStringNullRefEx.cs
Created December 17, 2018 11:42
AvoidSubStringNullRefEx.cs
string partNum = "PART123456";
string partSeg = partNum.Length >= 9 ? partNum.Substring(0, 9) : partNum.Substring(0, partNum.Length);
faComment = ((FirstArt.CommentText.Length > 37) ? FirstArt.CommentText.SubString(0, 37) : FirstArt.CommentText);
@hasokeric
hasokeric / EpicorHealthCheck.ps1
Last active March 31, 2021 07:43
Epicor Health Check PowerShell
# Ignore SSL
if (-not("dummy" -as [type])) {
add-type -TypeDefinition @"
using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
public static class Dummy {
public static bool ReturnTrue(object sender,
@hasokeric
hasokeric / EpicorResetListView_UD100.cs
Created November 27, 2018 01:52
EpicorResetListView_UD100.cs
DataRow drExistingBatch2 = this.FindBatchDataRowByJobNum("FEF000241");
if (drExistingBatch2 != null)
{
string sKey1 = drExistingBatch2["Key1"].ToString();
string sKey2 = drExistingBatch2["Key2"].ToString();
string sKey3 = drExistingBatch2["Key3"].ToString();
string sKey4 = drExistingBatch2["Key4"].ToString();
string sKey5 = drExistingBatch2["Key5"].ToString();
@hasokeric
hasokeric / EpicorSupressFormSearch.cs
Created November 26, 2018 21:20
Epicor SupressFormSearch
LaunchFormOptions lfo = new LaunchFormOptions();
lfo.IsModal = false;
lfo.SuppressFormSearch = true;
lfo.ValueIn = schedParams;
lfo.PublisherKey = trans.GetPublisher("JobHead.JobNum").PublishKey;
lfo.CallBackToken = trans.JobEntryToken;
ProcessCaller.LaunchForm(this, "Erp.UI.JobSchedulingBoardEntry", lfo);
@hasokeric
hasokeric / EpicorAlignLabels.cs
Created November 26, 2018 17:44
Epicor Align Stuff
// Center and Left Align Labels
lblHeadingSize.TextAlign = ContentAlignment.MiddleCenter;
lblHeadingPressure.TextAlign = ContentAlignment.MiddleCenter;
lblFrontTireCTP_PSI.TextAlign = ContentAlignment.MiddleLeft;
lblRearTireCTP_PSI.TextAlign = ContentAlignment.MiddleLeft;
lblSpareTireCTP_PSI.TextAlign = ContentAlignment.MiddleLeft;
lblFrontTireCTP_KPA.TextAlign = ContentAlignment.MiddleLeft;
lblRearTireCTP_KPA.TextAlign = ContentAlignment.MiddleLeft;
@hasokeric
hasokeric / BankStatementConversionTableset.cs
Created November 25, 2018 22:13
BankStatementConversionTableset BPM
string CompanyId = string.Empty;
List<string> Company = (from companyRecord in Db.SysCompany
select companyRecord.Company).ToList();
foreach (var companyID in Company)
{
CompanyId = companyID;
using (CallContext.Current.TemporarySessionCreator.SetCompanyID(CompanyId).Create())
{
using (var svcBankStatement = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.BankStatementConversionSvcContract>(Db))