Sales order Cost Price

dileepvarmav
Member Posts: 11
Hi all,
1)I am creating a sales order through code successfully, but unable to fill
the costprice for the respective sales Items. How to specify cost price
through code?
2) I am updating the sales order with status Invoice, Can i specify my own
invoice number and update a sales order. if so where and how to assign the
number as invoice number for a sales order.
Please help me out in resolving the above problems
Best regards,
dileep.
1)I am creating a sales order through code successfully, but unable to fill
the costprice for the respective sales Items. How to specify cost price
through code?
2) I am updating the sales order with status Invoice, Can i specify my own
invoice number and update a sales order. if so where and how to assign the
number as invoice number for a sales order.
Please help me out in resolving the above problems
Best regards,
dileep.
0
Comments
-
<EDIT> I did edit didn't notice it was for Ax and replied.Kapil Khanna0
-
Hello kapil,
I am sorry to say, i dint understood your above reply .
I am using Dynamics Ax 2009. i need help regarding the above two queries.
Regards
Dileep0 -
Hi,
for the first query u can write this code and update the sales price with costprice.
SalesLine.SalesPrice = decround(InventSum::find(SalesLine.ItemId,SalesLine.InventDimId).costPricePcs(),2);
for the second query i need some clarification.
how u are updating invoice and which tables u are updating?Kranthi0 -
Hello Kranthi,
Thanks for your reply.
I need to create a sales order line through code and wanted to fill CostPrice field of Sales Line.
I have used the below line
SalesLine.CostPrice = InventSum::find(SalesLine.ItemId,SalesLine.InventDimId).costPricePcs();
and found there is some difference in Sales line cost price between manual creation and the Through code. I will try to explore this furthur
Regarding my second query..
I am using AxsalesTable to create a sales order and SalesFormLetter class to update the Order to the status invoice.
Invoice number is assigned by the system. I want to replace the Invocie number with my custom number through code.
Regards
Dileep.0 -
Hi,
Actually the invoice number is generated by sytem.
u can override the system generated number with u r customer reference number.
In SalesFormLetter_Invoice class in the (initJournal) method the system will assign the
generated sequence, there u can override the code and assign the number what ever u want.
I think it would help u.Kranthi0 -
HI,
Go through the class SalesFormLetter_Invoice (initJournal - method)Kranthi0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions