Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Addressing UTCDateTime field in data entity URL for patch method in postman ~ D365FO

(0) ShareShare
ReportReport
Posted on by 59

Hello experts,

Greetings for the day!

I'm trying to update (i.e Patch method) PartyLocationPostalAddressesV2 entity via postman for integration purpose. It has one key which contains three fields in it [PartyNumber, LocationID, ValidFrom]. I need to address the URL.

I'm trying like: 

D365EnvironmentAddress/.../PartyLocationPostalAddressesV2(dataAreaId='206'PartyNumber='000219507'LocationId='L000007558'ValidFrom='2021-10-20T06:54:04Z')

But I'm getting this error:

"Message""No HTTP resource was found that matches the request URI '">D365EnvironmentAddress/.../PartyLocationPostalAddressesV2(dataAreaId='206'PartyNumber='000219507'LocationId='L000007558'ValidFrom=2021-10-20T06:54:04Z)'. No route data was found for this request."
I've tried with filter instead of addressing,
 
D365EnvironmentAddress/.../PartyLocationPostalAddressesV2 PartyNumber eq '000219507' and LocationId eq 'L000007558' and ValidFrom eq 2021-10-20T06:54:04Z
and it's working but for updating a field we need to use addressing only as per my knowledge so please help me with it. I know I need to change something around validfrom field. But couldn't find it out. Because while using filter, I got the same error so tried with the single quotes removed for validFrom field it worked. I tried the same for addressing but I'm missing something. Please guide me through it. 
Thanks in advance!

I've attached screenshots too.

This one is while I'm using filter query.

pastedimage1635494176329v1.png

This one while using addressing,

pastedimage1635494278655v2.png

  • Keerthanaa Ilangovan Profile Picture
    59 on at
    RE: Addressing UTCDateTime field in data entity URL for patch method in postman ~ D365FO

    Hi...

    I couldn't use patch so I used post method in the postman without using either addressing or filtering. Instead I've sent the values in the body to both modify a value or create a new record. It's working in this way. Thanks for everyone who have spent their valuable time. 

  • Alex VN Profile Picture
    1,987 on at
    RE: Addressing UTCDateTime field in data entity URL for patch method in postman ~ D365FO

    Hi,

    I think you might have issue with Valid From, can you try something like this:

    D365EnvironmentAddress/.../PartyLocationPostalAddressesV2(PartyNumber='000219507',LocationId='L000007558',ValidFrom=2021-10-20T06%3A54%3A04Z)?cross-company=true

    I think your previous URL is consider the validfrom as string instead of datetime, that why it return no record when you try to do patching.

    Hope this helps.

  • Suggested answer
    Alireza Eshaghzadeh Profile Picture
    10,829 Moderator on at
    RE: Addressing UTCDateTime field in data entity URL for patch method in postman ~ D365FO

    Hi

    I have just tested in PoweBI with following qury and it works fine. I guess you use QLIK can you try to test if it work as follows?

    let

       Source = OData.Feed("D365FO/data/PartyLocationPostalAddressesV2?cross-company=true&$filter=LocationId%20eq%20%27000002705%27and%20PartyNumber%20eq%20%27100000801%27%20and%20ValidFrom%20gt%202020-06-03T09:14:04z", null, [Implementation="2.0"])

    in

       Source

    pastedimage1635516289928v1.png

  • Keerthanaa Ilangovan Profile Picture
    59 on at
    RE: Addressing UTCDateTime field in data entity URL for patch method in postman ~ D365FO

    Hi Alireza,

    Thanks for your time.

    I'm getting data via browser, but I'm not getting data via postman. What would be the reason?

    pastedimage1635513951370v1.png

  • Suggested answer
    Alireza Eshaghzadeh Profile Picture
    10,829 Moderator on at
    RE: Addressing UTCDateTime field in data entity URL for patch method in postman ~ D365FO

    Thanks for the feedback. Have you tried as follow?

    data/PartyLocationPostalAddressesV2?cross-company=true&$filter=LocationId%20eq%20%27L000007558%27and%20PartyNumber%20eq%20%27000219507%27

    When it test this via browser, I can get data:

    pastedimage1635512724865v1.png

  • Keerthanaa Ilangovan Profile Picture
    59 on at
    RE: Addressing UTCDateTime field in data entity URL for patch method in postman ~ D365FO

    Hi Alireza,

    Thanks for your time.

    Yeah I've checked with your previous suggested format but without valid from filter. I couldn't get any data (Get method) or I couldn't update the record (Patch method).

    pastedimage1635511464546v2.png

    pastedimage1635511565568v3.png

  • Suggested answer
    Alireza Eshaghzadeh Profile Picture
    10,829 Moderator on at
    RE: Addressing UTCDateTime field in data entity URL for patch method in postman ~ D365FO

    Hi Keerthanaa,

    Thanks for the feedback.

    Have you tried to run this without valid from filter to check if you get any data?

    If yes you can set valid from with a date that fits with data (e.g. gt 2021-10-20T06:54:03Z)

  • Keerthanaa Ilangovan Profile Picture
    59 on at
    RE: Addressing UTCDateTime field in data entity URL for patch method in postman ~ D365FO

    Hi Alireza,

    Thanks for the reply.

    Yeah I've tired what you've suggested. But still getting the same error. I couldn't update the record (Using patch method). 

    pastedimage1635510171641v1.png

  • Suggested answer
    Alireza Eshaghzadeh Profile Picture
    10,829 Moderator on at
    RE: Addressing UTCDateTime field in data entity URL for patch method in postman ~ D365FO

    Hi Keerthanaa,

    Have you tried with filter and equal syntax?

    D365EnvironmentAddress/data/PartyLocationPostalAddressesV2?cross-company=true&$filter=LocationId%20eq%20%27L000007558%27and%20PartyNumber%20eq%20%27000219507%27%20and%20ValidFrom%20gt%202021-10-20T06:54:03Z

    (?cross-company=true&$filter=LocationId eq 'L000007558'and PartyNumber eq '000219507' and ValidFrom gt 2021-10-20T06:54:03Z)

  • Keerthanaa Ilangovan Profile Picture
    59 on at
    RE: Addressing UTCDateTime field in data entity URL for patch method in postman ~ D365FO

    Hi Alex,

    Thanks for the reply.

    Actually I can get values while using get method. For get method we can use either addressing or filtering if we want to get one specified record.

    Example for addressing:

    [  EntityName(DataAreaID='value'followed by all the fields inside the key of the entity)  ]

    Example for filtering:

    [  EntityName?$filter followed by the filed and value  ]

    While coming to patch it allows only addressing not the filtering. For addressing we need to mention all the fields inside the key. In this entity the key holds 3 fields. [PartyNumber, LocationID, ValidFrom] So I couldn't do as you've mentioned like removing the fields one by one.

    And also while filtering it worked only after removing single quotes (' ') for validfrom field. Thats when I assumed that the problem is in validfrom field.

    And also once I get the values using get method I copied the value for PartyNumber, LocationID, ValidFrom field and gave it in the URL for patch method.

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Jahanvi Profile Picture

Jahanvi 34

#2
PJ JohnPaul Profile Picture

PJ JohnPaul 5

#3
SudhanshuMSID Profile Picture

SudhanshuMSID 1

Overall leaderboard

Product updates

Dynamics 365 release plans