Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    #16
    Originally posted by Isomorphic View Post
    We'll check on the condition - it certainly should not lead to an NPE.
    Thanks in advance. Regardless of the clarification on using customSQL="true", I believe that small fix would also resolve the issue in my current implementation.
    Originally posted by Isomorphic View Post
    However, what do you mean those fields are "ignored"? Are you hoping to have that metadata stored in SQL by the framework, even as the binary data itself is stored elsewhere?
    Using the workaround with customSelectExpression="''", when the upload comes from the browser, those metadata fields are now actually being stored.
    Isn't this expected behaviour?

    Comment


      #17
      So, setting customSelectExpression means you are going to handle "fetch" specially, but the system is expecting to use SQL operations for "add", "update" and "remove".

      You'd got an odd hybrid here where, as we understand it, you do want the SQL storage of the metadata fields, but not the SQL storage of the binary itself.

      So for that, it's correct to not use customSQL="true" (as that would remove metadata handling) but then you will need to avoid binary storage occurring by removing the stream from the values before SQLDataSource performs the "add" or "update".

      Comment


        #18
        Actually, I am only specifying customSelectExpression, and I am not using customUpdateExpression nor customInsertExpression, so the field is ignored in UPDATE/INSERT operations.

        This combination seemed convenient to achieve exactly that behavior - storing only the metadata while keeping the binary field completely external.

        Comment


          #19
          Originally posted by claudiobosticco View Post
          Hi

          Before asking if you have any best practice to recommend for this scenario, I’d like to insist on one point regarding getUploadedFileStream().
          it wasn't exactly "reversed," per se, but there was a logical error in that method. Thanks for letting us know. We've committed a fix for it to SmartClient 12.1 and newer releases, so if you pick up the latest nightly build, you'll have it.

          Comment


            #20
            SmartClient Version: v13.1p_2025-11-21/Enterprise Deployment (built 2025-11-21)

            Thanks a lot, with the fix applied, my Custom Server DataSource implementation now works even in the case where an Add operation with a binary field is created inside a DMI.

            The only remaining question I have is: are there any reasons why the following field declaration would not be recommended?

            Code:
            <field name="DOCUMENTO" type="binary" customSelectExpression="''">
            note that there are two single quotes inside the double quotes

            Comment


              #21
              There's not really anything that we can add - we've described above what that setting will do. It is neither recommended or not recommended, it just does what it says it will do.

              Comment

              Working...
              X