Introduction
Prior to TaroWorks 7.3.X, TaroWorks Mobile Users were required to be on the Partner Community license. Partner Community users are linked to a contact record.
In TaroWorks 7.3.X, Salesforce and Platform license types are supported for the TaroWorks Mobile Users.
With this support for additional licenses, TaroWorks will no longer reference the Contact record that was associated with Partner Community users but will instead reference the User record associated with any mobile user on Partner Community, Salesforce, or Platform license type.
This has an impact on the following:
- A. Mobile Record Assignment - Prior to TaroWorks 7.3.X, mobile record assignment data was stored in the SobjectContactAssociation Object. Starting 7.3.X, it will be stored in the SobjectUserAssociation Object.
The only difference between these objects is that relationships with the Contact object are not relationships with the User object. If any customizations have been built related to mobile record assignment, please upgrade and make the adjustments in your Sandbox first before upgrading your Production instance. Please feel free to reach out to support for more information and support on the changes. - B. Performance module - In TaroWorks 7.3.X, the Job Targets and Performance Indicators in the Performance module can only be assigned to TaroWorks Mobile Users on Partner Community Licenses and not to TaroWorks Mobile Users on Platform or Salesforce licenses.
- C. Mapping Mobile User Metadata - In TaroWorks 7.3.X, field-mapping of the Mobile User row will utilize the First and Last name of the User record instead of the Contact record associated with the logged-in mobile user.
- D. Mobile Users tab - In TaroWorks 7.3.X, you must use the TaroWorks Mobile Users tab. The Mobile User tab that was associated with older versions will no longer be supported.
Before you Begin:
- You must be using the TaroWorks Mobile User tab, and no longer using the Mobile User tab.
- Log in as System Administrator (Customize Application and Modify All Data permissions enabled).
- Before proceeding with this upgrade, you will need to ensure that the Contact names and User names for all your TaroWorks Mobile Users are the same through the following steps.
-
- A. Prep for Contact to User records migration. - The Admin runs a script that will detect and clean up any records that may result in the second step failing.
- B. Update User records for TaroWorks Mobile Users. - The Admin runs a script that will copy the Contact FirstName and LastName to the User FirstName and LastName respectively for all active TaroWorks Mobiel Users to ensure that the Contact names and User names for all mobile users are the same.
-
A. Prep for Contact to User records migration.
- Go to Setup > Developer Console.
- Click Debug >Open Execute Anonymous Window.
- Copy and paste the below script on the Enter Apex Code pane.
List<gfsurveys__SobjectContactAssociation__c> sobjList = new List<gfsurveys__SobjectContactAssociation__c>();
Set<Id> contactIds = new Set<Id>();
for(gfsurveys__SobjectContactAssociation__c sobj : [Select Id, gfsurveys__UniqueKey__c, gfsurveys__Contact__c From gfsurveys__SobjectContactAssociation__c]){
if(!sobj.gfsurveys__UniqueKey__c.contains((String)sobj.gfsurveys__Contact__c)){
sobjList.add(sobj);
contactIds.add(sobj.gfsurveys__Contact__c);
String temp = sobj.gfsurveys__UniqueKey__c.split('_',2)[1];
sobj.gfsurveys__UniqueKey__c = (String)sobj.gfsurveys__Contact__c + '_' + temp;
}
}
if(sobjList.size() > 0){
System.debug('List of Sobject Contact Associations to be fixed : '+ sobjList);
update sobjList;
}
if(contactIds.size() > 0){
System.debug('Contact Ids causing issues: '+contactIds);
} - Click Execute.
Note :
- If the script is not run before the upgrade and there are any orphan data present in your organization, then the batch migration script will fail.
- If you have concerns about updating your TaroWorks Mobile User records to match the first and last name values on the Contact record, please reach out to TaroWorks Support.
B. Update User records for TaroWorks Mobile Users.
- Go to Setup > Developer Console.
- Click Debug >Open Execute Anonymous Window.
- Copy and paste the below script on the Enter Apex Code pane.
String query =
'SELECT Id, gfsurveys__Contact__c,gfsurveys__Contact__r.FirstName,gfsurveys__Contact__r.LastName, gfsurveys__User__c,gfsurveys__User__r.FirstName, gfsurveys__User__r.LastName FROM gfsurveys__TaroWorks_Mobile_User__c WHERE gfsurveys__Active__c = true AND gfsurveys__User__r.UserType = \'PowerPartner\' '
;
List<gfsurveys__TaroWorks_Mobile_User__c> tMURecords = Database.query(query);
List<User> usersToUpdate =
new
List<User>();
if
(tMURecords.size() >
0
){
for
(gfsurveys__TaroWorks_Mobile_User__c tmu:tMURecords){
if
(tmu.gfsurveys__Contact__r.FirstName != tmu.gfsurveys__User__r.FirstName || tmu.gfsurveys__Contact__r.LastName != tmu.gfsurveys__User__r.LastName){
User objUser =
new
User();
objUser.Id = tmu.gfsurveys__User__c;
objUser.FirstName = tmu.gfsurveys__Contact__r.FirstName;
objUser.LastName = tmu.gfsurveys__Contact__r.LastName;
usersToUpdate.add(objUser);
}
}
if
(usersToUpdate.size() >
0
){
update usersToUpdate;
}
}
- Click Execute.
Note :
- If the script is not run before the upgrade and a user upgrades to 7.3.X, TaroWorks Mobile Users might get an error while syncing to Forms where the Mobile User field is mapped in the form.
- If you have concerns about updating your TaroWorks Mobile User User records to match the first and last name values on the Contact record, please reach out to TaroWorks Support.
Conclusion
Congratulations, you have successfully updated User Records for the TaroWorks Mobile Users!
Please continue to the next step of your upgrade: 02. Upgrade TaroWorks in Salesforce.
Comments
0 comments
Please sign in to leave a comment.