I’m trying to auto assign a field ID, I’ve created a “User Defined Code”, Post-Processsing “AutoAssign” BPM, and now I’m trying to create a Pre-Processing BPM that runs the following C# code.
/AutoAssign F-011ID/
Ice.Tables.UDCodes UDCodes = null;
foreach (var MyUD15 in (from ThisUD15 in ttUD15 where
ThisUD15.RowMod == IceRow.ROWSTATE_ADDED &&
ThisUD15.key1 == “AutoAssign”
select ThisUD15))
{
using (var txScope = IceContext.CreateDefaultTransactionScope())
{ foreach(var MYUDCodes in (from ThisUDCodes in Db.UDCodes.With(LockHint.UpdLock) where
ThisUDCodes.Company == Session.CompanyID &&
ThisUDCodes.CodeTypeID == “F011” &&
ThisUDCodes.CodeID == “1”
select ThisUDCodes))
{
int Nextkey1;
int.TryParse(MYUDCodes.CodeDesc,out Nextkey1); Nextkey1 += 1;
MYUDCodes.CodeDesc = Nextkey1.ToString();
}
Db.Validate();
txScope.Complete();
}
}
/end of BPM/
I’m getting the following error.
'UD15Row' does not contain a definition for 'key1' and no accessible extension method 'key1' accepting a first argument of type 'UD15Row' could be found (are you missing a using directive or an assembly reference?)
as @Chris_Conn already pointed out… C# is very case sensitive… if you are coming from the Epicor 9 world where you worked in Progress/ABL Code, you never had this problem. Progress didn’t care about the case of a variable name… Key1, key1, KEY1, keY1 all were the same thing.
Also note… when you are typing into your C#, you can have it automatically give you a list of potential options… Example, if you typed “ThisUD15.” and then press Space, you will get a mini window with the possible variable names. This helps in choosing the correct spelling and case.
Hi I got this below error while adding event on checkbox any help?
‘Script’ does not contain a definition for ‘chkaudit_CheckedChanged’ and no extension method ‘chkaudit_CheckedChanged’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
It sounds like you are trying to assign an event handler (chkaudit_CheckedChanged) to an event (presumably chkaudit.CheckedChanged = chkaudit_CheckedChanged;)
you must write the event handler
void chkaudit_CheckedChanged(object Sender, EventArgs args)
{
//your code
}
Also can you help me in one more thing?
I am working on a project that our former developer worked on. He uses form customization window to call BPM with serachoptions as shown in picture below on left.
So I just need simple thing to do is to return a string with yes or no from BPM execute custom code and read that string here in form customization code(on left side in image) after the BPM is called. I am new to epicor so that is why not understanding how he is calling with SearchOptions.