Skip to content

Instantly share code, notes, and snippets.

View hasokeric's full-sized avatar
👋

Haso Keric hasokeric

👋
View GitHub Profile
@hasokeric
hasokeric / StoreAppStateInURL.md
Last active January 9, 2023 21:39
Store Entire Application State in URL after #

I decied to encode the entire application state as a Base64 encoded string in the hashmark of the url. For example, a url would look like (note its truncated since they are very long):

knotend.com/g/a#N4IgzgpgTglghgGxgLwnARgiAxA9lAWxAC5QA7X...

Everything after the /g/a# is a stringified version of a json object that contains all the information about the flowchart. It gets stringified, then compressed, then Base64 encoded. I update the url on every graph edit, so copying the graph state is as simple as copying the url in your browser bar.

Here's the pseudo code for creating the url, and then later reading it:

const stateString = JSON.stringify(appState); // appState is a json object
@hasokeric
hasokeric / EpicorUDMap.md
Last active October 13, 2022 13:23
If you are using UD Column Map Maintenance, here is some more information on each mappings Functional Process.
Map ID Source Target Valid Functional Process
1 JobPart ECOCoPart Yes EWB - Get Details from a Job Template
2 PartCoPart ECOCoPart Yes EWB - Updating a revision, Get Details from a Method
3 QuoteCoPart ECOCoPart Yes EWB - Get Details from a Quote Template
4 JobAsmbl ECOMtl Yes EWB - Get Details from a Job Template
5 JobMtl ECOMtl Yes EWB - Get Details from a Job Template
@hasokeric
hasokeric / BAQDataViewWithParams.cs
Created September 28, 2022 13:27
Example BAQDataView with Params
// **************************************************
// Custom code for RcptToInvForm
// Created: 7/21/2022 2:05:06 PM
//
// **************************************************
extern alias Erp_Contracts_BO_ReceiptsFromMfg;
extern alias Erp_Contracts_BO_PkgControlIDMaint;
extern alias Erp_Contracts_BO_Part;
extern alias Erp_Contracts_BO_Warehse;
@hasokeric
hasokeric / 55-bytes-of-css.md
Created September 26, 2022 12:25 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE scan [<!ENTITY test SYSTEM "http://google.com/">]>
<scan>&test;</scan>
@hasokeric
hasokeric / DeserializePOSTBPM.cs
Last active March 1, 2022 19:07
Me tinkering with Deserializing JSON in Post BPM
using System;
using System.Data;
using System.Linq;
using System.Data.DataSetExtensions;
// use dtJson instead of dynJson
public class Program
{
public static void Main()
@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.
//