• Tamurth
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 8
    Replies

Is it possible to make multi-radio buttons alignment like displayed in the following link. I would like to display questions as multi-radio buttons in a visualforce page. The questions should be displayed without titles, and only one header for all the questions.  

 

Link to the image: https://docs.google.com/open?id=0B5RulK-LtShFcTVueDZfUXJqWTA

 

Thanks for help,

 

All the bet,

 

Anzar.

 

 

 

Dear All,

 

Could you help by providing a test class for my trigger and APEX classes ?

 

I can't get any coverage when i run my test class.

 

Trigger:

 

trigger UserCreationBeforeUpdate on UserCreationDetail__c (before update) {
    System.Debug('## >>> User before update <<< run by ' + UserInfo.getName());

    /*********************************************************************************************
     AP41UserCreation 
        Create/Update . Designed for VF40_UserRequestProcess
    **********************************************************************************************/
    if(PAD.canTrigger('AP64')){
        System.Debug('## AP64UserProcess begin prepare');   
        List<UserCreationDetail__c> ap64UserCreation = new List<UserCreationDetail__c>();
        
        //List<UserCreationDetail__c> ap64UserUpdate = new List<UserCreationDetail__c>();
        
        Set<Id> ap64UserUpdate = new Set<Id>();
            
        for(UserCreationDetail__c usr: Trigger.new) {
            if (usr.Status__c != Trigger.OldMap.get(usr.id).Status__c && usr.Status__c == 'Implemented') {
                if (usr.Type__c == 'Creation') {
                    ap64UserCreation.add(usr);
                } else {
                    //ap64UserUpdate.add(usr);
                    ap64UserUpdate.add(usr.id);
                }
            }
        }
            
        System.Debug('## AP64UserProcess end prepare');
        
        if(ap64UserCreation.size() > 0)
            AP64UserManagementProcess.createUser(ap64UserCreation);
                
        if(ap64UserUpdate.size() > 0)
            AP64UserManagementProcess.updateUser(ap64UserUpdate);
    
        System.Debug('## >>> User Creation before update : END <<<');
    }
}

 APEX:

 

public class AP64UserManagementProcess {
    //static List<User> usersToUpdate = new List<User>();
    public static void createUser(List<UserCreationDetail__c> users) {
        List<User> usersToInsert = new List<User>();
        try {
            for (UserCreationDetail__c userRequest: users) {
                User user = new User();
                user.EmployeeNumber             =             userRequest.EmployeeNumber__c ;
                user.FirstName                  =             userRequest.FirstName__c ;
                user.LastName                   =             userRequest.LastName__c ;
                user.Email                      =             userRequest.Email__c ;
                user.username                   =             userRequest.username__c ;
                user.UserRoleId                 =             userRequest.RoleId__c ;               
                user.ProfileId                  =             userRequest.ProfileId__c ;
                user.TechManagerId__c           =             userRequest.Manager__c ;
                user.Title                      =             userRequest.Title__c ;
                user.CompanyName                =             userRequest.CompanyName__c ;
                user.Department                 =             userRequest.Department__c ;
                user.Division                   =             userRequest.Division__c ;
                user.EmailEncodingKey           =             userRequest.EmailEncoding__c ;
                user.userCountry__c             =             userRequest.userMainCountry__c ;
                user.userArea__c                =             userRequest.userMainArea__c ;
                user.ISORegion__c               =             userRequest.userMainRegion__c ;
                user.userMainCountrySubArea__c  =             userRequest.userMainCountrySubArea__c ;
                user.userSubRegion__c           =             userRequest.userMainSubRegion__c ;
                user.OtherRegions__c            =             userRequest.OtherRegions__c ;
                user.KeyuserType__c             =             userRequest.KeyuserType__c ;
                user.Champion__c                =             userRequest.Champion__c ;
                user.userProductLine__c         =             userRequest.userMainProductLine__c ;
                user.userUnit__c                =             userRequest.userMainUnit__c ;
                user.FinancialUnitId__c         =             userRequest.FinancialUnitId__c ;
                user.eLearning__c               =             userRequest.eLearning__c ;
                user.OtherProductLines__c       =             userRequest.OtherProductLines__c ;
                user.TimeZoneSidKey             =             userRequest.TimeZone__c ;
                user.LocaleSidKey               =             userRequest.Language__c ;
                user.LanguageLocaleKey          =             userRequest.Locale__c ;
                user.CurrencyIsoCode            =             userRequest.Currency__c ;
                user.CarveOutComments__c        =             userRequest.Comments__c ;
                user.Alias                      =             userRequest.Alias__c ;
                user.CommunityNickname          =             userRequest.CommunityNickname__c ;
                user.UserPermissionsMobileUser = false;
                usersToInsert.add(user);
            }
                
            //Create users
            insert usersToInsert;
            
            //RESET PASSWORD
            for (User u: usersToInsert)
                System.resetPassword(u.Id, true);
        } catch (DmlException e) {
            system.debug(Logginglevel.ERROR, e);
        } 
    }
    
