Introduction
Before you begin:
- To use the new TaroWorks Mobile User management functionality in 6.2, your TaroWorks Administrators need to be use the Salesforce Lightning Experience. You should only perform the steps in this article if your TaroWorks Administrators are using Lighting.
- If they are still using Salesforce Classic, you will not be able to use the enhanced functionality and have to skip this step and proceed to Disable Caching (Optional).
- Once you do start using the Lightning experience you can return to this article to enable the enhanced mobile user management features
There are multiple updates that need to be made to the TaroWorks Mobile User object. These updates will allow you to setup your Mobile Users efficiently with already existing settings in your org. This article will cover the following:
- A. Set up Profiles to be selected - active picklist values should contain custom profiles you use for TaroWorks Mobile Users.
- B. Set up Roles to be selected - active picklist values should contain roles you use for TaroWorks Mobile Users.
- C. Updates for Contact Record Types (Optional) - if you use record types for your Contact object, you'll need to make updates to the TaroWorks Mobile User field and page layout.
- D. Converting Mobile Users on Custom Profiles - if you use any profiles other than the TaroWorks Partner User profile for your mobile users, there is one additional step to be able to manage them in the TaroWorks Mobile User tab.
A. Set up Profiles
- From the Setup menu, search and click on TaroWorks Mobile User in the search bar at the top of the page.
- Select Fields and Relationships.
- Enter "Profile" in the Quick Find bar and click on Profile.
- Deactivate any custom profiles you do not use for your TaroWorks Mobile users.
- To add new profiles you use for your TaroWorks Mobile Users, click New.
- Add the name of profiles you use for your TaroWorks Mobile Users.
- Save.
B. Set up Roles
- From the Setup menu, search and click on TaroWorks Mobile User in the search bar at the top of the page.
- Select Fields and Relationships.
- Enter "Role" in the Quick Find bar and click on Role.
- Scroll down to Values and click New.
- Add the name of roles you use for your TaroWorks Mobile Users.
- Click Del next to the "TaroWorks" option.
C. Updates for Contact Record Types (Optional)
- From the Setup menu, search and click on TaroWorks Mobile User in the search bar at the top of the page.
- Select Fields and Relationships.
- Select Contact Record Type.
- Scroll down to Values and click New.
- Add any additional record types you use for Contacts for TaroWorks Mobile Users.
- Click Save.
- If you do not have a record type called 'TaroWorks', click Del next to this option.
-
Click Page Layouts and Select TaroWorks Mobile User Layout.
-
Select Fields from left pane and drag Contact Record Type field to the Contact Detail section.
- Click Save.
- To add the Contact Record Type to Field Sets, select Fields Sets from the details column.
- Select Contact Detail Field Set.
- Drag the Contact Record Type field to the Field set list.
- Click on Save.
-
Repeat steps 11-14 to add the Contact Record Type to Contact Edit Field Set and Contact View Field Set.
D. Converting Mobile Users on Custom Profiles
- If you only use the TaroWorks Partner User profile for your mobile users, you can skip this section. If you use custom profiles for your mobile users, proceed to 2.
- Go to Setup > Developer Console.
- Click Debug > Open Execute Anonymous Window.
- Copy and Paste the following:
// 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".
5. Click Execute.
Conclusion
Congratulations you've updated the TaroWorks Mobile User object for your org. Please continue to 03. Update Contact Layout Updates.
Comments
0 comments
Please sign in to leave a comment.