You need to sign in to do that
Don't have an account?
Apttus old 2 New
get Active and Inactive Validation rule metadata Info
Hi all. I'm using below code to get Validation Rule info.
MetadataService.MetadataPort service = new MetadataService.MetadataPort();
service.SessionHeader = new MetadataService.SessionHeader_element();
service.SessionHeader.sessionId = UserInfo.getSessionId();
List<MetadataService.ListMetadataQuery> queries = new List<MetadataService.ListMetadataQuery>();
MetadataService.ListMetadataQuery queryLayout = new MetadataService.ListMetadataQuery();
queryLayout.folder = '';
queryLayout.type_x = 'ValidationRule';
queries.add(queryLayout);
MetadataService.FileProperties[] fileProperties = service.listMetadata(queries, 25);
system.debug('---' + fileProperties.size());
layoutCount = fileProperties.size();
if(fileProperties!=null)
{
for(MetadataService.FileProperties fileProperty : fileProperties)
{
ValidationRuleNames.add(fileProperty.fullname);
System.debug(fileProperty.fullName);
}
}
}
Can some help me in writing a code to differentiate Active and Inactive VRule metadata info? Thank you.
MetadataService.MetadataPort service = new MetadataService.MetadataPort();
service.SessionHeader = new MetadataService.SessionHeader_element();
service.SessionHeader.sessionId = UserInfo.getSessionId();
List<MetadataService.ListMetadataQuery> queries = new List<MetadataService.ListMetadataQuery>();
MetadataService.ListMetadataQuery queryLayout = new MetadataService.ListMetadataQuery();
queryLayout.folder = '';
queryLayout.type_x = 'ValidationRule';
queries.add(queryLayout);
MetadataService.FileProperties[] fileProperties = service.listMetadata(queries, 25);
system.debug('---' + fileProperties.size());
layoutCount = fileProperties.size();
if(fileProperties!=null)
{
for(MetadataService.FileProperties fileProperty : fileProperties)
{
ValidationRuleNames.add(fileProperty.fullname);
System.debug(fileProperty.fullName);
}
}
}
Can some help me in writing a code to differentiate Active and Inactive VRule metadata info? Thank you.