• Hardy Vardès Tsialoungou Nkouka
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
About workflows, ilt works but when Sobject does'nt exist or when le returned list is empty, visualforce returns an erreur.
this my code :

public List<WorkflowRuleWrapper> getWorkflowList (){ 
        String currentO = 'Contact';
        ToolingAPIWSDL.QueryResult qr = toolingApi.query('Select Fullname, metadata From WorkflowRule WHERE TableEnumOrId=\''+currentO+'\' ' ,'ToolingAPIWSDL.WorkflowRule');
        List<WorkflowRuleWrapper> workflowruleWrappers = new List<WorkflowRuleWrapper>();
        for(ToolingAPIWSDL.WorkflowRule wr : (List<ToolingAPIWSDL.WorkflowRule>)qr.records){
            WorkflowRuleWrapper wrw = new WorkflowRuleWrapper(wr);            
            String wrActions = '';
            for(ToolingAPIWSDLMetadata.WorkflowActionReference war : wr.metadata.actions){
                    wrActions += war.name + '  -  ';
                }
            wrw.actions = wrActions;
            workflowruleWrappers.add(wrw);
        }
        return workflowruleWrappers;
    }    


Thanks !

Hardy
Hi !

I want to get validation rules for each Sobject (Account). I try this code :
List<ValidationRuleWrapper> vrs = new List<ValidationRuleWrapper>();
        ToolingAPIWSDL.QueryResult qr =
            toolingApi.query('Select Fullname, metadata From ValidationRule WHERE TableEnumOrId=\''+'Account+'\' '','ToolingAPIWSDL.ValidationRule');
        for(ToolingAPIWSDL.ValidationRule vr : (List<ToolingAPIWSDL.ValidationRule>)qr.records){
            ValidationRuleWrapper vrw = new ValidationRuleWrapper(vr);
            vrs.add(vrw);
        }
        validationRules = vrs;
But it does'nt work.
Hi !

I want to get validation rules for each Sobject (Account). I try this code :
List<ValidationRuleWrapper> vrs = new List<ValidationRuleWrapper>();
        ToolingAPIWSDL.QueryResult qr =
            toolingApi.query('Select Fullname, metadata From ValidationRule WHERE TableEnumOrId=\''+'Account+'\' '','ToolingAPIWSDL.ValidationRule');
        for(ToolingAPIWSDL.ValidationRule vr : (List<ToolingAPIWSDL.ValidationRule>)qr.records){
            ValidationRuleWrapper vrw = new ValidationRuleWrapper(vr);
            vrs.add(vrw);
        }
        validationRules = vrs;
But it does'nt work.

About workflows, ilt works but when Sobject does'nt exist or when le returned list is empty, visualforce returns an erreur.
this my code :

public List<WorkflowRuleWrapper> getWorkflowList (){ 
        String currentO = 'Contact';
        ToolingAPIWSDL.QueryResult qr = toolingApi.query('Select Fullname, metadata From WorkflowRule WHERE TableEnumOrId=\''+currentO+'\' ' ,'ToolingAPIWSDL.WorkflowRule');
        List<WorkflowRuleWrapper> workflowruleWrappers = new List<WorkflowRuleWrapper>();
        for(ToolingAPIWSDL.WorkflowRule wr : (List<ToolingAPIWSDL.WorkflowRule>)qr.records){
            WorkflowRuleWrapper wrw = new WorkflowRuleWrapper(wr);            
            String wrActions = '';
            for(ToolingAPIWSDLMetadata.WorkflowActionReference war : wr.metadata.actions){
                    wrActions += war.name + '  -  ';
                }
            wrw.actions = wrActions;
            workflowruleWrappers.add(wrw);
        }
        return workflowruleWrappers;
    }    


Thanks !

Hardy
Hi !
I want to get for each SObjet the Profil Name, PermissionRead, PermissionWrite, PermissionEdit via Apex.
I tried this :
SELECT O.SobjectType, O.PermissionsRead, PermissionWrite, PermissionEdit,  P.ProfileId, P.Profile.Name
FROM ObjectPermissions O, PermissionSet P
WHERE ( P.Id = O.ParentId) AND (O.SobjectType = 'Account')

But it does'nt work !

Can anyone help me?

Thanks

Hardy
Hi !
I want to get for each SObjet the Profil Name, PermissionRead, PermissionWrite, PermissionEdit via Apex.
I tried this :
SELECT O.SobjectType, O.PermissionsRead, PermissionWrite, PermissionEdit,  P.ProfileId, P.Profile.Name
FROM ObjectPermissions O, PermissionSet P
WHERE ( P.Id = O.ParentId) AND (O.SobjectType = 'Account')

But it does'nt work !

Can anyone help me?

Thanks

Hardy