How to know the requested tables during SaveChanges
 
Forums / SmartComponent Library - Developer Forum / How to know the requested tables during SaveChanges

How to know the requested tables during SaveChanges

2 posts, 1 answered
  1. Bert Strobbe
    Bert Strobbe avatar
    19 posts
    Registered:
    25 Oct 2018
    06 Feb 2019
    Link to this post
    Suppose you have a table eArticle that contains a lot of references.
    In the frontend, users tend to want descriptions for those references.
    As we do not want those descriptions during batch processing, we put all those descriptions in an eArticle_desc table, which has no before table.
    With the FetchDataRequest:Tables we can determine whether or not to fill the descriptions.
    Suppose the user now changes one of those references, how can we know during SaveChanges, to also fetch the new description(s)?

    Right now, we would put the tables used in the SmartBusinessEntityAdapter in a Tables property of our SaveChangesParameter en continue from there, but isn't there another way?

  2. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    Answered
    06 Feb 2019 in reply to Bert Strobbe
    Link to this post
    There's no built in way. 

    I believe that in a state-less environment the save request is supposed to stand on it's own.

    You can pass however a custom serializable parameter object to the Save changes method. 
2 posts, 1 answered