on 06-12-2012 7:08 PM
Dear all,
Currently, in CRM 2007 i have a customized IC profile, that uses the component IUICMD for account creation.
When an account is created by an IC agent, the employee responsible is not set, and the relationship (is employee responsible) is not created between the USER and the ACCOUNT.
I would like to know how to set this relationship in customizing. Otherwise, if it has to be coded, is there a FM i can use?
Thanks in advance.
Hello everyone,
In the end, i implemented EH_ONSAVE, in component IUICMD/CreateOrg , IUICMD/CreatePerson , to create the relationship, using the following FM :
CALL FUNCTION 'BAPI_BUPR_RELATIONSHIP_CREATE'
EXPORTING
BUSINESSPARTNER1 = lv_bp
BUSINESSPARTNER2 = lv_bp_user
RELATIONSHIPCATEGORY = 'BUR011'
.
" Then it is necessary to call this FM to commit the changes.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
.
Thank you all for your replies.
Cheers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you check if this BADI is called when an account is created.
Badi : BADI_CRM_BP_UIU_DEFAULTS
Create an implementation for BADI_CRM_BP_UIU_DEFAULTS
Method : IF_UIU_BP_DEFAULTS~GET_DEFAULT_VALUES
Try if this method is being called in your case(IUICMD ) . If it is being called then you can code here
Hope it helps
Regards
Chandrakant Kulkarni
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Blaz,
You have to create an account first. Then you have to attach your user as an employee to this account. For that, you need to select the BP role employee in bp transaction. Then go to the identification tab->employee data, enter your employee number and user name.
Best Regards,
Leon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Leon,
Thanks for your reply. Actually what i am trying to achieve here is that for every new account created, the employee responsible is the user that is creating it.
This happens for instance when i log in with SALESPRO profile. The creation of new account is in component BP_HEAD, and by default there is a field employee responsible, that contains the current user.
Any idea?
Thanks again.
Hi Blaz,
If you want to default the user as an employee responsible to the account, then in the DO_PREPARE_OUTPUT method of view BP_HEAD/AccountDetails, get the current entity of context node EMPLOYEERESPONSIBLE and set the partner2 value ( check out partner1 if its filled then fill partner2 else vice versa)
Regards,
Nithish
Sorry Blaz. I missed out your earlier post.
If you want to replicate the same , then first you need to identify the view where Account creation is happening . Probably in the DO_PREPARE_OUTPUT of the view , you have to create the employee relationship entity via relation BuilEmpRelationRel .
Check out the method ON_NEW_FOCUS of context node EMPLOYEERESPONSIBLE in BP_HEAD. There you can see many checks are being performed. You can replicate the same and create the child entity and finally set the values in the created entity.
Regards,
Nithish
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.