Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sage 300 ERP order entry customization not adding shipment charges

Status
Not open for further replies.

sarojaramkumar

Technical User
Nov 15, 2015
32
IN
Hello, i am using the below code, It is working find with my system windows 7, sql express..
but not adding the shipment charges in server environment..

i am checking the same MISC.CHARGES ALREADY EXISTS. if the same misc.charges code is not available, then i am adding the line.

could anybody help please?

'----------------------------------------------------
Dim SFILTER5 As String
Dim Count As Integer
Count = 0
SFILTER5 = ""
SFILTER5 = "ORDUNIQ =" & """" & dsOEORDH.Fields("ORDUNIQ").Value & """" & ""
adsOEORDD.Browse SFILTER5, True

Do While adsOEORDD.Fetch
Dim i As Integer
If dsOEORDD.Fields("LINETYPE").Value = 2 And dsOEORDD.Fields("MISCCHARGE").Value = "SHIPNG" Then
Count = Count + 1
Else
'-----------
End If
Loop

MsgBox ("checked for MISC.CHARGES count SHIPNG, " & Count)

If Count = 0 Then
Dim iLINE As Integer
adsOEORDD.RecordClear
adsOEORDD.GoBottom
iLINE = adsOEORDD.Fields("LINENUM")
adsOEORDD.RecordGenerate (False)

With adsOEORDD
.Fields("LINETYPE").Value = 2
.Fields("MISCCHARGE").Value = "SHIPNG"
.Fields("DESC").Value = "SHIPPING CHARGES"
.Fields("EXTINVMISC").Value = 0
.Process
.Insert
End With

End If
'--------------------------------------------------

Thanks
Sarora
 
thanks for response..
if my filter condition fails, as per the coding, count will be 0, if count is 0 the code should enter into the loop.
the same is working in windows 7 my development environment. But the same is not working in the server environment..

Thanks
Ramkumar R
 
Then your environments aren't set up the same. It's sloppy code, anyway. I would do it like:

adsOeordd.cancel
adsOeordd.browse sfilter5, True
If not adsOeordd.fetch then
... (Add the line)
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top