2

I am updating my documentum object using IAPI.

Below is IAPI script to update date

set,c,090d903886353e5a,r_creation_date
'12/12/2020 12:00:00 AM'
save,c,090d903886353e5a

After executing scripts i am facing below issue

API> SET> ... [DM_API_E_BADDATE]error: "You have specified an invalid date or an unrecognized date representation ''12/12/2020 12:00:00 AM'' based on format 'M/d/yyyy h:mm:ss a'"

As you can see i have entered date as 12/12/2020 12:00:00 AM, in my opinion it is in correct date format.

Please suggest on this.

Note: Earlier i have entered date as 12/12/2020 12:00:00 that time also i got issue.

Dev Role
  • 69
  • 1
  • 8

2 Answers2

2

Remove quotes from the date and time and it will work:

API> set,c,090d903886353e5a,r_creation_date
SET> 12/12/2020 12:00:00 AM

You can also specify date format pattern:

API> set,c,0c0d900c80000107,r_creation_date,M/d/yyyy h:mm:ss a
SET> 12/12/2020 12:00:00 AM
...
OK
API> save,c,0c0d900c80000107
...
OK
cgrim
  • 4,890
  • 1
  • 23
  • 42
  • it'll probaby work on your systems, but on mine it doesn't work (client settings), with removing quotes, ofc. – Miki Apr 11 '19 at 08:48
  • 2
    @Miki Yes of of course, on your system you can have problem and then you should use the second option - with date format pattern, as I already wrote into the answer. – cgrim Apr 11 '19 at 08:54
0

Manipulating with Date Time properties in Documentum depends on client settings. However you can override it via date time pattern.

For example

create,c,dm_document
set,c,l,object_name
Api test
set,c,l,a_effective_date,yyyy-MM-dd HH:mi:ss
2019-04-11 12:24:09
set,c,l,title
script-generated
save,c,l


create,c,dm_document
set,c,l,object_name
Api test
set,c,l,a_effective_date,MM/dd/YYYY HH:mi:ss
04/11/2019 12:24:09
set,c,l,title
script-generated
save,c,l

will create objects with same a_effective_date value.

Miki
  • 2,493
  • 2
  • 27
  • 39
  • Thanks it worked but changes didn't committed after set i executed dump again but net set values were not there... – Dev Role Apr 12 '19 at 06:14
  • you're probably overlooking something, but that's for another question, not this – Miki Apr 12 '19 at 13:44