6 Replies Latest reply on Jul 8, 2013 2:06 AM by davehob

    portal row data from previous row?

    tunghua

      Hi everyone:

       

      I am developing a system for publisher to calculate their book stock, every year we have to calculate our stock lavel at year end, and next year, we use "last year end stock value" as "new year starting value", I have been searching at the script step, but I can not find a way to get "last year end stock" to add to new portal row, can any one guide me a way for that? I have attached my screen shot on this message.

       

       

      Tunghua

        • 1. Re: portal row data from previous row?
          Malcolm

          Use a button to create new records in your portal row.

          Have the script do these steps.

           

          Go to Related Records

          Go to last record

          Set variable[$lastYear ; "last year end stock"]

          make new record

          set field ["new year starting value"; $lastYear]

          set variable[$portalRow ; get(recordnumber)]

          go to original layout

          go to portal row [$portalRow]

          • 2. Re: portal row data from previous row?
            davehob

            Hello Tunghua,

             

            I'm not clear about your requirement.  Presumably the "new year starting value" is a field (a calc?) in the "year" record, so can you not just display that on the relevant portal row?

             

            Dave.

             

            EDIT - just saw Malcom's post, now I understand, i.e. that you're adding a record via the portal.

            • 3. Re: portal row data from previous row?
              tunghua

              Hi Dave:

               

              I am trying to calculate book stock in our warehouse, like this

               

               

                         beginningStock   print   damage   endstock   sold

              2010             100            100        1              50        100+100-1-50=149

              2011               50            100        0              30         50+100-0-30=120

               

              so every year for every book, I have to take the stock volume from last year end to next year beginnig, and start another year of calculation, but I can not figure out hot to get previous protal row fileld value.

               

               

              Tunghua

              • 4. Re: portal row data from previous row?
                tunghua

                Malcolm:

                 

                Thanks for your answer, by the way if I use a button to create new records, portal has the function to let user create portal row already, can I close that function? let user have to press the button to create new recrod?

                 

                 

                Tunghua

                • 5. Re: portal row data from previous row?
                  Malcolm

                  if I use a button to create new records, portal has the function to let user create portal row already, can I close that function? let user have to press the button to create new record?

                   

                  Yes. That's best.

                  • 6. Re: portal row data from previous row?
                    davehob

                    Hi Tunghua - yes, I see.  Malcolm's suggestion will do the trick, and yes, if you're providing a nice button for the user I would remove the option to create record directly in the portal - just remove "Field entry" in Browse mode.

                    Dave.