Skip to content

Instantly share code, notes, and snippets.

View hasokeric's full-sized avatar
👋

Haso Keric hasokeric

👋
View GitHub Profile
@hasokeric
hasokeric / VinValidatorBPMs.cs
Created January 25, 2022 11:05
Epicor VIN Validation Automotive
// Erp.SerialNo.Update.PRE.ValidateVIN
//
// IsVehicleRefCat? Custom Condition
foreach (var ttSerialRow in ttSerialNo.Where(x => x.Added()))
{
bool isVehiclePart =
(from p in Db.Part.With(LockHint.NoLock)
where p.Company == ttSerialRow.Company
&& p.PartNum == ttSerialRow.PartNum
@hasokeric
hasokeric / EpicorProcessCallerExample.cs
Created January 25, 2022 09:52
ProcessCaller.PerformSearch Epicor uses ProcessCaller.PerformSearch throughout all of its UIApps for various adapters. No Dependencies Needed.
object searchReslts = ProcessCaller.PerformSearch(oTrans.EpiBaseForm, "JobEntryAdapter", "List" /* or Rows */, "JobNum = '" + args.ProposedValue.ToString() + "'");
if (searchReslts is DataSet)
{
DataSet searchDS = (DataSet) searchReslts;
if (searchDS.Tables[0].Rows.Count > 0)
{
string jobNum = searchDS.Tables[0].Rows[0]["JobNum"].ToString();
string partNum = searchDS.Tables[0].Rows[0]["PartNum"].ToString();
@hasokeric
hasokeric / EpicorBPMCode.cs
Created January 25, 2022 09:46
Get Epicor Environment in BPM Code
// All types
// Production
// NonProduction
bool _isProd = (this.GetEnvironmentType() == Ice.Lib.Bpm.Model.EnvironmentType.Production) ;
@hasokeric
hasokeric / Erp.ARInvoice.GetShipments.POST.TempJCInvcDtlBugFix.cs
Last active July 14, 2022 04:13
Temporary BPM to Fix Epicor Bug when Job is closed before invoicing. Using EXACT same algorithm Epicor uses. The Bug has been reported to Epicor and should be fixed in the future.
// Populate Job Costing Fields on InvcDtl when the Job is closed
//
// NOTES:
// Usually Job Closing Costs are populated when the Job is closed
// however if the Job has been closed before Invoicing the JC Costs
// are not populated. The manual is to open the job and close it again.
// Hence why this BPM was created to populate the JC Costs without
// having to open and close the job.
//
@hasokeric
hasokeric / EpicorSequenceTables.txt
Created November 17, 2020 18:14
Epicor Sequence Tables
SELECT * FROM Erp.KeyLast;
SELECT * FROM Erp.CompanySequence;
SELECT * FROM Ice.SysSequence;
/**
* Initialize the File Trigger Watcher which will monitor the fullFilePath
* directory and when the BPM writes a new file it will read the file and
* based on the contents of the file we can do certain actions think of it as a
* bridge to have the BPM Communicate with our C# Code
*
* @type Custom Function
* @return void
*/
private void InitializeFileTriggerWatcher()
@hasokeric
hasokeric / EpicorFeatureFlags.cs
Last active July 11, 2020 21:10
Epicor Feature Flags
FeatureFlags.InAppNotifications = new Guid("79479C59-021B-40C4-A8D3-2F859FD8CD6B");
FeatureFlags.CdcConfigureDeleteProcessedLogs = new Guid("380B0652-1C47-477F-B25F-C4937EB44185");
FeatureFlags.EnableReportTaskRetry = new Guid("2B53219E-16E6-49ED-9195-66449046371F");
FeatureFlags.EnforeceProcessCallingRules = new Guid("056D0F09-7058-4FED-A7D9-5B969D57FE6D");
FeatureFlags.IdentityProvider = new Guid("8FA3AF1A-89B8-4978-8812-7245A02ACFF2");
FeatureFlags.KineticUI = new Guid("1E17815F-1381-4D9E-B1BA-E57FC86625EE");
FeatureFlags.ApiV2 = new Guid("4A9BF629-F65E-415C-BF18-8C10683C56DF");
Add to your .sysconfig
@hasokeric
hasokeric / Ice.Menu.GetRows.POST.AuditorMenuOverride.cs
Created July 11, 2020 07:07
Ice.Menu.GetRows Post-Processing
// Set Auditor Role Menu Maintenance Items as Readonly
//
// OptionType:
// A = BAQ Report, OptionType S = Sub Menu, I = Menu Item (Program), B = Report Builder Report Link, C = Assembly Dashboard, D = Runtime, N = Process
//
// OptionSubType:
// F = Form T = Tracker M = Maintenance P = Process R = Report E = Entry
//
// Get All Menu Items of type Form, Maintenance or Entry
@hasokeric
hasokeric / EpicorKeyControlSelectNextControl.cs
Created May 29, 2020 19:43
Epicor oTrans.KeyControl Next Control
((Control)oTrans.KeyControl).Parent.SelectNextControl((Control)oTrans.KeyControl, true, true, true, true);
@hasokeric
hasokeric / EpicorUBAQFromCustomization.cs
Created April 15, 2020 18:12
Epicor UBAQ C# - Invoke UBAQ from Customization
// Epicor UBAQ C# - Invoke UBAQ from Customization
// Invoke UBAQ from Customization, shows how to add new Rows and then when Update is called they are Mass Updated (I do have Allow Multi Row Update on my BAQ, not sure if it matters).
public System.Data.DataSet xyz()
{
// Declare and create an instance of the Adapter.
DynamicQueryAdapter adapterDynamicQuery = new DynamicQueryAdapter(this.oTrans);
adapterDynamicQuery.BOConnect();
// Declare and Initialize Variables