cancel
Showing results for 
Search instead for 
Did you mean: 

Date Added field blank in attachment

Former Member
0 Kudos

Hi All,

I am adding an attachment (through coding ) to an UDO.

The attachemmt attaches fine but the Date Added field is blank and non editable.

Moreover I cannot find any APIs to fill this field with the current date.

As a result, my UDO does not get saved.

Please provide pointers to fill the Date Added field either automatically or through coding.

Regards,

Himanshu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Since there are no standard API's to set the date added field., you can use getExtensionField to set the date. The field ID for date Added within AttachmentSubIBeanIfc is "MODIFIED".

You can use this line of code to set the date added:

attachmentBean.getExtensionField("MODIFIED").set(TypeFactory.createSysDatetime(new java.util.Date()));

where attachmentBean is of type AttachmentSubIBeanIfc.

regards,

Immanuel

Edited by: immanuel farrar on Mar 23, 2010 5:42 AM

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Himanshu -

Can you post your code? Are you creating the AttachmentIfc via the TypeFactory class? Then setting the file data? If you are using the standard attachments collection, you will need to create an element in that collection, set the attachments information, then, add that to the collection.

Rob

Former Member
0 Kudos

Hi Himanshu,

I am trying to add an attachment into a document object.

Is there a standard API method that I can use.

If you could share your code on attachment adding, it would be very helpful.

Thanks & Regards,

Reshma