-
Notifications
You must be signed in to change notification settings - Fork 0
/
INUnitMaint.cs
33 lines (26 loc) · 970 Bytes
/
INUnitMaint.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using PLNSC;
using PX.Data;
namespace PX.Objects.IN
{
public class INUnitMaint_Extension : PXGraphExtension<INUnitMaint>
{
#region Event Handlers
protected void INUnit_RowPersisting(PXCache sender, PXRowPersistingEventArgs e)
{
var row = (INUnit)e.Row;
var strFromUnit = row.FromUnit.ToString().Trim();
var strToUnit = row.ToUnit.ToString().Trim();
int valueFromUnit = strFromUnit.Length;
int valueToUnit = strToUnit.Length;
if (valueFromUnit > 4)
{
sender.RaiseExceptionHandling<INUnit.fromUnit>(e.Row, row.FromUnit, new PXSetPropertyException(CustomMessage.MoreThanFourChar));
}
if (valueToUnit > 4)
{
sender.RaiseExceptionHandling<INUnit.toUnit>(e.Row, row.ToUnit, new PXSetPropertyException(CustomMessage.MoreThanFourChar));
}
}
#endregion
}
}