Cause
If you use custom profiles (not the TaroWorks Partner User profile) for your mobile users and are upgrading from TaroWorks 6.1.X to 6.2.X, you will need to perform an additional step to convert your mobile users for TaroWorks 6.2.x. Please use the follow steps to get your TaroWorks Mobile User records generated for all your custom profiles.
Note: your mobile users' TaroWorks usage is not affected by this issue.
Solution
Before you begin:
- You must have completed articles 01 and 02 in Upgrading to TaroWorks 6.2.x
- Go to Setup > Developer Console.
- Click Debug > Open Execute Anonymous Window.
- Copy and Paste the following code:
// Query the count of taroworks partner users
Integer partnerUserCount = [
SELECT
Count()
FROM
User
WHERE
Profile.UserType = 'PowerPartner'
AND
Profile.Name LIKE '%TaroWorks%'
];
if(partnerUserCount > 0) {
Boolean isContactHaveActiveRecordTypes = false;
List<RecordType> contactRecordTypes =
[SELECT Id FROM RecordType WHERE sObjectType = 'Contact' AND IsActive = true];
// If script executed for all users
List<Id> userIdList = new List<Id>();
// If batch is executed for specific user then uncomment below line,
//add user ids and comment out the above line
// List<Id> userIdList = new List<Id>{'<user Ids>'};
String query =
'SELECT ' +
'ProfileId, ' +
'Profile.Name, ' +
'Name, ' +
'Username, ' +
'ContactId, ' +
'Contact.Salutation, ' +
'Contact.FirstName, ' +
'Contact.LastName, ' +
'Contact.AccountId, ' +
'Contact.Phone, ' +
'Contact.MobilePhone, ' +
'Email, ' +
'IsActive, '+
'Alias, ' +
'LanguageLocaleKey, ' +
'UserRole.Name ';
if(contactRecordTypes.size() > 0) {
isContactHaveActiveRecordTypes = true;
query +=
', Contact.RecordType.Name ';
}
query +=
'FROM ' +
'User ' +
'WHERE ' +
'Profile.UserType = \'PowerPartner\' ' +
'AND ' +
'Profile.Name LIKE \'%TaroWorks%\' ' +
'AND ' +
'Id NOT IN ( ' +
'SELECT ' +
'gfsurveys__User__c ' +
'FROM ' +
'gfsurveys__TaroWorks_Mobile_User__c ' +
')';
if(userIdList.size() > 0) {
query += ' AND ' +
'Id IN :userIdList';
}
List<User> listofUsers = Database.query(query);
gfsurveys.BatchToInsertTaroworksMobileUserRecords batchInstance =
new gfsurveys.BatchToInsertTaroworksMobileUserRecords(UserInfo.getUserId());
batchInstance.start(null);
batchInstance.execute(null, listofUsers);
batchInstance.Finish(null);
}
Note: TaroWorks Mobile Users should be on a profile containing the string "TaroWorks".
4. Click Execute.
5. Verify you can view your users in the TaroWorks Mobile User tab. If not, please submit a ticket with TaroWorks Support.
Comments
0 comments
Please sign in to leave a comment.