Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Error On Posting Sales Order

(2) ShareShare
ReportReport
Posted on by 18
I am trying to post sales order through API. I am already creating a customer through API and when I am associating that created customer in the sales order post body 
I am getting this error code: 'Application_FieldValidationException', message: 'D394 Partner type. must not be in Customer: No.=CI00088 CorrelationId: 26f438d2-a6ab-4a77-9af0-a068d2437dba.'.
 
While Creating customer I am not passing any partner type, Hence how may I getting this error ? Also what is this error ?

 
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 6,173 Moderator on at
    Error On Posting Sales Order
    Agree with the previous response, The error indicates that the Partner Type field on the customer record must be set to a valid value ("Person" or "Company"). Try to create manually sales order and check.
  • KasparsSemjonovs Profile Picture
    KasparsSemjonovs 4,011 Super User 2024 Season 2 on at
    Error On Posting Sales Order
    Well the error states tat the Partner Type cannot be empty. In customer card this field can have 3 options - empty, person or Company. 

    I assume there is another modification on your system, that is blocking this. 
    Have You tried to create manually a sales order for such customer, where Partner Type = Empty ? I would guess that You would receive the same error, that Partner Type cannot be empty.
  • ST-01080727-0 Profile Picture
    ST-01080727-0 18 on at
    Error On Posting Sales Order
    I have successfully created the customer and the response I am getting is this 

    {
    '@odata.context': 'https://api.businesscentral.dynamics.com/v2.0/3d32adac-7e5f-408d-9a7c-58ceceab2992/Production/api/v2.0/$metadata#companies(b1f1d8e7-0569-ee11-8def-6045bd92d4b1)/customers/$entity',
    '@odata.etag': 'W/"JzE5OzEwMDgyODYyMjQyODI3OTU1NzcxOzAwOyc="',
    id: 'XXXYYYZZZ',
    number: 'XXXYYYYZZZZ',
    displayName: 'Skriware',
    type: 'Company',
    addressLine1: '',
    addressLine2: '',
    city: '',
    state: '',
    country: '',
    postalCode: '',
    phoneNumber: 'XXXYYYZZZZ',
    email: '',
    website: '',
    salespersonCode: '',
    balanceDue: 0,
    creditLimit: 0,
    taxLiable: false,
    taxAreaId: '00000000-0000-0000-0000-000000000000',
    taxAreaDisplayName: '',
    taxRegistrationNumber: '',
    currencyId: 'XXXXYYYYZZZZZ',
    currencyCode: 'CAD',
    paymentTermsId: 'XXXXYYYYYZZZZZ',
    shipmentMethodId: '00000000-0000-0000-0000-000000000000',
    paymentMethodId: '00000000-0000-0000-0000-000000000000',
    blocked: '_x0020_',
    lastModifiedDateTime: '2024-07-31T13:09:35.937Z'
    }

    But when I am trying to associate this customer in the sales post body 
    {

    customerId: 'XXXYYYZZZZ',
    currencyCode: 'EUR',
    orderDate: '2024-07-31',
    postingDate: '2024-07-31',
    salesOrderLines: [
    {
    itemId: '0defc956-d7f8-ee11-a1ff-000d3a48a433',
    lineType: 'Item',
    lineObjectNumber: 'B.112',
    description: 'Fable Explore 2.5 Educational Robot',
    quantity: '1.00',
    unitPrice: '637.00',
    discountPercent: '0.00'
    },
    {
    itemId: '0eefc956-d7f8-ee11-a1ff-000d3a48a433',
    lineType: 'Item',
    lineObjectNumber: 'B.113',
    description: 'Fable Go 2.5 Educational Robot',
    quantity: '1.00',
    unitPrice: '637.00',
    discountPercent: '0.00'
    }
    ]
    }

    I am getting this error 

    error: {
    code: 'Application_FieldValidationException',
    message: 'D394 Partner type. must not be in Customer: No.=CI00088 CorrelationId: 26f438d2-a6ab-4a77-9af0-a068d2437dba.'
    }

    We are simply creating a customer without adding any partner type and then using that customer in our sales order 
    What is this error D394 Partner Type ? and how it is connected to customer ?


     
  • Mohana Yadav Profile Picture
    Mohana Yadav 60,054 Super User 2024 Season 2 on at
    Error On Posting Sales Order
    Can you create a SO and post manually using the customer created via API?
    Looks like there is a customization which is expecting some value except blank in partner type field.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans