REST Annotation
 

REST Annotation

5 posts, 1 answered
  1. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    08 Jun 2021
    Link to this post
    We have an array in our Totals table called Tots. In the Business Entity Designer we are flattening this array as well as using field names that make sense to the developer. For example, Totals.Tot[8] is named Totals.OnHandUnits.

    This works great using the dataset model class as the table model refers to the name we gave it.

    When using the REST annotation below what is returned in the json response is the eTotals.Tot[8] not  eTotals.OnHandUnits. Is this by design?


    @RestAddress (type="record", address="/Item/~{ItemNum}/~{PackNum}", tables="eItem,eTotals,eActiveBatch", id="ItemNum,PackNum",
                  fields="eItem.*,eTotals.OnHandUnits,eActiveBatch.*", canRead="true", canUpdate="true", canDelete="false",
                  childAddress="eTotals:/Totals/~{ItemNum}/~{PackNum},eActiveBatch:/ActiveBatch/~{ItemNum}/~{PackNum}"
                  ).
  2. Daniel van Doorn
    Daniel van Doorn avatar
    17 posts
    Registered:
    18 Jun 2018
    Answered
    08 Jun 2021 in reply to Roger Blanchard
    Link to this post
    Hi Roger,

    That is definitely not by design.
    May I ask which version of the SmartComponent Library are you using?

    BR Daniel

  3. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    08 Jun 2021 in reply to Daniel van Doorn
    Link to this post
    11.7 #65948@2021-05-17
  4. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    08 Jul 2021 in reply to Roger Blanchard
    Link to this post
    Can you please check the serialize-names of the fields in question? 
  5. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    08 Jul 2021 in reply to Mike Fechner
    Link to this post
    Mike, this is all set. Daniel answered me on the same day I created the post. I was just marking this as answered.

    Thanks...hope things are well.
5 posts, 1 answered