You need to sign in to do that
Don't have an account?
Yann COLLERY
How to get Assignment rules RuleEntry from Apex
Hi,
I need to get all the Assignment rules RuleEntry from apex.
I found the AssignmentRules metadata but I don't understand how to use it.
Would anyone know how to retrieve this information?
Thank you.
I need to get all the Assignment rules RuleEntry from apex.
I found the AssignmentRules metadata but I don't understand how to use it.
Would anyone know how to retrieve this information?
Thank you.
Add this github classes https://github.com/financialforcedev/apex-mdapi/tree/master/apex-mdapi/src/classes
This is a sample example. You can use Assignment Rule Instead
String session = 'session';
String instance = 'https://na17.salesforce.com';
MetadataService.MetadataPort service = MetadataUtils.createService(session, instance);
List<MetadataService.ListMetadataQuery> queries = new List<MetadataService.ListMetadataQuery>();
MetadataService.ListMetadataQuery query = new MetadataService.ListMetadataQuery();
query.type_x = 'AssignmentRule';
queries.add(query);
// return all rule name in xml
MetadataService.FileProperties[] fileProperties = new List<MetadataService.FileProperties>();
// query metadata items by callout
fileProperties = service.listMetadata(queries, '30.0');
All Answers
Add this github classes https://github.com/financialforcedev/apex-mdapi/tree/master/apex-mdapi/src/classes
This is a sample example. You can use Assignment Rule Instead
String session = 'session';
String instance = 'https://na17.salesforce.com';
MetadataService.MetadataPort service = MetadataUtils.createService(session, instance);
List<MetadataService.ListMetadataQuery> queries = new List<MetadataService.ListMetadataQuery>();
MetadataService.ListMetadataQuery query = new MetadataService.ListMetadataQuery();
query.type_x = 'AssignmentRule';
queries.add(query);
// return all rule name in xml
MetadataService.FileProperties[] fileProperties = new List<MetadataService.FileProperties>();
// query metadata items by callout
fileProperties = service.listMetadata(queries, '30.0');