function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ajitvermaajitverma 

Extracting Existing Validatin/Workflow Rules and in Java

HI,

 

I want to fetch validation/workflow rules metadata existing in the org using java application.  I am able to fetch a particular component in the org e.g. ValidationRule, Workflow etc using ListMetadataQuery object.

here is the code snippet to fetch component.

 

String sComponent = "ValidationRule"; ListMetadataQuery query = new ListMetadataQuery(null, sComponent); FileProperties[] fieFps = metadata_binding.listMetadata(new ListMetadataQuery[] {query});

for(FileProperties fp :fieFps){
logger.debug("Here : " + fp.getFullName());

}

 

 

In this way i get only the name of the rule but not the other attributes like (active, errorConditionFormula, errorMessage).

 

How can i fetch the other attributes of the component, in other words, how can i fetch the component as a particular object.

 

Any help is appreciated.

 

Thanks

Ajit

Anand@SAASAnand@SAAS
Try including "CustomObject" that you are pulling the validation rule for. The API requires you to include the Custom Object as part of the request so that it knows to fetch validation rules only for the Custom Object (s) that are part of the request.