AnsweredAssumed Answered

Copying from Portal A to Portal B - Help with Script

Question asked by ScottMerrick on Jan 16, 2015
Latest reply on Jan 16, 2015 by philmodjunk

Title

Copying from Portal A to Portal B - Help with Script

Post

 
Post:

I've upgraded from FM 6 to FM 13 and need help with updating a script copying three fields in multiple rows from Portal A to new rows into Portal B.I realize that this is not the best structure, but for now want to keep these portals and a script that will copy the data from one portal to the other.

This is for an invoicing system, where the first portal has the line items (product detail) for a proposed order and the second portal has the line items for a final invoice. Portal A has three fields (Product, Quantity, Price) and Portal B has similar fields (Prod, Qty, Prc). In FM 6, the portals were each in separate files and were shown with data copied via script from one portal to the other while displayed a third file (an invoice detail file).

In FM 13, each portal has it's own table and layout - Portal A is in "Proposed Sale Line Items Table" (PSLT) and Portal B is Invoice Line Items Table ("ILT"). Each portal is displayed on a third layout/table called Invoice Detail Table ("IDT"). ISLT and ILIT are both related to IDT but not to each other. The IDT layout/table allows creation of new rows in the ILIT portal/table.

The script that worked in FM 6 is below:

         
  • Go to Layout [IDT]
  •      
  • Go to field [PSLT::Product]
  •      
  • Go to Portal Row [Select; Last]
  •      
  • Set Field [PSLT::gLastRow; Get(ActivePortalRowNumber)] /  formerly Status(CurrentPortalRow)
  •      
  • Go to Portal Row [Select; First]
  •      
  • Loop
  •      
  •   Copy [PSLT::Product]
  •      
  •   Paste [ILT::Prod]
  •      
  •   Copy [PSLT::Quantity]
  •      
  •   Paste [ILT::Qty
  •      
  •   Copy [PSLT::Price]
  •      
  •   Paste [ILT::Prc]
  •      
  •   Go to Field [PSLT:Product]
  •      
  •   Go to Portal Row [Select; Next, Exit after last]
  •      
  •   Exit Loop If [Get(ActivePortalRowNumber) = PSLT::gLastRow]
  •      
  • End Loop

Any help is greatly appreciated. 

Thank you.

Outcomes