Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Insert not supported with the values specified for 'Effective' and 'Expiration

(0) ShareShare
ReportReport
Posted on by 308

What would cause such error?

Cannot create a record in Addresses (LogisticsPostalAddress). Insert not supported with the values specified for 'Effective' and 'Expiration'. New record overlaps with multiple existing records

I can't find the error in D365 labels..to look for references. How can i find it?

I have a custom service that updates or creates an address using logisitcsPostalAddressHistoricalCDSV2Entity

  • DELDYN Profile Picture
    DELDYN 308 on at
    RE: Insert not supported with the values specified for 'Effective' and 'Expiration

    Any idea?

  • DELDYN Profile Picture
    DELDYN 308 on at
    RE: Insert not supported with the values specified for 'Effective' and 'Expiration

    Hi martin,

    But as i said, if location and validFrom are the same, then it will never create a new record and it will just update it(maybe it uses correction). As it the validTimeStateEnabled property for this entity is no.

    So i tried multiple times but got no errors.

    In order to create new records, validFrom needs to be different it seems

  • Martin Dráb Profile Picture
    Martin Dráb 230,934 Most Valuable Professional on at
    RE: Insert not supported with the values specified for 'Effective' and 'Expiration

    Now you have the same location, but different period.

    The unique index isn't violated because the records didn't have the same combination of Location and ValidFrom.

  • DELDYN Profile Picture
    DELDYN 308 on at
    RE: Insert not supported with the values specified for 'Effective' and 'Expiration

    Hi Martin,

    If i try to insert record with same data or by changing street only for example, it's going to override it because logisticsPostalAddressHistorecalCDSV2Entity ValidTimeStateEnabled = no

    But i tried to change validFrom so that it creates history, it worked so i still can't reproduce the error. can you please tell me the repro steps?

    image-_2800_9_2900_.png

  • Martin Dráb Profile Picture
    Martin Dráb 230,934 Most Valuable Professional on at
    RE: Insert not supported with the values specified for 'Effective' and 'Expiration

    Your screenshots show addresses for different locations.

  • DELDYN Profile Picture
    DELDYN 308 on at
    RE: Insert not supported with the values specified for 'Effective' and 'Expiration

    Hi Martin,

    I tried to reproduce by creating addresses that are valid at the same time, but I didn't get any error.

    When then would such error appear?

    image-_2800_7_2900_.png

    Hi Girish,

    Based on ur first link, i tried to add an address that is between an existing period but I didn't get an error as well

    image-_2800_8_2900_.png

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
  • Martin Dráb Profile Picture
    Martin Dráb 230,934 Most Valuable Professional on at
    RE: Insert not supported with the values specified for 'Effective' and 'Expiration

    It comes from kernel logic for date-effective tables.

    You're trying to insert a record with invalid values. It it was allowed, it would cause having several addresses valid at the same time.

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Insert not supported with the values specified for 'Effective' and 'Expiration

    Hi, There might be existing records in this effective and expiration period.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,111 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans