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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Code in ValidateWrite method is not being fired

(0) ShareShare
ReportReport
Posted on by 35

The PriceDiscAdmTable creates the journal number in the insert and validateWrite methods. This table has been modified on the ISV and SYS layer but these 2 methods have not been modified on the ISV layer. When creating a new Price/Discount agreement journal, we are receiving the message "Field 'Price/discount journal number' must be filled in". If I put break points in the code in these 2 methods, the code does not break and I just receive the validation error message. The form does not have any code on the datasource in either the Write or the ValidateWrite methods. I initially thought this was a problem with the number sequence, but I can generate the next journal number in a job without a problem. I can change the mandatory property of the journal number field to 'No' and the code breaks at my breakpoint in the insert method and creates the journal number correctly. If I reset the mandatory property to 'Yes' and add a new method so the object is modified on a higher layer than ISV, the code will stop at my breakpoint in the validateWrite method and trigger correctly. This issue happens in all companies for this customer, in 3 different environments. Our internal environment with the same ISV layer does not have this issue. It happens for all users but just started as the customer has been able to create these journals without a problem in all of the environments. I have refreshed all the caches, recompiled, and re-generated the CIL but nothing has resolved the issue other than modifying the object on a higher layer. Any suggestions on additional resolutions would be greatly appreciated.

*This post is locked for comments

I have the same question (0)
  • Ashraf Sharaf Profile Picture
    50 on at

    Hi,

    I'm getting the same issue and can add any new line to an existing journal.

    Have you found any resolution for that?

    Thanks,

  • Douglas Noel Profile Picture
    3,905 on at

    Hi all,

    I've seen similar issues so many times. It seems that AX does not have a reliable 100% 'force compile'. There seems to be some logic, which skip the compile because AX thinks - whyever - there is no compile neccessary. This 'feature' started with Axapta2.5 already.

    We use a 'DirtyMaker' to do a force compile on a AOT Project.

    using a empty usp layer (model) which adds a space or comment // I am dirty

    which 'moves the objects/sub object' to usp layer.

    Then a compile leads to the desired results in all cases.

    After that we remove the 'dirty helper model' and compile again.

    Haven't seen any other working solution beside this 'make me dirty and help my internal logic' in some cases. (Tons of compiles / recompiles / cache clears / cil delete will not help you if you have such an special case)

    The problem is that you are not able to reproduce such a situation with intent, which maybe can help the kernel guys to fix this.

    So the 'Modification in a higher layer' will solve these problems. You can even remove the modification afterwards.

    regards

    Douglas

  • Suggested answer
    Chittibabu Profile Picture
    5 on at

    Grt! It works

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans