Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Little Gen I discovered - Copy Portal Rows, etc


This topic is 7089 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi guys,

I thought I would post something that has been a little gem to me since I discovered it.

Copying Portal Rows and adding new portal records without having to add it to the bottom row of a load of line items.

This is only a little discovery but it's made layout formatting and copying of portal information a breeze for me.

When you have created a quote or something and you are doing another quote for someone else with the same items, it would be nice to copy the data from one portal line item to a new one. Seems simple enough.

Normally you have a Quote table with a Line Items table and they are linked via Quote ID and possibly the client name as well. You would allow creation of new line item records in the relationship - fine.

Now you have another portal that looks up an existing Quote ID and lists the items from that reference. You want to copy them to your new quote.

Well, in your quote table, make a DupID which is a number field. This number field is set at 1 on creation of a new quote. Via a (copy script) this figure increments + 1. In the Item Table, have a number field called DupID as well without auto entered data.

Now you create a new relationship (call it New Item) based upon

QuoteID = QuoteID AND

DupID = DupID

Turn on allow creation of new records

Now, let's go back to the quote table with the portal listing old quote numbers.

Now, even though you are entering a list of details using the normal QuoteID = QuoteID to the quote, none of them are listed in the New Item portal because DupID is not matching anything yet.

Create a script that allows you to click on an existing quote item that does a series of:

set field New Item::Description, Old Quote::Description

set field New Item::Retail Price, Old Quote::Retail Price

set field New Item::Cost Price, Old Quote::Cost Price

set field New Item::Supplier, Old Quote::Supplier

set field New Item::QuoteID, Quotations::QuoteID

set field New Item::Customer, Quotations::Customer

DupID = DupID +1

go to layout NEXT

go to layout ORIGINAL - to refresh the screen

Now you will see listed in the normal portal an exact copy of the old item with the new quote reference.

This process can be used for anything - creating new portal records, copying new portal records, etc

I've found it pretty useful - hope you like!

Posted

My point is,

If people actually know about this then why has everyone been saying that copying portal records isn't the done thing now. Well, until something replaces it, I think there is nothing better than making light work by using copy and paste scripts!

I had to figure it out by myself that it is possible and I think I'm the last to know.

LOL

  • 7 months later...
  • Newbies
Posted

Found this extremely useful when I had to figure out how to "copy" 300 records (created "on the fly" via heavy-duty scripting), relate it to another table and commit them to this related portal. Didn't work! Frustrating. So created a new table occurrence and wanted just copy/commit the one portal from the other to have permanent record of these new 300 separate calculations into this ONE record (too complex to go into here - this thing is a beast!). Tried for days and couldn't find anything. This works wonderfully. I would, however, add one thing to this method and that is:

create a separate script to refresh your portals. I use portals extensively and found it much easier to create a separate script and then "perform script" from within my scripts that reference portals. Create once, use many times!

The script to refresh portals is:

Go to Portal Row

[First, Select entire contents]

Loop

Go to Portal Row

[Next, Select entire contents, Exit after last]

Exit Loop If [status(CurrentPortalRow) >##]

End Loop

Go to Portal Row

[Last, Select entire contents]

Exit record/request

Refresh window

[bring to front]

Works like a charm! I can also place a button anywhere in my solution using script parameters to almost instantenously refresh the portal rather than moving around the solution...ugh! what were they thinking?!

This topic is 7089 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.