    @future
    public static void updateUser(Set<Id> userDetail) {
        try {
            for (Id userId : userDetail) {
                UserCreationDetail__c userRequest = [SELECT Email__c,EmployeeNumber__c,FirstName__c,LastName__c,RoleId__c,ProfileId__c,
                                                    Manager__c,Title__c,CompanyName__c,Department__c,Division__c,EmailEncoding__c,userMainCountry__c,
                                                    userMainArea__c,userMainRegion__c,userMainCountrySubArea__c,userMainSubRegion__c,OtherRegions__c,
                                                    KeyuserType__c,Champion__c,userMainProductLine__c,userMainUnit__c,FinancialUnitId__c,eLearning__c,
                                                    OtherProductLines__c,TimeZone__c,Language__c,Locale__c,Currency__c,Comments__c,Alias__c,CommunityNickname__c
                                                     FROM UserCreationDetail__c WHERE Id = :userId];
                User user = [SELECT Id FROM User WHERE Email = :userRequest.Email__c LIMIT 1];
                user.EmployeeNumber             =             userRequest.EmployeeNumber__c ;
                user.FirstName                  =             userRequest.FirstName__c ;
                user.LastName                   =             userRequest.LastName__c ;
                //user.Email                      =             userRequest.Email__c ;
                //user.username                   =             userRequest.username__c ;
                user.UserRoleId                 =             userRequest.RoleId__c ;               
                user.ProfileId                  =             userRequest.ProfileId__c ;
                user.TechManagerId__c           =             userRequest.Manager__c ;
                user.ManagerId                  =             userRequest.Manager__c ;
                user.Title                      =             userRequest.Title__c ;
                user.CompanyName                =             userRequest.CompanyName__c ;
                user.Department                 =             userRequest.Department__c ;
                user.Division                   =             userRequest.Division__c ;
                user.EmailEncodingKey           =             userRequest.EmailEncoding__c ;
                user.userCountry__c             =             userRequest.userMainCountry__c ;
                user.userArea__c                =             userRequest.userMainArea__c ;
                user.ISORegion__c               =             userRequest.userMainRegion__c ;
                user.userMainCountrySubArea__c  =             userRequest.userMainCountrySubArea__c ;
                user.userSubRegion__c           =             userRequest.userMainSubRegion__c ;
                user.OtherRegions__c            =             userRequest.OtherRegions__c ;
                user.KeyuserType__c             =             userRequest.KeyuserType__c ;
                user.Champion__c                =             userRequest.Champion__c ;
                user.userProductLine__c         =             userRequest.userMainProductLine__c ;
                user.userUnit__c                =             userRequest.userMainUnit__c ;
                user.FinancialUnitId__c         =             userRequest.FinancialUnitId__c ;
                user.eLearning__c               =             userRequest.eLearning__c ;
                user.OtherProductLines__c       =             userRequest.OtherProductLines__c ;
                user.TimeZoneSidKey             =             userRequest.TimeZone__c ;
                user.LocaleSidKey               =             userRequest.Language__c ;
                user.LanguageLocaleKey          =             userRequest.Locale__c ;
                user.CurrencyIsoCode            =             userRequest.Currency__c ;
                user.CarveOutComments__c        =             userRequest.Comments__c ;
                user.Alias                      =             userRequest.Alias__c ;
                user.CommunityNickname          =             userRequest.CommunityNickname__c ;
                user.IsActive = true;
                
                update user;
            }
                
            //RESET PASSWORD
            /*for (User u: usersToUpdate)
                System.resetPassword(u.Id, true);*/
        } catch (DmlException e) {
            system.debug(Logginglevel.ERROR, e);
        } 
    }
}

 

