7 Replies Latest reply on Jul 1, 2013 10:20 AM by philmodjunk

    Duplicating Portal Records

    UltimateDr

      Title

      Duplicating Portal Records

      Post

           Hi, 

           I am using FM Pro. I have layouts and tables i.e., ProductionOrder and ProductionOrder_LineItems and Products. 

           I am using portal on my ProductionOrder layout to add. I have twenty items in each production order. For every new PO i have to enter values, i just want to duplicate portal records for new production order to avoid wasting of time. can some body help me. i tried scripts mentioned on FM forum but they didnt work so far for me. 

           Thank you

        • 1. Re: Duplicating Portal Records
          philmodjunk
               

                    i tried scripts mentioned on FM forum but they didnt work so far for me.

               Was this the script that you tried? Duplicating Bill Of Materials (duplicating portal line items)

               If so, in what way did it "not work" for you? (That can then help us suggest an alternative.)

          • 2. Re: Duplicating Portal Records
            UltimateDr

                 Hi Phil, 

                 First of all thank you for your reply.

                 i tried this script but it didnot duplicate portal records at all, infact it start making duplicate entries on previous portal records.

                 Looking for a solution.

                 Thank you.  

                  

                  

            • 3. Re: Duplicating Portal Records
              philmodjunk

                   The script in that thread is a script that I designed. If correctly  implemented, it duplicates both the current parent record and its set of related portal records. If it is making "duplicate entries on previous portal records" then there is something different in how you attempted to implement the script.

              • 4. Re: Duplicating Portal Records
                UltimateDr

                     Phil, 

                     Thank you very much for your support so far. 
                     Just want to ask that while using your scripts, do we need to add any Global field in my ProductionOrder_Lineitems table?
                     Thank you

                      

                • 5. Re: Duplicating Portal Records
                  philmodjunk

                       I know very little about the design of your database as you have posted very little info about it here, but I don't see why you would need any global field in order to duplicate a parent record and it's related child records.

                  • 6. Re: Duplicating Portal Records
                    UltimateDr

                         Dear Phil, 

                         Thank you for your support so far. 


                         I have tables and layouts i.e.,  Batches --- Production Order ----- ProductionOrder Line Items ------ Products. 

                         On my PO layout i have one portal which have PO Line items which fetch data from products. On same production order layout i have batches also which pull data from btaches table also. 

                         Can i also ask you one thing that on your post 

                    Duplicating Bill Of Materials (duplicating portal line items)

                         you have mentioned RecordNumber, can you please tell me what is this RecordNumber represents in this script. 

                         I am grateful if you help me in solving this problem. 

                         Regards, 

                          

                          

                    • 7. Re: Duplicating Portal Records
                      philmodjunk

                           To fill in some details you appear to have:

                           Production Order ----- <ProductionOrder Line Items> ------ Products

                           But the relationship to batches are unclear, but it doesn't look to me like it's part of the issue if you are only duplicating records in PO and PO Line Items.

                           Get ( RecordNumber ) returns the position of a record in its current found set. If you have 5 records in your foundset, Get (recordNumber) returns 1 for the first record, 2 for the second and so on.

                           If you read and compare the earlies version of the duplicate script with the final version in this thread, you'll find that another person found that if you had a found set of more than one parent record (PO in your case) where the record to be duplicated was not the last record, it failed. And thus, the last version that uses Get ( RecordNumber ) and go to Record/request/Page  was needed to get the focus to be on the correct parent record at each point in the script's execution.