billyx
(Billy Xiong)
September 13, 2017, 4:46pm
1
Whenever a new supplier is created, I’d like to have the “Payment Method” field default to “Check.”
I’ve been unsuccessful with the customization of getting the field to display “Check.” What I have so far is below, but doesn’t work.
Any help or suggestions would be appreciated.
Thanks in advance.
Billy
private void edvVendorDetail_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
// ** Argument Properties and Uses **
// view.dataView[args.Row]["FieldName"]
// args.Row, args.Column, args.Sender, args.NotifyType
// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
if ((args.NotifyType == EpiTransaction.NotifyType.AddRow))
{
if ((args.Row > -1))
{
view.dataView[args.Row]["PMUID"]="5";
MessageBox.Show ("Test");
}
}
}
The code doesn’t change the field to “Check,” but rathers just stays “Non-Selected”
bmgarver
(Brian Garver)
September 13, 2017, 6:19pm
2
I did something similar with Order Entry to set the UseOTS to true when the CustomerCustID is changed. Could use the same logic on the VenderID field…
private void OrderHed_AfterFieldChange(object sender, DataColumnChangeEventArgs args)
{
// ** Argument Properties and Uses **
// args.Row["FieldName"]
// args.Column, args.ProposedValue, args.Row
// Add Event Handler Code
switch (args.Column.ColumnName)
{
case "CustomerCustID":
EpiDataView edvOrderHed = (EpiDataView)oTrans.EpiDataViews["OrderHed"];
edvOrderHed.dataView[edvOrderHed.Row]["UseOTS"] = true;
oTrans.NotifyAll();
break;
}
}
1 Like
nhutchins
(Norman Hutchins)
September 13, 2017, 6:29pm
3
I know your question was about a screen customization but, you could do it with a Data BPM, anytime a record is added to the Vendor table make Vendor.PMUID = 5?
Thanks,
Norman Hutchins
System Administrator
Howell Laboratories, Inc.
3 Likes
mehar
(meharban)
April 5, 2022, 11:36am
4
Use below code
Ice.Core.Session session = ((Ice.Core.Session)this.oTrans.Session);
plntCmb.FillList();
plntCmb.Value = session.PlantID;
Dragos
(Dragos Ene)
April 5, 2022, 3:46pm
5
All you need for this is a simple BPM on GetNewVendor:
Replace 9 with whatever your ID is.