1.First, you must use Select resourceid from resource where userathost = 'ddddddd ',Find the contacts you want to add and the contactsResourceid.
2.SearchTable contactgroup,Find all your records and write down the records
Select * From contactgroup where ownerid = xxx --- xxxIt's yours.Resourceid
3.In your ownOCSAdd a group
4.InTable contactgroupFindDislayname,The method is
Select * From contactgroup where ownerid = xxx ---- xxxIt's yours.Resourceid
Find the new line and write downDislaynamFor example0xe8b387e8a88ae782bae682a8e69c8de58b99
5.Insert into contactgroup values (XXX1, 999, 0xe8b387e8a88ae782bae682a8e69c8de58b99, 0x)
XXX1You want to add Contacts.Ownerid, That isResourceid,999YesGroupid,Do not take1And others. In order not to conflict with the original user999The third section is the name of the group you want to add. I don't know what the last code is, but I found that the system is0x
6. insert into contactgroupassoc values (XXX1, xxx2, 999)
Where,XXX1You want to add Contacts for that user.Ownerid, xxx2You want to addXXX1Contact.
Now, the added contacts are displayed after you log on again.
Based on the above method, you can add Contacts in batches or even writeTrigger,Automatically add Contacts to new users or add new contacts when they are deleted.
In addition to this method, you can also modify the stored procedure that comes with the system to complete the above work.