web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Sales type of sales order created using SalesSalesOrderService.Create getting reset to "Journal"

(0) ShareShare
ReportReport
Posted on by 1,244

Hi,

I am using SalesSalesOrderService to create sales orders in AX 2012 R3.

salesTable.SalesType = AxdEnum_SalesType.Sales;
salesLine.SalesType = AxdEnum_SalesType.Sales;


I am not sure why the sales orders are getting created with SalesType as Journal.

Your help is highly appreciated!

Regards,

Abhinay

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    239,118 Most Valuable Professional on at

    Do you want to always use a different type or do you want to set various types in code?

    If the former, go to Accounts receivable > Setup > Parameters > AIF and configure the default type there.

  • Abhinay Tharwal Profile Picture
    1,244 on at

    Thank you for your suggestion Martin.

    [quote user="Martin Dráb"]If the former, go to Accounts receivable > Setup > Parameters > AIF and configure the default type there.[/quote]

    The default value is already set to "Sales order": Sales-order-type-_2D00_-default-setting.jpg

    [quote user="Martin Dráb"]Do you want to always use a different type or do you want to set various types in code?[/quote]

    I would prefer the control in my code.

  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    Hi Abhinay Tharwal,

    If there is an order with same CustAccount and PurchOrderFormNum values, new order would be created with type =  Journal, so please check existing orders in AX and use different PurchOrderFormNum value. Or you can customize SO service class in AX to change this logic. 

  • Martin Dráb Profile Picture
    239,118 Most Valuable Professional on at

    Then I would debug the document class to see how where the different values comes from.

  • Abhinay Tharwal Profile Picture
    1,244 on at

    [quote user="ievgen Miroshnikov"]If there is an order with same CustAccount and PurchOrderFormNum values, new order would be created with type =  Journal[/quote]

    Thank you ievgen!

    That is not the case as, I am creating new sales orders and a new sales id is generated every time.

  • Verified answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Hi Abhinay Tharwal!

    Just to add to ievgen suggestion.

    Check this link dynamicsuser.net/.../aif-sales-order-create---salestype-being-set-to-journal

  • Mea_ Profile Picture
    60,286 on at

    If you used same value for PurchOrderFormNum for same customer once each new order would have journal type. I do not understand how new I'd proofs that PurchOrderFormNum value is not used in another order.

  • Abhinay Tharwal Profile Picture
    1,244 on at

    [quote user="ievgen Miroshnikov"]If you used same value for PurchOrderFormNum for same customer once each new order would have journal type. I do not understand how new I'd proofs that PurchOrderFormNum value is not used in another order.[/quote]

    Because I have ensured in the code that the Sales IDs getting created do not exist in the system with the same PurchOrderFormNum.

  • Mea_ Profile Picture
    60,286 on at

    You marked Rustem's answer as verified, so I assume you commented out code I was talking about. Instead of changing standard code you need to work on your data and just pass unique PurchOrderFormNum  each time. 

  • Rustem Galiamov Profile Picture
    8,072 on at

    I'm agree with ievgen. I just added suggestion for you for your understanding how it's works, not for suggest you to change standard code.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Basit Profile Picture

Basit 1

#1
GL-01081504-0 Profile Picture

GL-01081504-0 1

#1
Roya Profile Picture

Roya 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans