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!

how to insert a misc. charges line in sage 300 erp using macros - "Operation not allowed" 1

Status
Not open for further replies.

sarojaramkumar

Technical User
Nov 15, 2015
32
IN

Hello,
I am customizing OE Order Entry screen, with optional fields. I have done successfully posting. But my requirement is to add a misc. charges line automatically during posting.
here is my coding, but it is throwing error. "Operation Not Allowed"

Sage 300 erp 2014
Any help please..... it is urgent..

With adsOEORDD
.Init
.Fields("LINETYPE").Value = 2
.Fields("MISCCHARGE").Value = "HC"
.Fields("EXTINVMISC").Value = "10"
.Fields("USERCOSTMD").Value = "0"
.Fields("STOCKITEM").Value = "0"
.Fields("PRICEOVER").Value = "0"
.Fields("ADDTOILOC").Value = "1"
.Fields("TBASE1").Value = "10"
.Fields("TBASE2").Value = "10"
' .Fields("COPYDETAIL").Value = 1
' .Fields("EXPDATE").Value = "20151115"
.Fields("QTYORDERED").Value = "0"
.Fields("QTYSHIPPED").Value = "0"
.Fields("UNITCONV").Value = "0"
.Fields("UNITPRICE").Value = "0"
.Fields("UNITCOST").Value = "0"
.Fields("TAUTH1").Value = "STATE"
.Fields("TAUTH1").Value = "COUNTY"
.Fields("TCLASS1").Value = "1"
.Fields("TCLASS2").Value = "1"
.Fields("DDTLTYPE").Value = "0"
.Fields("NEXTCMPNUM").Value = "1"
.Fields("PRPRICEBY").Value = "1"
.SetFireEvents False
.Insert
.Process
.SetFireEvents True
End With
 
Also, take out most of those fields. You should only need a line type, a misc charge code, and an amount. And don't turn off .SetFireEvents.
 
Hello tuba2007...

I removed the lines and tried also...
Result... Order Details: Operation not allowed...

Thanks
Sarora
 
Snippet from an old program:

OeOrderDetail2.RecordClear
OeOrderDetail2.RecordGenerate False
OeOrderDetail2.Fields("LINETYPE") = 2
OeOrderDetail2.Fields("MISCCHARGE") = "X"
OeOrderDetail2.Fields("DESC") = "Y"
OeOrderDetail2.Fields("EXTINVMISC") = 1
OeOrderDetail2.Process
OeOrderDetail2.Insert
 

awesome tuba2007
Really a timely help..... Solved... Worked...

adsOEORDD.RecordClear
adsOEORDD.RecordGenerate (False)
With adsOEORDD
.Fields("LINETYPE").Value = 2
.Fields("MISCCHARGE").Value = "HC1"
.Fields("DESC").Value = "HC1"
.Fields("EXTINVMISC").Value = 10
.Process
.Insert
end with


It inserts the MISC. CHARGES 1st and ITEM in the next line.. any idea why?

Thanks
Sarora

 
Dim iLine As Integer
OeOrderDetail2.RecordClear
OeOrderDetail2.GoBottom
iLine = OeOrderDetail2.Fields("LINENUM")
OeOrderDetail2.RecordGenerate False
OeOrderDetail2.Fields("LINENUM") = iline
...
 
Nice Help tuba2007...

Solved...

as the below line was throwing - read only error.. i omitted
OeOrderDetail2.Fields("LINENUM") = iline

Yeah.. Solved... Once again Thanks for Timely help
[bow]

Thanks
Sarora





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top