Thursday, October 14, 2010

How to duplicate an object

Hello readers,

While configuring a new documentum environment I was in need of a second configuration object. At first I just created the object and entered all attributes by hand although most values are the same as the first config object. I felt like an idiot to just type everything by hand, so I figured out how to duplicate the config object to save some time and keep things simple.

This is how it's done:
begintran,c
set,c,{r_object_id},object_name
{new object_name value}
saveasnew,c,{r_object_id}
commit,c

We need to use an API script to perform the task. As you can see the object_name is changed on the original object. However the change is not saved, it's used for the new object. When we commit the API commands, the original change will be lost but the new object will have the new object_name. In short, a new identical object is created and only the object_name is different.

Note: This can also be done for folders.

Kind regards, Marcus

2 comments:

  1. Hi Marcus,

    When I run this script:

    begintran,c
    set,c,090217488104d729 ,object_name
    kopietest
    saveasnew,c,090217488104d729
    commit,c

    I get this:

    API>begintran,c
    ...
    OK
    API> set
    ...
    This is not a valid API command.
    API> kopietest
    ...
    This is not a valid API command.
    API> saveasnew
    ...
    This is not a valid API command.
    API> commit
    ...
    This is not a valid API command.

    Any thoughts?

    Onufry

    ReplyDelete
    Replies
    1. You need to run it as a script.
      I use dqMan or iapi for this.

      Delete