Thank's for help,

 

All the best,

 

Anzar.

  • September 22, 2012
  • Like
  • 0

Hi,

 

Any help to get 75% code coverage:

 

Controller class

 

All the best,

Hi,

 

How to get a matrix table (like a matrix report with two grouping columns) in a visualforce page ? The matrix table should be like follwing image (colors is just for information):

 

Contractors/PLs

PL 1

PL 2

PL 3

PL 4

Contractor 1

Stage 1

Stage 1

Stage 1

 

Contractor 2

 

Stage 2

Stage 3

Stage 5

Contractor 3

 

 

Stage 4

 

Contractor 4

    

 

First line (Blue) --> get values for custom field PL__c (this is the first dimension

First column (green) --> get values for custom field Contractor__c (the the second dimension)

Content of the other cells (Orange) --> Stage__c

 

Except the top cell which will be the header (Red).

 

All the best,

 

Anzar,

Hi,

 

I have a requirement to hide a checkbox field depending on some PL values. Is it possible without java script or visualforce?

 

We use the standard opportunity page, and we would like to hide (or make the field read only) a custom checkbox field at the Opportunity level for all the stages except "Closed-Cancelled" and "Closed-No Bid".

 

Many thanks for help.

 

All the best,

 

Anzar

Is it possible to make multi-radio buttons alignment like displayed in the following link. I would like to display questions as multi-radio buttons in a visualforce page. The questions should be displayed without titles, and only one header for all the questions.  

 

Link to the image: https://docs.google.com/open?id=0B5RulK-LtShFcTVueDZfUXJqWTA

 

Thanks for help,

 

All the bet,

 

Anzar.

 

 

 

Dear All,

 

Could you help by providing a test class for my trigger and APEX classes ?

 

I can't get any coverage when i run my test class.

 

Trigger:

 

trigger UserCreationBeforeUpdate on UserCreationDetail__c (before update) {
    System.Debug('## >>> User before update <<< run by ' + UserInfo.getName());

    /*********************************************************************************************
     AP41UserCreation 
        Create/Update . Designed for VF40_UserRequestProcess
    **********************************************************************************************/
    if(PAD.canTrigger('AP64')){
        System.Debug('## AP64UserProcess begin prepare');   
        List<UserCreationDetail__c> ap64UserCreation = new List<UserCreationDetail__c>();
        
        //List<UserCreationDetail__c> ap64UserUpdate = new List<UserCreationDetail__c>();
        
        Set<Id> ap64UserUpdate = new Set<Id>();
            
        for(UserCreationDetail__c usr: Trigger.new) {
            if (usr.Status__c != Trigger.OldMap.get(usr.id).Status__c && usr.Status__c == 'Implemented') {
                if (usr.Type__c == 'Creation') {
                    ap64UserCreation.add(usr);
                } else {
                    //ap64UserUpdate.add(usr);
                    ap64UserUpdate.add(usr.id);
                }
            }
        }
            
        System.Debug('## AP64UserProcess end prepare');
        
        if(ap64UserCreation.size() > 0)
            AP64UserManagementProcess.createUser(ap64UserCreation);
                
        if(ap64UserUpdate.size() > 0)
            AP64UserManagementProcess.updateUser(ap64UserUpdate);
    
        System.Debug('## >>> User Creation before update : END <<<');
    }
}

 APEX:

 

public class AP64UserManagementProcess {
    //static List<User> usersToUpdate = new List<User>();
    public static void createUser(List<UserCreationDetail__c> users) {
        List<User> usersToInsert = new List<User>();
        try {
            for (UserCreationDetail__c userRequest: users) {
                User user = new User();
                user.EmployeeNumber             =             userRequest.EmployeeNumber__c ;
                user.FirstName                  =             userRequest.FirstName__c ;
                user.LastName                   =             userRequest.LastName__c ;
                user.Email                      =             userRequest.Email__c ;
                user.username                   =             userRequest.username__c ;
                user.UserRoleId                 =             userRequest.RoleId__c ;               
                user.ProfileId                  =             userRequest.ProfileId__c ;
                user.TechManagerId__c           =             userRequest.Manager__c ;
                user.Title                      =             userRequest.Title__c ;
                user.CompanyName                =             userRequest.CompanyName__c ;
                user.Department                 =             userRequest.Department__c ;
                user.Division                   =             userRequest.Division__c ;
                user.EmailEncodingKey           =             userRequest.EmailEncoding__c ;
                user.userCountry__c             =             userRequest.userMainCountry__c ;
                user.userArea__c                =             userRequest.userMainArea__c ;
                user.ISORegion__c               =             userRequest.userMainRegion__c ;
                user.userMainCountrySubArea__c  =             userRequest.userMainCountrySubArea__c ;
                user.userSubRegion__c           =             userRequest.userMainSubRegion__c ;
                user.OtherRegions__c            =             userRequest.OtherRegions__c ;
                user.KeyuserType__c             =             userRequest.KeyuserType__c ;
                user.Champion__c                =             userRequest.Champion__c ;
                user.userProductLine__c         =             userRequest.userMainProductLine__c ;
                user.userUnit__c                =             userRequest.userMainUnit__c ;
                user.FinancialUnitId__c         =             userRequest.FinancialUnitId__c ;
                user.eLearning__c               =             userRequest.eLearning__c ;
                user.OtherProductLines__c       =             userRequest.OtherProductLines__c ;
                user.TimeZoneSidKey             =             userRequest.TimeZone__c ;
                user.LocaleSidKey               =             userRequest.Language__c ;
                user.LanguageLocaleKey          =             userRequest.Locale__c ;
                user.CurrencyIsoCode            =             userRequest.Currency__c ;
                user.CarveOutComments__c        =             userRequest.Comments__c ;
                user.Alias                      =             userRequest.Alias__c ;
                user.CommunityNickname          =             userRequest.CommunityNickname__c ;
                user.UserPermissionsMobileUser = false;
                usersToInsert.add(user);
            }
                
            //Create users
            insert usersToInsert;
            
            //RESET PASSWORD
            for (User u: usersToInsert)
                System.resetPassword(u.Id, true);
        } catch (DmlException e) {
            system.debug(Logginglevel.ERROR, e);
        } 
    }
    
    @future
    public static void updateUser(Set<Id> userDetail) {
        try {
            for (Id userId : userDetail) {
                UserCreationDetail__c userRequest = [SELECT Email__c,EmployeeNumber__c,FirstName__c,LastName__c,RoleId__c,ProfileId__c,
                                                    Manager__c,Title__c,CompanyName__c,Department__c,Division__c,EmailEncoding__c,userMainCountry__c,
                                                    userMainArea__c,userMainRegion__c,userMainCountrySubArea__c,userMainSubRegion__c,OtherRegions__c,
                                                    KeyuserType__c,Champion__c,userMainProductLine__c,userMainUnit__c,FinancialUnitId__c,eLearning__c,
                                                    OtherProductLines__c,TimeZone__c,Language__c,Locale__c,Currency__c,Comments__c,Alias__c,CommunityNickname__c
                                                     FROM UserCreationDetail__c WHERE Id = :userId];
                User user = [SELECT Id FROM User WHERE Email = :userRequest.Email__c LIMIT 1];
                user.EmployeeNumber             =             userRequest.EmployeeNumber__c ;
                user.FirstName                  =             userRequest.FirstName__c ;
                user.LastName                   =             userRequest.LastName__c ;
                //user.Email                      =             userRequest.Email__c ;
                //user.username                   =             userRequest.username__c ;
                user.UserRoleId                 =             userRequest.RoleId__c ;               
                user.ProfileId                  =             userRequest.ProfileId__c ;
                user.TechManagerId__c           =             userRequest.Manager__c ;
                user.ManagerId                  =             userRequest.Manager__c ;
                user.Title                      =             userRequest.Title__c ;
                user.CompanyName                =             userRequest.CompanyName__c ;
                user.Department                 =             userRequest.Department__c ;
                user.Division                   =             userRequest.Division__c ;
                user.EmailEncodingKey           =             userRequest.EmailEncoding__c ;
                user.userCountry__c             =             userRequest.userMainCountry__c ;
                user.userArea__c                =             userRequest.userMainArea__c ;
                user.ISORegion__c               =             userRequest.userMainRegion__c ;
                user.userMainCountrySubArea__c  =             userRequest.userMainCountrySubArea__c ;
                user.userSubRegion__c           =             userRequest.userMainSubRegion__c ;
                user.OtherRegions__c            =             userRequest.OtherRegions__c ;
                user.KeyuserType__c             =             userRequest.KeyuserType__c ;
                user.Champion__c                =             userRequest.Champion__c ;
                user.userProductLine__c         =             userRequest.userMainProductLine__c ;
                user.userUnit__c                =             userRequest.userMainUnit__c ;
                user.FinancialUnitId__c         =             userRequest.FinancialUnitId__c ;
                user.eLearning__c               =             userRequest.eLearning__c ;
                user.OtherProductLines__c       =             userRequest.OtherProductLines__c ;
                user.TimeZoneSidKey             =             userRequest.TimeZone__c ;
                user.LocaleSidKey               =             userRequest.Language__c ;
                user.LanguageLocaleKey          =             userRequest.Locale__c ;
                user.CurrencyIsoCode            =             userRequest.Currency__c ;
                user.CarveOutComments__c        =             userRequest.Comments__c ;
                user.Alias                      =             userRequest.Alias__c ;
                user.CommunityNickname          =             userRequest.CommunityNickname__c ;
                user.IsActive = true;
                
                update user;
            }
                
            //RESET PASSWORD
            /*for (User u: usersToUpdate)
                System.resetPassword(u.Id, true);*/
        } catch (DmlException e) {
            system.debug(Logginglevel.ERROR, e);
        } 
    }
}

 

Thank's for help,

 

All the best,

 

Anzar.

  • September 22, 2012
  • Like
  • 0

Hi,

 

How to get a matrix table (like a matrix report with two grouping columns) in a visualforce page ? The matrix table should be like follwing image (colors is just for information):

 

Contractors/PLs

PL 1

PL 2

PL 3

PL 4

Contractor 1

Stage 1

Stage 1

Stage 1

 

Contractor 2

 

Stage 2

Stage 3

Stage 5

Contractor 3

 

 

Stage 4

 

Contractor 4

    

 

First line (Blue) --> get values for custom field PL__c (this is the first dimension

First column (green) --> get values for custom field Contractor__c (the the second dimension)

Content of the other cells (Orange) --> Stage__c

 

Except the top cell which will be the header (Red).

 

All the best,

 

Anzar,

Can someone help me understand how to access a picklist values from a picklist on a custom object in the cloud flow designer? It looks like I have recreate the picklist choices as Choices in flow, which I do not want to do from an on going management perspecitve. When I try Dynamic Choices it brings back record values and not just the picklist options. Thanks!