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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

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

(0) ShareShare
ReportReport
Posted on by 8,585

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

I have the same question (0)
  • Suggested answer
    Deepak Agarwal Profile Picture
    8,585 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....

  • Suggested answer
    Maciej Obojski Profile Picture
    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

  • André Arnaud de Calavon Profile Picture
    299,349 Super User 2025 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.

  • Deepak Agarwal Profile Picture
    8,585 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.

  • Deepak Agarwal Profile Picture
    8,585 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).

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans