2 Replies Latest reply on Nov 28, 2009 10:24 AM by Sorbsbuster

    Portal sorting problem

    VickyN

      Title

      Portal sorting problem

      Post

      Hi All

       

      I've created a relationship between contacts and contact history and set this relationship to allow creation of new records in contact history table via the relationship.

       

      What i want is for people to be able to go to the contact record, simply type the details of a conversation into the portal and select a date, minimal clicking with maximum data structure as I want to be able to report on this contact history later...

       

      However I want the portal in the contact record to sort the contact history by date in descending order i.e. newest at the top, BUT I want the new blank record to appear right at the top, and it doesn't....

       

      I thought if I sorted firstly by the history field itself (which contains the details of whatever contact you had with the person) in ascending order, then in descending date order the blank record would appear at the top (as there is no text as yet in the history fields) then all the other records in date order...

       

      But whatever I do the blank row seems to go to the bottom and I'm assuming this is because at this point it technically does not exist and is therefore not taken into consideration in the sort...

       

      Am i right and if so besides altering my relationship and scripting the creation of new contact records to ensure this blank row is created and sorted to the top, what can I do???

       

      Help please, thank you lots and lots in advance!

       

      Vicky x 

        • 1. Re: Portal sorting problem
          juancardona
            

          Hello, you should put some data into the new record i.e the date, an ID etc., and THEN commit the record, you'll see the recent created record on top of your portal.

           

          Of course via script.

           

          Go to the last portal row

          Go to the field

          Insert some data

          Commit the record

          Go to the first portal row 

          Go to the field

           

          As I use FM in sànish I don't know the exact english sintaxis of the script. 

          • 2. Re: Portal sorting problem
            Sorbsbuster
              

            Much as I admire the option to 'Create new records', I find so many problems with it (such as the one you have) that I long since stopped users creating new records via a portal.  I also read on a few occasions that it was 'bad practice' though I couldn't really see why.

             

            I always put a button at the top of the portal for 'Create new Contact History'.  Then my standard practice would be:

            - Show a Custom Dialogue asking for connfirmation that they really did want to create a new record.  (Something you can't do as easily if they accidentally click on the 'New Record' portal row.)

            - If they choose to proceed, capture the parent KeyField as a variable, $KeyField

            - Go to the portal's Base Table layout

            - Create a new record

            - Set the child KeyField from the variable.

            - Automatically add any other data you want (such as the Account Name)

            - Leave the tab in the next field you want the user to enter data into.

             

            If the details to be added to the report are small then you can make the complete data entry be the dialogue box itself, and seem to never leave the Contact Layout.  Just present the Contact History Report field you want as part of the dialogue box and they can fill it in directly there.

             

            Alan.