Loading...

Customize the API with the $select Operator for Custom Objects

Comments

5 comments

  • Simon Dargaville

    Something that's caught me out, when implementing Select..

    When I wasn't using it, my StartDate was including the function start Time, which was quite handy.

    Whereas when Selecting the StartDate, it only includes the Date. 

    Not sure if this is intentional, and I can work around it by checking both StartDate and StartTime in my code. But thought I'd point it out anyway!

     

    /api/v1/Functions/10?search= Usage eq 'SIG' and StartDate ge DateTime'2021-09-03' and StartDate lt DateTime'2021-09-04

    Returns:

    "StartDate":"2021-09-03T13:00:00"

     

    /api/v1/Functions/10?search= Usage eq 'SIG' and StartDate ge DateTime'2021-09-03' and StartDate lt DateTime'2021-09-04'$select=StartDate

    Returns

    "StartDate":"2021-09-03T00:00:00"

     

    Simon

  • Rudy Scoggins

    Hi Simon,

    That's pretty interesting.  There must be something in the retrieve that relies on both being there.  I'll have the Functions team take a look.

    Thanks,

    Rudy

  • Lee Tickett (Tickett Enterprises Limited)

    This is on .96E

    I'll try and retest if/when the client has their test environment upgraded- thanks for the prompt reply :)

  • Lee Tickett (Tickett Enterprises Limited)

    Hi Rudy Scoggins

    I am trying to use the $select=None option with the relationships endpoint (via the SDK):

    /api/v1/Relationships/10?search=SubordinateOrganizationCode%20eq%20'10'%20and%20SubordinateAccountCode%20eq%20'00069792'%20and%20RelationshipType%20eq%20'CTA'$page_size=1000$maxresults=100000$select=None

    And getting a response:

    HTTP/1.1 400 Select parameter in OData string: Model property 'None' not found. Please check for errors and try again. If this was a PUT or a POST operation, the save was successful.

    This isn't the end of the world... as I can simply use $select=MasterAccountCode instead, but it looks like a bug?

  • Rudy Scoggins

    Hey Lee,

    Thanks for the heads up.  This does indeed look buggy.  I gave it a shot on 97 and it appears to be working.  What version are you running this on?

    Rudy

Please sign in to leave a comment.