jroberts
28th July 2003, 22:45
Hello,

I would like to write a script that is short-cut for creating new customers. The 'parent' customer is creating a lot of new 'children' ship-to stores, each of which is set up in Baan as a customer in the customer master.

I am curious if there is a Baan command that will allow me to copy an existing tccom010 record, and only change the primary key.

Thanks,
John

NvanBeest
29th July 2003, 01:05
Something like:


db.retry.point()
select tccom010.*
from tccom010 for update
where tccom010._index1={:cust_parent}
selectdo
tccom010.cust=<new value>
db.insert(ttccom010, db.retry)
endselect
commit.transaction()

tjbyfield
29th July 2003, 02:52
Hi jroberts

NvanBeast's code is good but as an alternative, I think the standard "Maintain Customers tccom01101m000" session would allow a user to copy a record. (Edit dropdown).

This would aleviate the need to add a new session that will have to be maintained for as long as you keep Baan.

Terry