Monday, 25 November 2013

Create slaesline without item id:


Create slaesline without item id:
I am sure that there is a work around for this because when i am commenting the itemId and the salescategory the error will be : Item or category must be specified.

but when i want to add a salesaline with only sales categroy it will give me that "item ID must be specified". However ItemId can be nullable because on the AX Client i can create a salesline without an item.


As discussed in a parallel thread, sales lines without item IDs are supported from GUI, but there is an explicit validation in AxdSalesOrder.checkSalesLine():
if (!_axSalesLine.salesLine().RecId && !axSalesLine.parmItemId)
{
    error("@SYS300755"); // Item ID must be specified.
}

Comment this 4 lines of codes however i am still unable to create this salesorder then do this :

Ensure yourself that your changes have been compiled to CIL - if they're in X++ only, services won't see them.
If it doesn't help, then use the debugger to see what exactly is happening. Open Application Explorer in Visual Studio, add a breakpoint somewhere (e.g. toInfo.add()), attach the debugger to the AOS process and execute the service call.



No comments:

Post a Comment