i know how to invoke the batch but it doesnt invoke the managed package batch when i try to invoke it through namespace it says type is not visible. can u help me with this?
You would need to relase a new version of the package that has batch code, after making the changes in the code. So that you can easily invoke the batch going forward.
Sure, please check the link below to create a package https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/publish_upgrades.htm
Make sure to add the component (batch class in above case) that you have updated before creating the package.
1) Please make the metods and the batch Global. 2) Create a new package with the steps mentioned above. 3) Upgrade this new package and then invoke the batch.
you will not be able to see the code in org where package is there right now. you will need to go to the packaging org where its been created and change the code.
So you mean to say if I will create a new package and if i will add this batch class i will be able to see that class's methods and constructors? If this is so then when i had created the package i was not getting that class inside apex class..
You need to update the same code base of package you are currently using .. just update the batch class in it .. by making the methods and the class global .. and create a new version of that .. that should work.
1) If the class is in the package it must have namespace. 2) If it has namespace that means it has a packaging org . 3) You need to search for this packaging org and search the class there. 4) Once done update the batch and its methods by making it global.
thanks for your patience. but unfortunately i have joined this organization recently and they havent informed anything about the packaging org..thank you so much for your quick response. also if you could help me with one more query that would be really great. please let me know if you wont mind.😊
I want to fetch symboltable methods of my apex class inside my apexclass code and I tried to fetch through workbench but I'm not getting anything..could u please help me with that
There is a answer for your query , check the link below from Daniel Ballinger https://salesforce.stackexchange.com/questions/116165/symbol-table-from-apex-class
Http http = new Http();
String baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
String path = '/services/data/v43.0/tooling/query/?q=';
String query = 'Select Id,Name,SymbolTable,Body from ApexClass WHERE Id=\'01p6F000009v2TfQAI\'';
List<sObject> sobjList = Database.query(query);
System.debug('Query'+query);
HttpRequest request = new HttpRequest();
request.setEndpoint(baseUrl+path+query);
request.setMethod('GET');
HttpResponse response = http.send(request);
// If the request is successful, parse the JSON response.
if (response.getStatusCode() == 200) {
// Deserialize the JSON string into collections of primitive data types.
Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
// Cast the values in the 'animals' key as a list
//List<Object> animals = (List<Object>) results.get('animals');
System.debug('Received the following animals:');
//List<sObject> methods = results[0].symbolTable.methods;
// now you have all methods with their name and parameters
List<Object> Methods = (List<Object>) results.get('Methods');
for(Object method : methods)
{
System.debug('Method Id:');
}
}
else
{
String baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
System.debug('BaseUrl'+baseUrl);
}
Please go throgh the link below ,
https://help.salesforce.com/articleView?id=000171199&type=1
hope it helps.
Could you let me know how are you trying to invoke . (code please)
https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/publish_upgrades.htm
Make sure to add the component (batch class in above case) that you have updated before creating the package.
Hope this helps.
1) Please make the metods and the batch Global.
2) Create a new package with the steps mentioned above.
3) Upgrade this new package and then invoke the batch.
you will need to go to the packaging org where its been created and change the code.
2) If it has namespace that means it has a packaging org .
3) You need to search for this packaging org and search the class there.
4) Once done update the batch and its methods by making it global.
https://salesforce.stackexchange.com/questions/116165/symbol-table-from-apex-class
I hope this helps.
https://salesforce.stackexchange.com/questions/116165/symbol-table-from-apex-class
check the image