popeye
18th November 2002, 21:17
Hi,
Does ttstpcreatdlls create functions for COPYing records?
I couldn't find it my FS DLL.

How do you copy records?
I don't want to store the values of the source record in temp
variables and then do an insert for the destination record.

Please advice.
Cheers,
Popeye!

mark_h
18th November 2002, 21:43
It does not create anything for copying records. The only way I know to do this is to use temp fields and do another insert. I have never even tried to do a copy record function - I always use temp fields to do the insert. Maybe someone else has an idea.

Good Luck!

Mark

gfasbender
18th November 2002, 22:14
Have you tried performing these steps?:

stpapi.put() for key field(s)
stpapi.find() or stpapi.browse.set()
stpapi.put() to change key field(s)
then stpapi.insert()

popeye
18th November 2002, 22:23
Hi,
Yes, I did try it.
But that again inserts the new record with the defaults.
The values of the Source record are not retained.
Thanks.
Cheers,
Popeye!

gfasbender
18th November 2002, 22:28
Sorry.

lbencic
18th November 2002, 23:44
Just fyi - on the insert function, here's what happens:

It 'presses' the Add Set button, then puts your fields in at form entry field order. The 'put.field' commands are executed after the 'add.set' command.

You would like to 'press' the Copy button, but as far as I know there is not yet a command for that.

What are you trying to copy? Maybe we can help with other suggestions. ex: the Sales Order has a Copy Sales Order session you can run instead, as do some others. Other sessions do very little validation on the key field, only the other fields that have ranges and references. You may not need an API to copy a record if just the key field is changing, just do a normal copy in the code.

popeye
18th November 2002, 23:51
No problemo ... I am trying to copy Locations between Warehouses.

I could always store in temp vars and then do an insert.
But I was just wondering if you boys hada better solution.

I guess I'll start my "store in temp" variables code :)

Thanks a lot guys for your inputs.
Cheers,
Popeye!

Kingsto88
10th May 2005, 04:14
Hi Everyone,

this is what I am looking for. To use temp variables is too hard.
The table have more than 60 fields and I want the new record to take these 60 fields over to the same table in the archive company.

How to do this? API or something else?

thanks in advance