SQL Order By in GetRows

customization

(Chris Simpson) #1

Hello all,

I am writing a customization in Job Tracker in Epicor 9. Below, I am getting all materials that exist on the current job.

JobMtlSearchString = "JobNum = '" & adapterJobEntryDataSet.Tables("JobHead").Rows(LoopCounter3)("JobNum").ToString() & "'"JobMtlSearchString = "JobNum = '" & adapterJobEntryDataSet.Tables("JobHead").Rows(LoopCounter3)("JobNum").ToString() & "'"

adapterJobMtlDataSet = adapterJobMtl.GetRows(JobMtlSearchString, 0, 0, False)

It works. However, I would like to order by the part number. As it is right now, I believe it is ordering by assembly seq and then by material seq.
I was thinking that since I am actually building a SQL query and then passing it to adapterJobMtl.GetRows that I could do something such as:

JobMtlSearchString = "JobNum = '" & adapterJobEntryDataSet.Tables("JobHead").Rows(LoopCounter3)("JobNum").ToString() & "'"JobMtlSearchString = "JobNum = '" & adapterJobEntryDataSet.Tables("JobHead").Rows(LoopCounter3)("JobNum").ToString() & "'" & " order by PartNum" but GetRows does not seem to support it.

Any thoughts?

Thanks,
Chris


(Jason Woods) #2

Don’t use the “order” text.
Just use
by PartNum