on 10-18-2013 9:55 AM
Hi all,
I'm pulling my hair out here with something that looks very simple but I just don't manage to get this working.
I need to perform a check on an attribute in context node BuilContact. This attribute was created via the AET.
Some more information:
On the BP_CONT/ContactQuickCreate view we added the field "group flag" under the email address. At the moment the user hits the "back" button to return to the customer screen I need to perform a check to see if the group flag is ticked or not. In an other post here on SCN I was advised to perform the checks in BP_DATA/AccountContactViewset in the EH_ONDONE method.
The view holds a context node BuilContact and when I open up the attributes, the group flag is indeed there. Question now is how I need to read that attribute.
Could anyone shine some light on this very annoying problem please?
Current code
lr_entity_cont ?= me->typed_context->builcontact->collection_wrapper->get_current( ).
lr_col ?= lr_entity_cont->get_related_entity( iv_relation_name = 'GetHeaderForContactRel' ).
lr_status_it ?= lr_col->get_iterator( ).
lr_data_property = lr_iterator->get_first( ).
lv_group_email = lr_entity_cont->get_property_as_string( 'Group_email' ).
This gives an error the moment I try to do the Get_first( ) method because the Iterator contains no values. Iterator is bound.
To be complete now
DATA: lr_entity_cont TYPE REF TO cl_crm_bol_entity,
lr_col TYPE REF TO if_bol_entity_col,
lv_iterator type ref to IF_BOL_ENTITY_COL_ITERATOR.
lr_data_property TYPE REF TO if_bol_bo_property_access.
lr_entity_cont ?= me->typed_context->builcontact->collection_wrapper->get_current( ).
lr_col ?= lr_entity_cont->get_related_entity( iv_relation_name = 'GetHeaderForContactRel' ).
lv_iterator ?= lr_col->get_iterator( ).
lr_data_property = lv_iterator->get_first( ).
lv_group_email = lr_entity_cont->get_property_as_string( 'ZZAFLD00000Z' ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i'm getting this error now when he tries to get the related entity. My lr_col is of type
if_bol_entity_col while the system expects a cl_crm_bol_entity. Problem is that the class cl_crm_bol_entity does not have a method get_iterator for the next step.
During a 'CAST' operation ('?=' oder 'MOVE ? TO')a type conflict occurred. The
source type '\CLASS=CL_CRM_BOL_ENTITY' is not compatible for assigning with the
target type '\INTERFACE=IF_BOL_ENTITY_COL'.
Current code:
lr_entity_cont ?= me->typed_context->builcontact->collection_wrapper->get_current( ).
lr_col ?= lr_entity_cont->get_related_entity( iv_relation_name = 'BuilGetHeaderforContactRel' ).
lv_iterator ?= lr_col->get_iterator( ).
lr_data_property = lv_iterator->get_first( ).
lv_group_email = lr_data_property->get_property_as_string( 'ZZAFLD00000Z' ).
Hi Tom,
I am right, u are navigating from BuilContact node ( Root object - BuilContactPerson ).
Via the relationship "BuilGetHeaderforContactRel" you are determining the Header data i.e, BuilHeader, in other words the customer.
U already have the contact person in the BuilContactPerson node.
-
Anish
Hi Tom,
Please try with the value of one contact person number in genil_bol_browser.
I found that if you use the relationship "BuilGetPersonforContactRel" i am able to get details of the contact person.
The attribute structure is also just as you asked for, its CRMST_HEADER_OBJECT_BUIL.
Hope it helps.
-
Anish
Kumar,
When I try your code i get a dump
Relation GetHeaderForContactRel is not (yet) supported
any Ideas?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It should be like:
Data: lr_iterator type ref to IF_BOL_ENTITY_COL_ITERATOR.
lr_entity_cont ?= me->typed_context->builcontact->collection_wrapper->get_current( ).
lr_col ?= lr_entity_cont->get_related_entity( iv_relation_name = 'GetHeaderForContactRel' ).
lr_iterator ?= lr_col->get_iterator( ).
lr_data_property = lr_iterator->get_first( ).
lv_group_email = lr_entity_cont->get_property_as_string( 'Group_email' ).
Thanks
Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.