Jump to content

Duplicate portal records into another portal


hubabubaa

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

Recommended Posts

i've been trying to solve it for some days and still no idea how to do it.

i would like to copy all the records from portal-1 into the other one, portal-2, within one record. then i need to be able to adjust the records in portal-2, but keep the original ones in portal-1.

has anyone idea how to do that?

thanx in advance!

Link to comment
Share on other sites

Hubabubaa has adressed this question to me privately as well, but In order to let a larger audience have something to investigate, if say they made a search and found this thread, have I desided to make the answer here!!!

I've made a template that handles this issue, as dscriped by Hubabubaa...

The template is pretty complex a first sight, but try to reverse engineer it ...and don't hessitate to ask further!!!!

Enjoy

--sd

Multiselect.zip

Link to comment
Share on other sites

Thanx a lot, but... it goes even too far for me. I just need to copy the whole portal, all the records into the new one (an offer items into the order confirmation).

can i adjust/simplify(?) your example in any way to do so?

thanx a lot for your help up to now,

huba

Link to comment
Share on other sites

it goes even too far for me. I just need to copy the whole portal, all the records into the new one (an offer items into the order confirmation).

can i adjust/simplify(?) your example in any way to do so?

If thats the task, are you wrong in you thread header, nothing needs to duplicated at all. It's exactly the same data, just tagged diffrently as Comment says - No duplication what so ever!

The need to adjust the data in the second portal, was what led me in direction of lookups and import. Your structure should be in the vicinity of these two threads:

http://fmforums.com/forum/showtopic.php?tid/158955/post/158955/hl//#158955

http://fmforums.com/forum/showtopic.php?tid/159226/post/159226/hl//#159226

And please do not just download the templates, it's the debate that's just as important. All it takes is to change one field!!!

Perhaps would it be good to watch this video from start to end ...but paying extra attention to what is said when the time readout says 8:41 ...where the wording is "...fair share"

http://previews.filemakermagazine.com/videos/513/DataTagging_full.mov

--sd

Link to comment
Share on other sites

o.k. i'll explain it like this:

1. i have a client and he asks an offer for few products.

2. he gets an offer - all the items that i offer are placed in portal-1

3. when the client orders the products, i send him an order confirmation. the items that are in order confirmation ar collected in portal-2.

4. to save the time i want to copy all the data from the portal-1 (an offer) to the portal-2 (the confirmation).

5.BUT it happens that my client does not order everything what i offered - so i need to adjust the order-confirmation-items in portal-2. but in the portal-1 (the offer) they have to stay the way they were while offering. so thos data really has to be copied.

i hope it is clear now.

greetings!

Link to comment
Share on other sites

5.BUT it happens that my client does not order everything what i offered - so i need to adjust the order-confirmation-items in portal-2. but in the portal-1 (the offer) they have to stay the way they were while offering. so thos data really has to be copied.

Is the thinning in item lines or is it fewer single items than the offer suggested ...if it the later wouldn't it change the margin gained by quantum discounts???

--sd

Link to comment
Share on other sites

it happens that my client does not order everything what i offered ... but in the portal-1 (the offer) they have to stay the way they were while offering

Yes, in such case I think you should duplicate the data. The simplest way, I believe, would be to isolate the Offer items by GTRR, then import them into Order items. You need to set a few global fields (OrderID and CustomerID) first, so that you can fill this in on the Order side.

Link to comment
Share on other sites

Well another approach is to dupe within same table, exploiting that keys in textformat can be set to distinguise pre and post whatever that then means ...well see for yourself.

The algorithm seeks to make things fast without using globals, one issue though is that the way it starts to dupe from the buttom and works it's way to the start, make the dupes in reverse order. But sorting opposite on lineID solves the matter.

I did try to make it more normalized, but the fields required exceeded this approach, since the method should be doubled then ...while I with this method reuses behaviour with only slight redundancy.

--sd

InvoicingX.zip

Link to comment
Share on other sites

I don't know about keeping the dupes in the same table... I mean look at counting from the POV of your Warehouse, for example. I would also have the parent records in separate tables, so that each can have their own consecutive serial numbers.

Another option would be to have more fields in the Items table. Instead of duplicating/importing, you would simply add a new ParentID, and transfer some data from Offer fields to Order fields.

Edited by Guest
Link to comment
Share on other sites

I don't know about keeping the dupes in the same table...

Well I'm not drilled enough in 2NF 3NF and Boyce Codd 3rd ...to see what the solution actually should be ...sitting next to one who was drilled once, made him say "...you do it intuitively??" to which I admitted. But when he looked at the solution weren't there complaints!

But this one is tougher - hunchwise...

--sd

Link to comment
Share on other sites

Another option would be to have more fields in the Items table. Instead of duplicating/importing, you would simply add a new ParentID, and transfer some data from Offer fields to Order fields.

maybe this solution is getting closer to what i need, but... could you explain it a little bit more as for someone who just starts with FM?

Link to comment
Share on other sites

1. GTTR is short for the 'Go to Related Record' script step. If you select the 'Show only related records', it will create a found set of related records only.

2. Suppose my OfferItems table has these fields:

ItemID (serial)

OfferID

ProductID

Price (looked up from Products)

Quantity

cExtendedPrice (Price * Quantity)

Now we want the same item to serve also as an Order item, so we'll call the table just "Items" and add/modify some fields in order to have:

ItemID (serial)

OfferID

ProductID

OfferPrice (looked up from Products)

OfferQuantity

cOfferExtendedPrice (OfferPrice * OfferQuantity)

OrderID

OrderPrice (initially set to OfferPrice)

OrderQuantity (initially set to OfferQuantity)

cOrderExtendedPrice (OrderPrice * OrderQuantity)

Turning an Offer into an Order requires entering the current (i.e. new) OrderID number into the OrderID field in all the Offer's items.

Link to comment
Share on other sites

i have still something in my mind and i am sure you would know how to help it.

* i make portal 1.

* then i make portal 2.

* then i make the script in portal 2 to get data from portal 1.it works. but i have to i put the button in every portal line and click as many times as records that i want to copy.

how can i make it (a script) go thru all the portal-lines within one click on a single button?

Link to comment
Share on other sites

GTTR with 'Show only related records' is the key to this type of action. It puts you in the related table, and finds the records that you want to operate on, all in one step.

Now you can loop between all the found records. You are not very clear on the action you have decided on, but in general your script would have this structure:

Freeze Window

Go to Related Record [ From table: "LineItems"; Using layout: "LineItems" (LineItems) ] [ Show only related records ]

Go to Record/Request/Page [ First ]

Loop

# WHATEVER ACTION/S YOU NEED TO PERFORM ON A RECORD

Go to Record/Request/Page [ Next; Exit after last ]

End Loop

Go to Layout [ original layout ]

Commit Records/Requests

Link to comment
Share on other sites

* i make portal 1.

* then i make portal 2.

* then i make the script in portal 2 to get data from portal 1.it works. but i have to i put the button in every portal line and click as many times as records that i want to copy.

Yes - what bothers us is that it's structurally inadequate, thats why we're reluctant to perscripe it even-though we would know.

Put in another way could the question be; What signifies a good accountant?? That he'll cook the books when asked to by the management??? ...or will he act as a guarantee to both the shareholder as well as the management that things are kept inside the law???

No the best solution so far is probably:

OrderPrice (initially set to OfferPrice)

OrderQuantity (initially set to OfferQuantity)

Because it involves no scripting what-so ever, only these two fields set as auto-enter!!!! Even the second relationkey could be made auto-enter...If it really is needed???

--sd

Link to comment
Share on other sites

This topic is 6931 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.