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)

Validation on Report as finished Journal

(0) ShareShare
ReportReport
Posted on by 2,426

Good Morning,

I need to validate RAF Journal at the time of validate.

1.i have added one field 

The validation is if that field is not filled then at the time of validate the system should check and throw error that the particular field is not filled.

I have placed code in Class ProdJournalCheckPostProd.CheckTrans()

it works fine. when i click validate from RAF Journal.

But when i change status for Production Order from Released to Created.

The system will create New RAF Journal and Automatically will post that New RAF Journal.

Here my error comes.Because the field is not filled manually.

It is posted by system Automatically when Status of production order is reset.

The validation should not trigger when i change Status..

How can i achieve this.

Please have some light on this.

Regards.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    You can add another condition in your validation, like

    If(!table.fieldId && table.Status == Status::One)

    With this you can avoid throw the error when you are changing the status

  • AX 2012 r3 Profile Picture
    2,426 on at

    Heloo Tatiana,

    Very good to see your reply.

    Hope you are fine.

    The condition that you mentioned.

    The status we cannot fix because RAF can be created and validated at any status.

    and Coming to field id.The field is coming.

    Please suggest.

    Regards.

    Have a great day Tatiana.

  • Community Member Profile Picture
    on at

    So you need to validate your field when ??

  • AX 2012 r3 Profile Picture
    2,426 on at

    Hi Tatiana,

    1.When we create A new RAF For Production Order and when you validate Our code will execute and checks whether the field is filled or not.

    If not filled it will throw error.

    2.IF you filled the field and posted that RAF.

    3.Now if you want to reset status of production order.

    The system is calling same class and creating new RAF Journal and Posting.

    At the time of posting it is validating our code.

    So,Obviously for the new RAF Journal our field will be empty.

    Then system throws error.

    There might be something to identify That it is reversing.

    i think of Qty ..

    it can be minus.

    But not sure.

    I need that Identification.

    Please provide some light.

    Regards.

    Have a great day.

  • Community Member Profile Picture
    on at

    Well, you can create a new field (checkbox) in the table, and update this field when is reversing, if you can find some other field that you can use to indicate that is a new journal, create your own logic.

    Im not familiar with the production order, but that is something you can do, use the -qty that is a good idea as well.

  • AX 2012 r3 Profile Picture
    2,426 on at

    i stuck in a place to identify when is reversing.

    Thats why if we add new field.

    It will call same class and and again same field will get updated.

    I am searching for that condition.

  • AX 2012 r3 Profile Picture
    2,426 on at

    No Problem Tatiana.

    Will wait for more experts reply.

    Thanks for your reply.

  • Verified answer
    AX 2012 r3 Profile Picture
    2,426 on at

    I have founded one field InventreturnFlag on prodjournaltable.

    on this i have placed.if it is true then validation will not work

    means if we return status this Field gets flag yes.

    This might help some one in future.

    Regards.

    Have a great day.

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