8 Replies Latest reply on Sep 7, 2012 5:02 PM by comment

    Creating records via portals - the 'new row at the bottom issue'

    steve.winter

      Hi all

       

      Context: FM12, external container data

      Tables: clients, files

      Files fields: clientID (text), file (container, external storage), filename (text, autoenter calc using custom function), filesize (number, autoenter calc using custom function)

      Relationship: clients::ID = files::clientID, allow creation of new records in files enabled

       

       

      So on my 'clients' layout I want to put two portals, one which shows a list of all the files which already exist for that client - this will just list filename, size, and have links to view and download the files - at this point these are all going to be large pdf documents, so there's no 'point' in having a thumbnail in there

       

      To add new files my idea was to have a second portal, which contained only one row and had the file (container) field only in it, and then allow users to use the FM12 drag and drop, to drop a file into that container...this all works fine when there are no records, since then the 'new row' of a portal is the only one present, it's at the top of my single-row portal... a new record gets created, that appears in my first portal with the filename info etc - all good... however, that row then becomes the only one visible in my single-row portal...

       

      In terms of getting round this I've seen lots of posts on tinternt about using global fields and a button positioned to look like it's an add row above the portal, and then a button to 'add' that to the portal, and that's all well and good for text-based information, but somewhat defeats the ability to drag and drop a file...

       

      Anyone got any ideas...? is there some magic which I don't know about which will allow me to get the 'new' portal row to the top of the portal...??

       

      Cheers

      Steve