4 Replies Latest reply on Jan 6, 2011 2:07 PM by jhurley

    Updating Items Received in a Portal



      Updating Items Received in a Portal


      I am using the starter solution for Purchase Orders.  I have been altering it to meet our needs.

      In the portal for the items on order I have added a field for the number of items received.

      I want a script that can mark all items on a PO as received.  I used the replace field contents command to copy the number of items ordered to the items received field.  The problem is that this seems to update all of the items for all the currently found records, not just the one being browsed.

      Is there a better way to go about this?

        • 1. Re: Updating Items Received in a Portal

          Yes, use set field instead of Replace Field Contents. Replace Field Contents is intended to do exactly what you have discovered, it updates a specified field for every record in the found set. Set Field will only modify the current record.

          • 2. Re: Updating Items Received in a Portal

            Got it.  I am using Set Field to update individual line items as received.  But, to have a script mark the entire purchase order as received I guess I need the script to loop using set field on each line item.  Just not sure how I would go about that.  Can you provide me a little direction to get started?

            Thanks for your help.

            • 3. Re: Updating Items Received in a Portal

              "entire purchase order" could be the purchase order record or the individual line items. I misunderstood you to be wanting to update the purchase order record rather than the line items.

              Replace Field contents is a way to do this, but you need to generate a found set of your portal records for just the current purchase order before you use it.

              Here's one way to do it: (I am not opening the starter solution, so you may need to substitute the actual field names for what I am using.)

              Set Variable [$POnumber ; value:  PurchaserOders::POnumber]
              Freeze Window
              Go To Layout [//select layout for purchase order line items table]
              Enter Find Mode [] // clear the pause
              Set Field [LineItems::PoNumber ; $POnumber ]
              Set Error capure [on]
              Perform Find []
              Replace Field Contents [ no dialog ;//specify the line item field and value you want to put in each line item record]
              Go To Layout [original layout]

              • 4. Re: Updating Items Received in a Portal


                Thanks.  Worked like a charm.  Sorry for the slow response.  Got shifted over to another project for a few weeks.