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)

Alert for near expiry item or a report send through an email

(0) ShareShare
ReportReport
Posted on by 133

I need to generate an alert for those item which are going to expire in the next three months and send it the a person through email.

so is there any way to achieve this target?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mahmoud Hakim Profile Picture
    17,887 on at

    No standard function do that but you can customize it

  • Syed Faizan Ali Profile Picture
    133 on at

    Hi Mahamoud Hakim,

    Thanks for your suggestion,

    Do you know how much customization is required and where it has to be done and if we do the customization can system through the alert of all the inventory items which are going to be expired with in 3 months whether in a report format through an email or an alert???

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    You could write a batch job that does this check, and then it is up to you how you implement the alerting - whether it is AX alerts, e-mail, etc. All possible from code easily, it is about a days' work tops.

    https://community.dynamics.com/ax/b/alirazatechblog/archive/2013/09/22/sending-email-using-x-code-dynamics-ax-2012

    https://community.dynamics.com/ax/b/axaptavsme/archive/2015/04/19/how-to-send-email-through-x-code

    https://community.dynamics.com/ax/b/axaptavsme/archive/2012/11/08/create-alert-using-x-codes

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

    Hi,

    In inventory Management -- > Inquiries --> Batches --> Shelf life at  and many more are there .You can check that once .

    I have checked one form which is attached to inventory Management -- > Inquiries --> Batches

    \Forms\PdsInventBatchBestBefore.

    In this init method.The Date control is taking Default System date.

    So after that it is actually getting range in form init method

    public void addBasicRanges()

    {

       QueryBuildDataSource    queryBuildDataSourceInventBatch     = inventBatch_DS.queryBuildDataSource();

       QueryBuildDataSource    queryBuildDataSourceInventTable     = inventTable_DS.queryBuildDataSource();

       QueryBuildDataSource    queryBuildDataSourceInventSum       = inventSum_DS.queryBuildDataSource();

       criteriaDate       = queryBuildDataSourceInventBatch.addRange(fieldNum(InventBatch, PdsBestBeforeDate));

       criteriaOnHand     = queryBuildDataSourceInventSum.addRange(fieldNum(InventSum,     ClosedQty));

       // by the form, the sum is only joined to the dim, so it should link to the item

       queryBuildDataSourceInventSum.addLink(

           fieldNum(InventBatch, ItemId),

           fieldNum(InventSum, ItemId),

           inventBatch_DS.name());

       criteriaDate.value(strFmt('((%1) && (%1 <= %2))',

               fieldStr(InventBatch, PdsBestBeforeDate),

               date2StrXpp(ctrlDate.dateValue())));

       criteriaOnHand.value(queryValue(NoYes::No));

    }

    Here it is taking System date.

    You can change your date like 3 months like that.and check.

    This might give you a clue.

    Check those forms and you can write logic according to that and run batch job.

    Send alert.

    For email sending code

    You can refer link

    http://www.microsoftdynamicsax365.com/?s=email

    Regards.

    Have a great day.

  • Syed Faizan Ali Profile Picture
    133 on at

    Thanks a lot for providing the suggestions..

  • Syed Faizan Ali Profile Picture
    133 on at

    Hi Vilmos Kintera,

    Thanks a lot for providing the solution.

  • guk1964 Profile Picture
    10,888 on at

    Is this"

    • a shelf life expiry? if so there are standard reports -  
    • or a phase out of an item?  in which case you might assign an inventory status to it -what determines the date? IS it stored anywhere?
    • Why does the person who gets the email need to know ie what action is to be taken?
  • Syed Faizan Ali Profile Picture
    133 on at

    Hi Magic,

    1) Yes we have the Shelf life expiry report but we need to find out those items which are going to be expired with in 3 or 6 Months.

    2) Kindly elaborate the Point # 2.

    3) Before the items are expired we need to sale it out ASAP that's why

    we should know.

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