cancel
Showing results for 
Search instead for 
Did you mean: 

Setting attachment to extension field in SAP CLM through script.

0 Kudos
271

Hi Experts,

I am trying to set 'Signed_Doc' to another extension field of type attachment.

following is the logic.

AttachmentIfc attachment = contractDocBean.getFieldMetadata("SIGNED_DOC").get(contractDocBean);
if (hasValue(attachment))
				{
					// attachment is available
					contractDocHome.upgradeToEdit(contractDocBean);
					contractDocBean.getExtensionField("Z_ATTACH_FILE").set(attachment);
					contractDocHome.save(contractDocBean);
					contractDocBean.getFieldMetadata("SIGNED_DOC").set(contractDocBean,null);
					contractDocHome.save(contractDocBean);
					contractDocHome.downgradeToView(contractDocBean);
				}<br>

the attachment is getting copied but when I tried to download the copied attachment, system unable to locate it as 'Signed_Doc' is reset. I know I am copying only Metadata here, I need a help how we can copy all the metadata along with Actual file to extension field. Please help me

Regards

Nishant

Accepted Solutions (0)

Answers (0)