For a complete list of all my blogs regarding content management, please see here.
For more detail about CRM content management, please go to my wiki page CRM Content Management.
During my recent project I found a strange behavior in attachments.
Click the hyperlink of Properties
do not change anything, and click back
After back to product overview page, the overview page looks exactly the same before you click Property hyperlink.
However, if you use SM12 to check in backend, you will find the current product is locked, although it still looks as under display mode in UI!
The same behavior could be observed in one order application. I would assume this as a bug.
By debugging I found the parent node, Product instance, is explicitly locked by content management class.
However, in my application I do not need this behavior – in my application, the whole attachment assignment block has read only mode, so I don’t want my BO to be locked after property hyperlink is clicked. The solution is very easy: do not bind my BO node to PARENTNODE of content management UI component GS_CM by commenting out the related code:
Do you know if this “issue” has been solved?
I have exactly the other problem around on this case the following lines are commented.
TRY.
lr_parent_entity ?= typed_context->parentnode->collection_wrapper->get_current( ).
IF lr_parent_entity IS BOUND.
* IF lr_parent_entity->is_locked( ) EQ abap_false.
** if not changeable, exit
* CHECK lr_parent_entity->lock( ) EQ abap_false.
** calling application throws a message
* rv_valid = abap_false.
* ENDIF.
Due to that when in an opportunity I just add an attachment, it is not saved, as the object has not been Locked?
Hi Pedro,
I am a little confused. Would you please kindly tell me your problem? If you would like to attach a document to opportunity and save it, the host bo, that is opportunity, must be expected to be locked. So I could consider that you should not comment those lines of codes.
Best regards,
Jerry
Hi Jerry,
I understand your confusion, cause I was also confused when reading your post.
I’m on sap crm EHP 2 SP 7.
I’m having an issue with attachments on transactions (Opportunities, quotations, campaigns…)
When I create/update a attachment on a transaction, it is not saved unless I force another modification on the operation.
This looks like a standard bug, I have been searching notes and scn, and the only thing I found is your post.
But the funny thing is that you have exactly the opposite symptoms.
I check on the method you mentioned and this is the original sap code on my system:CL_GS_CM_BSPWDCOMPONENT->CHECK_PARENTNODE
TRY.
lr_parent_entity ?= typed_context->parentnode->collection_wrapper->get_current( ).
IF lr_parent_entity IS BOUND.
* IF lr_parent_entity->is_locked( ) EQ abap_false.
** if not changeable, exit
* CHECK lr_parent_entity->lock( ) EQ abap_false.
** calling application throws a message
* rv_valid = abap_false.
* ENDIF.
I have amended the code on ZL_GS_CM_DOCLIST_IMPL->EH_ONNEW_URL_BTN.
My question is if you know when and in which note was the code commented? I lost the version track due to the upgrade done.
Regards,
Pedro
Hi Pedro,
I will check in our dev system and update you once I have figured it out.
Best regards,
Jerry