Skip to content

Instantly share code, notes, and snippets.

@pmalicki11
pmalicki11 / hideTab.cs
Last active December 1, 2023 11:42
Hiding Tab
using System.Collections.Generic;
using System.Linq;
using Erp.UI.App.CustomerTracker; // or Erp.UI.App.CustomerEntry when in Customer entry form
using Infragistics.Win.UltraWinDock;
CustomerDock customerDock = (CustomerDock)csm.GetNativeControlReference("197d7d6d-2443-47c7-b8ef-aa6cd9a95267");
DockableControlPane taxCertCustomerTab = customerDock.baseDockManager.ControlPanes
.Cast<DockableControlPane>()
.Where(x => x.TextTab == "Tax Certification")
.FirstOrDefault();
@pmalicki11
pmalicki11 / ControlsColors.cs
Created September 26, 2023 07:16
Coloring controls in row rules
ControlSettings styleOrange = new ControlSettings();
styleOrange.StyleSetName = "styleOrange";
styleOrange.BackColor = System.Drawing.Color.Orange;
// or like this
// styleOrange.BackColor = System.Drawing.Color.FromArgb(255, 165, 0);
this.edvOrderHead.AddRowRule(new RowRule("OrderHed.WrongShipBy", RuleCondition.Equals, true, new RuleAction[] {
RuleAction.AddControlSettings(this.oTrans, "OrderHed.RequestDate", styleOrange)
}));
@pmalicki11
pmalicki11 / CustomColumnInDataView.cs
Last active September 12, 2023 11:12
Adding Custom column to DataView
// UI Customization side
// Adding a column to the view and setting some props
private void UpdateWhereUsedView()
{
EpiDataView edvPartWhereUsed = (EpiDataView)(oTrans.EpiDataViews["PartWhereUsed"]);
if (!edvPartWhereUsed.dataView.Table.Columns.Contains("ForecastYearQty"))
{
edvPartWhereUsed.dataView.Table.Columns.Add(new DataColumn("ForecastYearQty", typeof(decimal)));
edvPartWhereUsed.dataView.Table.Columns["ForecastYearQty"].ExtendedProperties["ReadOnly"] = true;
@pmalicki11
pmalicki11 / CustomToolButtons.cs
Last active December 20, 2020 14:05
Adding a button tool to the ribbon
/*
Here you can find out how to add some buttons to the form's ribbon and top menus
I strongly recommend check out this too: https://gist.github.com/hasokeric/80534d734d13f431b713045a9dca4f32
*/
using Infragistics.Win.UltraWinToolbars;
UltraToolbarsManager toolbarsManager = this.baseToolbarsManager;
@pmalicki11
pmalicki11 / Callbacks.cs
Last active December 20, 2020 13:50
Using callback form in Epicor
/*
Sometimes after launching form from modification you want to get some data back to the form from which it was launched.
Short example shows the mechanism.
1. In CaseForm there is button that launch CustomerForm.
2. When we click it CustomerForm opens and we fill all data we need.
3. When everything is filled we save it and close CustomerForm.
4. The newly added customer is going back to the CaseForm Customer field.
*/
// CaseForm
@pmalicki11
pmalicki11 / EpicorRowRules.cs
Last active December 20, 2020 13:38
Epicor Row Rules
/* Available conditions for rules
Column Value Changes - The value within the field is changed from its previous value.
Contains - The field, previously blank, now holds data.
Custom Condition - Select this option to create a condition using custom code.
Ends With - The field value ends with the same characters you specify within the rule.
Equals - The field value is the same as a value you specify within the rule.
Greater Than -The field value is larger than a value you specify within the rule.
Greater Than Or Equal To - The field value is larger than or equal to a value you specify within the rule.
Less Than - The field value is smaller than a value you specify within the rule.
Less Than Or Equal To - The field value is smaller than or equal to a value you specify within the rule.