C# code for Sort By

C# is case sensitive, google LINQ Order By  there is a ton of documentation out there..


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Mon, Aug 22, 2016 at 12:51 PM, mvissuet@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p></p><p><span></span></p><p>I am writing a BPM that looks for the next open operation on the job...</p><p><br></p><p>the BPM reads something like this:</p><p><br></p><p>    JobOper = (from JobOper_Row in Db.JobOper<br>               where JobOper_Row.Company == Session.CompanyID &amp;&amp;<br>               string.Compare(JobOper_Row. JobNum, ttJobOperRow.JobNum, true) == 0 &amp;&amp;<br>               JobOper_Row.OprSeq &gt; ttJobOperRow.OprSeq<br>               OrderBy JobOper.OprSeq<br>               select JobOper_Row).FirstOrDefault();</p><p><br></p><p><br></p><p>That is the code I got from Epicor&#39;s ABL code convertor... however, the &quot;OrderBy&quot; line does not compile.</p><p>What is the correct syntax for sorting records?</p><p></p>

</div>
 


<div style="color:#fff;min-height:0;"></div>

I am writing a BPM that looks for the next open operation on the job...


the BPM reads something like this:


    JobOper = (from JobOper_Row in Db.JobOper
               where JobOper_Row.Company == Session.CompanyID &&
               string.Compare(JobOper_Row.JobNum, ttJobOperRow.JobNum, true) == 0 &&
               JobOper_Row.OprSeq > ttJobOperRow.OprSeq
               OrderBy JobOper.OprSeq
               select JobOper_Row).FirstOrDefault();



That is the code I got from Epicor's ABL code convertor... however, the "OrderBy" line does not compile.

What is the correct syntax for sorting records?

Try without the OrderBy line, maybe the PRIMARY index will work for you.

 

Patrick Winter

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Monday, August 22, 2016 11:52
To: vantage@yahoogroups.com
Subject: [Vantage] C# code for Sort By

 

 

I am writing a BPM that looks for the next open operation on the job...

 

the BPM reads something like this:

 

    JobOper = (from JobOper_Row in Db.JobOper
               where JobOper_Row.Company == Session.CompanyID &&
               string.Compare(JobOper_Row.JobNum, ttJobOperRow.JobNum, true) == 0 &&
               JobOper_Row.OprSeq > ttJobOperRow.OprSeq
               OrderBy JobOper.OprSeq
               select JobOper_Row).FirstOrDefault();

 

 

That is the code I got from Epicor's ABL co de convertor... however, the "OrderBy" line does not compile.

What is the correct syntax for sorting records?

This e-mail and any attachments may contain confidential and privileged information. If you are not the intended and/or named recipient or recipients, please notify the sender immediately by return e-mail, delete this e-mail and destroy any copies. Any dissemination or use of this information by a person other than the intended recipient or recipients is unauthorized and may be illegal. Any views or opinions expressed in this email are those of the author and do not necessarily represent those of the Specialty Screw Corporation. Warning: Although precautions have been taken to make sure no viruses are present in this email, Specialty Screw Corporation cannot accept responsibility for any loss or damage that may arise from the use of this email or attachments.
This e-mail and any attachments may contain confidential and privileged information. If you are not the intended and/or named recipient or recipients, please notify the sender immediately by return e-mail, delete this e-mail and destroy any copies. Any dissemination or use of this information by a person other than the intended recipient or recipients is unauthorized and may be illegal. Any views or opinions expressed in this email are those of the author and do not necessarily represent those of the Specialty Screw Corporation. Warning: Although precautions have been taken to make sure no viruses are present in this email, Specialty Screw Corporation cannot accept responsibility for any loss or damage that may arise from the use of this email or attachments.   ­­  

I figured it out...


the line should have been:


orderby JobOper_Row.OprSeq ascending


and not


OrderBy JobOper.OprSeq

C# is case sensitive…  orderby

 

 

Rob Bucek

Production Control Manager

D&S Manufacturing

301 E. Main St.

Black River Falls, WI 54615

715-284-5376 Ext. 311

Mobile: 715-896-3119

rbucek@...

Visit our newly redesigned Website at www.dsmfg.com

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Monday, August 22, 2016 12:07 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] C# code for Sort By

 

 

Try without the OrderBy line, maybe the PRIMARY index will work for you.

 

Patrick Winter

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Monday, August 22, 2016 11:52
To: vantage@yahoogroups.com
Subject: [Vantage] C# code for Sort By

 

 

I am writing a BPM that looks for the next open operation on the job...

 

the BPM reads something like this:

 

    JobOper = (from JobOper_Row in Db.JobOper
               where JobOper_Row.Company == Session.CompanyID &&
               string.Compare(JobOper_Row.JobNum, ttJobOperRow.JobNum, true) == 0 &&
               JobOper_Row.OprSeq > ttJobOperRow.OprSeq
               OrderBy JobOper.OprSeq
               select JobOper_Row).FirstOrDefault();

 

 

That is the code I got from Epicor's ABL co de convertor... however, the "OrderBy" line does not compile.

What is the correct syntax for sorting records?

This e-mail and any attachments may contain confidential and privileged information. If you are not the intended and/or named recipient or recipients, please notify the sender immediately by return e-mail, delete this e-mail and destroy any copies. Any dissemination or use of this information by a person other than the intended recipient or recipients is unauthorized and may be illegal. Any views or opinions expressed in this email are those of the author and do not necessarily represent those of the Specialty Screw Corporation. Warning: Although precautions have been taken to make sure no viruses are present in this email, Specialty Screw Corporation cannot accept responsibility for any loss or damage that may arise from the use of this email or attachments.
This e-mail and any attachments may contain confidential and privileged information. If you are not the intended and/or named recipient or recipients, please notify the sender immediately by return e-mail, delete this e-mail and destroy any copies. Any dissemination or use of this information by a person other than the intended recipient or recipients is unauthorized and may be illegal. Any views or opinions expressed in this email are those of the author and do not necessarily represent those of the Specialty Screw Corporation. Warning: Although precautions have been taken to make sure no viruses are present in this email, Specialty Screw Corporation cannot accept responsibility for any loss or damage that may arise from the use of this email or attachments.   Â­Â­