Hi everyone.
I create a method that get the last value of a table. But the order by desc is not working. I put the code and explain in detail
In this example. I get a value (and it should be the last, but its the first ever) The “order by” clause its not working.
public int getLastPhaseCode()
{
PXResult<CEPhaseCodes> res =
SelectFrom<CEPhaseCodes>.OrderBy<CEPhaseCodes.phaseCode.Desc>.View.
Select(this).FirstOrDefault();
CEPhaseCodes p = (CEPhaseCodes)res;
return (p != null) ? Convert.ToInt32(p.PhaseCode) : 0;
}
Aditional.
CEPhaseCodes is my DAC/Table
Can you help me please!
Best answer by Naveen Boga
View original