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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Validation on sales line sales price is not less then average cost price in x++

(0) ShareShare
ReportReport
Posted on by 207

Hi Experts,

I need to give the validation on the sales line when users enter the sales price less than the average cost price. The message shows them " the sales price is less then Item price."

Thanks in advance.

I have the same question (0)
  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi,

    Would this standard feature do the job?

    organicax.com/.../

    Best regards,

    Ludwig

  • DEEPAKNONU Profile Picture
    207 on at

    Hey Dr.Ludwig, I really appreciate your response and your suggestion . I already use this standard feature but my client need that, If the user gave the less cost then the item average cost price in sales price. Then user cannot proceed for further steps. That's why I need to put validation in X++ as I mention in my question.

  • Gao Lu Wang Profile Picture
    188 on at

    Hi Deepaknonu,

    can you add the validation code in the table salesline's  validateFieldValue method?

  • WillWU Profile Picture
    22,363 on at

    Hi DEEPAKNONU,

    You could try to use form datasource field event "onValidating" to validate the salesprice.

    Go to SalesTable(form)->DS->SalesLine->salePrice->events.

    pastedimage1591335530242v1.png

  • DEEPAKNONU Profile Picture
    207 on at

    Hey Mr. Spike, thanks for your valuable suggestion I solved my issue with put the validation on validate write method on sales line table.

  • DEEPAKNONU Profile Picture
    207 on at

    Hey Mr. Will, thanks for your valuable solution but I'm using 2012 R3 version of AX and also I solved my issue thanks.

  • Kariem El Sayed Profile Picture
    10 on at

    Hey Mr. DeepPanknonu

    How did you solve it as i have similar requirement.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 613

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 455 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 292 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans