cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Attachment of WTPart is not getting saved when I do checkout and edit,add more attachment and then check in

srahamedhulla
1-Newbie

Attachment of WTPart is not getting saved when I do checkout and edit,add more attachment and then check in

Hi,

Scenario:

1. Create WTPart with attachment and new modeled object called lineitems.

Result: Successfully saved WTPart,attachment and line items.

2. Checkout and Edit WTPart and edit attributes, add more attachment and add more line items.

Result: Successfully saved WTPart , attributes and line items.

Issue: Attachment is not getting saved.

here is my code:

@Override

  public FormResult doOperation(NmCommandBean paramNmCommandBean, List<ObjectBean> paramList)

  throws WTException

  {

  FormResult localFormResult1 = new FormResult(FormProcessingStatus.SUCCESS);

  for (ObjectBean localObjectBean : paramList)

  {

  Object beanObject = localObjectBean.getObject();

  if(beanObject instanceof WTPart)

  {

  logger.debug("Is Persistable:"+beanObject);

  beanObject = PersistenceHelper.manager.save((Persistable)beanObject);

  if ((beanObject instanceof RevisionControlled))

  {

  Mastered localMastered = ((RevisionControlled)beanObject).getMaster();

  localMastered = (Mastered)PersistenceHelper.manager.save(localMastered);

  break;

} }  }

  return localFormResult1;

  }

Could you please help me to save attachment when we do checkout and edit.

Thanks,

Sithik

1 REPLY 1

Sithik,

Are you interested in editing your post and formatting your java code as such?  When editing, choose the Use advanced editor button.  After entering that mode, you can highlight your code and click the buttons in the screenshot below to format your code for easier visibility.

Thanks!

2015-08-27_18-59-41.png

Top Tags