C# Syntax Errors CS1003 and CS1026

612 Views Asked by At

I have the following code for a BPM (Business Process Management) Workflow Designer in Pre-processing for Epicor ERP System.

using Ice.Memo;
foreach (var ttJobHead_xRow in (from ttJobHead_Row in ttJobHead where 
ttJobHead_Row.RowMod == IceRow.ROWSTATE_UPDATED select ttJobHead_Row))
{
     var Memo_Row = (from IM in Db.Ice.Memo where IM.Key1 == ttJobHead_xRow.PartNum select IM);
     if (Memo_Row != null)
     {
        callContextBpmData.ShortChar04 = ttJobHead_xRow.MemoText.ToString();
        callContextBpmData.ShortChar05 = ttJobHead_xRow.MemoDesc.ToString();
     }
}

The goal of this code is to have a condition based on when a row in the table, JobHead, has been updated. And then to in a sense tie together two tables (ttJobHead and Memo). And later in the if statement, assign a shortchar to certain fields for later input into an email.

When compiling I am getting the following two errors:

Error CS1003: Syntax error, '(' expected [Update.Pre.New_Job_with_Par.cs(86,19)]

Error CS1026: ) expected [Update.Pre.New_Job_with_Par.cs(86,27)]

Whats going wrong? Also, is there a better way to accomplish this?

1

There are 1 best solutions below

0
On

Assuming you're using Epicor 10 and creating an action for JobEntry.Update.

You can't have the using statement directly in the BPM, I'm pretty sure that's your issue, you need to add by clicking the "Usings & References" on the "Enter Custom Code" form.

My guess is that it's wanting a using statement, not directive, and this needs parens.

using(MyDisposable d = new MyDisposable())
{
    ...
}

Having said that, if you go to your server, you should be able to see your BPM source code (e.g. c:\inetpub\wwwroot\E10_Test\Server\BPM\Sources\BO\JobEntry.Update). This will help you in debugging because the line numbers line up with this source code.