2
votes

I'm trying to extend the OOTB Impex to remove customersupportagentrole from customersupportmanagergroup but it not working. Please help.

this is OOB Impex.

INSERT_UPDATE CsAgentGroup;UID[unique=true];locname[lang=en];groups(uid)[mode=append];description
;customersupportmanagergroup;Customer Support Manager Group;customersupportmanagerrole,customersupportagentrole,csagentgroup,csagentmanagergroup;The Customer Support Manager Group has access to the Customer Support Backoffice's Customer Support Manager Group and Customer Support Agent Group views AND/OR the Assisted Service Module.
;customersupportagentgroup;Customer Support Agent Group;customersupportagentrole,csagentgroup;The Customer Support Agent Group has access to the Customer Support Backoffice's Customer Support Agent Group views and AND/OR the Assisted Service Module.

this is my Impex to remove customersupportagentrole from customersupportmanagergroup

INSERT_UPDATE CsAgentGroup;UID[unique=true];locname[lang=en];groups(uid)[mode=append];description
;customersupportmanagergroup;Customer Support Manager Group;customersupportmanagerrole,csagentgroup,csagentmanagergroup;The Customer Support Manager Group has access to the Customer Support Backoffice's Customer Support Manager Group and Customer Support Agent Group views AND/OR the Assisted Service Module.
;customersupportagentgroup;Customer Support Agent Group;customersupportagentrole,csagentgroup;The Customer Support Agent Group has access to the Customer Support Backoffice's Customer Support Agent Group views and AND/OR the Assisted Service Module.
4

4 Answers

3
votes

You are using mode=append which basically append your values to the existing collection(groups). In your case, some Impex(OOTB) may already add customersupportagentrole to customersupportmanagergroup before your Impex gets executed. Now your Impex will not override existing value, it just appends. So try using mode=replace, which basically override existing values.

INSERT_UPDATE CsAgentGroup; UID[unique=true]            ; groups(uid)[mode=replace]                                   ;                  
                          ; customersupportmanagergroup ; customersupportmanagerrole,csagentgroup,csagentmanagergroup ;                  
                          ; customersupportagentgroup   ; customersupportagentrole,csagentgroup                       ;                  
2
votes

You need to remove for existing items in your impex.

Below code remove CsAgentGroup item (thanks @FarrukChishti for your attention)

REMOVE CsAgentGroup;UID[unique=true];groups(uid)
;customersupportmanagergroup;customersupportagentrole

We need to remove only relation so we can remove item from relation type like below or update existing like other answers.

REMOVE PrincipalGroupRelation;source[unique=true](uid);target[unique=true](uid)
;customersupportmanagergroup;customersupportagentrole
2
votes

You can do it like this, if you don't use the mode operator in groups it will replace the collection with the componenets you specify

INSERT_UPDATE CsAgentGroup; UID[unique = true] ; groups(uid) ;; customersupportmanagergroup;csagentgroup,csagentmanagergroup;

or if you put [mode=remove] it will delete the component you specify

INSERT_UPDATE CsAgentGroup; UID[unique = true] ; groups(uid) [mode=remove] ;; customersupportmanagergroup;customersupportmanagerrole;

0
votes

You want to update customersupportmanagergroup so that any link connecting customersupportmanagergroup to customersupportagentrole is removed while the customersupportagentrole still exists in database. Using remove query will delete customersupportagentrole from database.

UPDATE CsAgentGroup;UID[unique=true];groups(uid)
;customersupportmanagergroup;customersupportmanagerrole,csagentgroup,csagentmanagergroup