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

B2BUnit creation programatically with a nonadmin user

Former Member
0 Kudos
691

Hi,

We have a requirement where B2BUnit and B2B customer details will be captured through Hybris storefront and will be passed to SAP CRM. If the customer and contact person created successfully in CRM then the same has to be created/stored in Hybris as B2BUnit and B2BCustomer. When we are trying to save the B2BUnit details we are getting the error "Only member of an 'admingroup' can create a top level Organization". I think we need to make sure to avoid executing the below logic.

if (ctx.getModelService().isNew(model) && this.getB2bUnitService().getParent(unit) == null && !this.getUserService().isMemberOfGroup(this.getUserService().getCurrentUser(), this.getUserService().getAdminUserGroup())) { throw new InterceptorException( this.getL10NService().getLocalizedString("error.b2bunit.root.create.nonadmin")); }.

Can you please help us in overriding this or any other possible solution to avoid this error programatically?

Thanks and Regards, Sumanth

View Entire Topic
mansurarisoy
Contributor
0 Kudos

You can check this document about Disabling Interceptors: https://help.hybris.com/6.5.0/hcd/9ce1b60e12714a7dba6ea7e66b4f7acd.html

Former Member
0 Kudos

Thanks Venkateswarlu and Ahmet for your suggestions. it worked.

AnkitGoyal1
Newcomer
0 Kudos
This Link is not working, Can someone please help with the exact steps or new link for the Information.