Skip to main content
Vikas Palakiti (Adobe) a posé une question dans #Agentforce

The output successfully printed in developer console through anonymous apex  but when i added it to agent or flow it was giving me zero. First when i writtn code through metadata api session id was null in debug logs whereas getting correct output through anonymous apex. When trying to tooling api getting correct output and it was not displaying in agent    

2 réponses
  1. 4 août 2025, 14:02

    Tooling API: For real-time development tools (e.g., VS Code). Access metadata as records, useful for querying components like ApexClass, Flow, LightningComponentBundle.

    Metadata API: For deploying/retrieving metadata as files

    (XML/zip). Used in CI/CD, backups, etc. 

     

    Use Tooling API to get counts: 

    Integer lwcCount = [SELECT COUNT() FROM LightningComponentBundle WHERE MetadataType = 'LightningComponent'];

    Integer flowCount = [SELECT COUNT() FROM FlowDefinition WHERE ManageableState != 'installed'];

    Integer pbCount = [SELECT COUNT() FROM FlowDefinition WHERE ProcessType = 'Workflow' AND ManageableState != 'installed'];

    Integer customObjectCount = [SELECT COUNT() FROM CustomObject WHERE NamespacePrefix = null];

    System.debug('LWC Components: ' + lwcCount);

    System.debug('Flows: ' + flowCount);

    System.debug('Process Builders: ' + pbCount);

    System.debug('Custom Objects: ' + customObjectCount);

0/9000