SAP Hybris Marketing / Access Partner ID in email action - abap

I am customizing the Hybris marketing email personalisation in class CL_CUAN_MKT_EXEC_EXECUTE_EMAIL (Superclass CL_CUAN_MKT_EXEC_EXECUTE_ACTN).
I wonder if I can access the Business Partner IDs of the target group members within this class. I could only manage to find the member key in MT_TG_MEMBERS (length 16), but I need the Partner ID (length 10). In the email action the member key is stored in lt_pers_content (see screenshot). Any ideas?

Check table lt_exec_member_status. It contains the CONTACT_KEY and the TG_MEMBER_KEY. This way you can find out the CONTACT_KEY which gives you the key to the Business Partner.

Related

Odoo: Is it possible to use the same Bank Account for multiple Contacts?

I was importing my creditor list from another system into Odoo 12 Community version and found out, that it is not possible to use the same account number for a Contact:
duplicate key value violates unique constraint "res_partner_bank_unique_number"
That means, that field acc_number on res.partner.bank model must be unique?
I have some creditors, that share Bank Accounts. How to enable possibility to choose multiple Contacts for one Bank Account? Is that even possible? Is there any module for it?
The possible solution would be to change sql_constraints for res.partner.bank model as it was done here: https://github.com/wtaferner/odoo/commit/326727bbd7161f6c2af68009d3d9fc924772d665
to
_sql_constraints = [
('unique_number', 'unique(sanitized_acc_number, company_id, partner_id)', 'Account Number must be unique for Partner'),
]

Challenge with multiple B2BUnit

We have come across a situation while working on a implementation, below is the sequence of requirement
Some of the users (B2BCustomer), have access to more than one SoldTo (B2BUnit) in the system
Before starting of the commerce journey, user has to choose a SoldTo
Selected SoldTo then marked as ‘DefaultB2BUnit’
Rest of the commerce journey (PLP, Cart, Checkout and Order) is based on selected SoldTo
The challenge here is due to ‘branch’ restriction, user has access to only SoldTo set as ‘DefaultB2BUnit’ and none of the OOTB service let us get the list of all B2BUnit assigned and change the user’s selected one as default.
Is there any service available through which we can retrieve all SoldTo’s (B2BUnit) assigned to the user and set one as default after login
You need to create B2Bunit and assigned it to the B2BCustomer group then all you can read all the groups.
Please try following method:
/**
* Assigns a default unit for a customer who may be a member of multiple units. and modifies a branch for this
* customers session based on the unit
*
* #param customer
* The current customer
* #param unit
* A {#link B2BUnitModel} to be assigned as the default for a customer
*/
void setCurrentUnit(B2BCustomerModel customer, B2BUnitModel unit);
As per your requirement, you need to remove the branch restriction.
branch restriction allows customers to access data of their b2b unit and its descendants within one organization hierarchy.
If you don't have a hierarchical structure of b2b units then the branch restriction shouldn't be relevant and can be disabled.
Once you will disable the restriction, then I think your requirement can be implemented easily.

Hide dimension based on login

I have a BO4.1 environment that has been build by my predecessor (who is unreachable).
There are 2 universes.
Both are based on the same sourcetable.
Both contain the same clientdata (name, adress SSN).
I have two usergroups: TESTUSERS (standard-user) and POWERUSERS (admin)
When making a report through Webi usersin the group TESTUSERS can see the SSN in Universe A but cannot see the SSN in Universe B. TESTUSERS should not be able to see the SSN in Universe A.
POWERUSERS are allowed to see that data.
For the love of StackOverflow I cannot find out how to the SSN is hidden in universe B (how it should be). How do I hide/show dimensions based on the group the login belongs to?
To be clear: the SSN should not be selectable for group TESTUSERS when creating/modifying a report. This question is not about how to hide the SSN in reports
For unx universes, objects can be hidden from certain user groups via Business Security Profiles. In IDT, go to Window -> Security Editor, and log in to the session that the universe is in. In the "Universes / Profiles" dialog, navigate to the universe that currently has the restriction applied. Underneath that universe should be at least one security profile. From here, you can edit it or view/change the groups it applies to. To add the same restriction to the other universe, select that other universe and then click the "Insert Business Security Profile" icon above the universe list.

LDAP SQL Extraction - "If" in AD group extract email

I have an OU with users within. I want to extract all the emails of those users. I'm using Softerra LDAP explorer. It seems that the extract option doesn't allow to do this "the easy way". So I'm looking at an SQL command to do this.
"cn=xxxx,ou=users,ou=sync,ou=accounts,dc=xx,dc=xxx,dc=net" this is a user. The email is in the "email" field.
The group is here: "CN=group,OU=server,DC=xx,DC=xxx,DC=net",ou=users,ou=sync,ou=accounts,dc=xx,dc=xxx,dc=net"
What command should allow extracting all "email" fields for only users within the group "group" ?
Would be very helpful
It depends on what is the entry
CN=group,OU=server,DC=xx,DC=xxx,DC=net",ou=users,ou=sync,ou=accounts,dc=xx,dc=xxx,dc=net
As you suggest by :
only users within the group "group"
It is a group with members, and a cross reference (ie. on each user entry you have a kind of memberOf attribute which contains the dn of the groups he is in)
Then you can search all users which match the filter :
(memberOf=CN=group,OU=server,DC=xx,DC=xxx,DC=net",ou=users,ou=sync,ou=accounts,dc=xx,dc=xxx,dc=net) and retrieve the mails attributes
If the directory you use does not maintain group membership, you will have to retrieve the users members DN, and make another request to retrieve the mails attributes of all these members
As you suggest by :
I have an OU with users within
It is a branch and all the users you want to retrieve are under this branch
Then you just have to search all the users under the subtree corresponding to this branch and retrieving the mails attributes.

Ldap User - Group Sync

I'm using Sun Directory server v5.2.
I have three attributes: designation, role.
I am using a tool using which when i create a create/modify user entry with designation filled, a unique member is added to a group 'Members'.
Now, there are circumstances where
Scenario1:
* Creating/ Modifying user entry is not done via the tool and so unique member for this user entry is not added to the group 'Members'.
Scenario2:
* When user the designation attribute is deleted, group entry is not deleted.
This is causing inconsistency in the users and the group.
How can i resolve this?
Thanks,
Sash.