Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Vendor tax registration number table "TaxRegistration" not able to fetch expired records

Posted on by 148

Hi Friends,

AX version: AX 2012 R3; Table Name: TaxRegistration

In vendor master i am not able to fetch the expired tax registration number.

For eg. If there are three records in TaxRegistration table with

1. ValidTo: 1 Oct 2011

2. VAlidto: 1 Oct 2020

3. ValidTo: 1 Oct 2013

if i run while loop on this table to fetch all records WITHOUT any conditions. It wil show only one record which is grater than today. i.e. Oct 2020.

Any idea....

*This post is locked for comments

  • Deepak Agarwal Profile Picture
    Deepak Agarwal 148 on at
    RE: Vendor tax registration number table "TaxRegistration" not able to fetch expired records

    Andre:

    I used validTimeState keyword in my query and its working fins for me.

    I also try to check the impact of table property. I think this property maintain the record validation , i mean one record should be active a a time for one (vendor + tax type).

  • Deepak Agarwal Profile Picture
    Deepak Agarwal 148 on at
    RE: Vendor tax registration number table "TaxRegistration" not able to fetch expired records

    Thanks guys for sharing your thoughts.

    Maciej:

    Yes i already try this and its working fine for me.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,280 Super User 2024 Season 2 on at
    RE: Vendor tax registration number table "TaxRegistration" not able to fetch expired records

    Hi Deepak,

    Please read this article and related topics: msdn.microsoft.com/.../gg861781.aspx

    Business impact is that probably some actions in AX will retrieve multiple records and will process the same action multiple times. Or the first record is taken assuming it is the correct valid record.

    Changing the property value oof this table can cause issues!

    Can you indicate how you did fetch the data now? Probably you have to add a statement to retrieve all records or use another fetch method.

  • Suggested answer
    Maciej Obojski Profile Picture
    Maciej Obojski 610 on at
    RE: Vendor tax registration number table "TaxRegistration" not able to fetch expired records

    Hi Deepak,

    I would strongly advise you NOT to disable this property on standard tables.

    Please spend a little time reading through MSDN article Valid Time State Tables and Date Effective Data [AX 2012]

    Hopefully this will allow you to understand consequences. You can find code examples in the link provided, but all you have to do is to use validTimeState keyword. This is built-in function which can accept 1 or 2 parameters.

    If you want to read all records, use following query:

    date d1 = dateNull(), d2 = dateMax();
    while select validTimeState(d1, d2) TaxRegistration
    {
    ....
    }


    I would also highly recommend reading excellent blog posts by Joris de Gruyter :

    http://daxmusings.codecrib.com/2011/10/valid-time-statedate-effective.html

    http://daxmusings.codecrib.com/2011/10/valid-time-statedate-effective_05.html

    Thanks,

    Maciej

  • Suggested answer
    Deepak Agarwal Profile Picture
    Deepak Agarwal 148 on at
    RE: Vendor tax registration number table "TaxRegistration" not able to fetch expired records

    Good news, i got found the reason.

    There is table property "ValidTImeStateFieldType", you need to make it 'None'.

    Now you will be able to fetch all records from this table.

    But still i am not sure about business impact dude to this change.

    Any suggestions guys....

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans