How to check whether Apex class with specific name exists or not using C#.Net?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
I have one .Net web service which is used by my Salesforce application.
I have used different Salesforce APIs to interact with Salesforce.
Now, I have created one REST Service in my Salesforce application and before using it in .Net web service, I want to check whether this REST service exists or not.
How can I do that? Do we have any metadata method to check existence of Apex Class/Rest Service?
metadata-api .net
add a comment |Â
up vote
1
down vote
favorite
I have one .Net web service which is used by my Salesforce application.
I have used different Salesforce APIs to interact with Salesforce.
Now, I have created one REST Service in my Salesforce application and before using it in .Net web service, I want to check whether this REST service exists or not.
How can I do that? Do we have any metadata method to check existence of Apex Class/Rest Service?
metadata-api .net
you can query ApexClassMember
– Oleksandr Berehovskiy
3 hours ago
2
Why not just call the API and see if it returns a 404?
– David Reed
3 hours ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have one .Net web service which is used by my Salesforce application.
I have used different Salesforce APIs to interact with Salesforce.
Now, I have created one REST Service in my Salesforce application and before using it in .Net web service, I want to check whether this REST service exists or not.
How can I do that? Do we have any metadata method to check existence of Apex Class/Rest Service?
metadata-api .net
I have one .Net web service which is used by my Salesforce application.
I have used different Salesforce APIs to interact with Salesforce.
Now, I have created one REST Service in my Salesforce application and before using it in .Net web service, I want to check whether this REST service exists or not.
How can I do that? Do we have any metadata method to check existence of Apex Class/Rest Service?
metadata-api .net
metadata-api .net
asked 3 hours ago
rakesh
185
185
you can query ApexClassMember
– Oleksandr Berehovskiy
3 hours ago
2
Why not just call the API and see if it returns a 404?
– David Reed
3 hours ago
add a comment |Â
you can query ApexClassMember
– Oleksandr Berehovskiy
3 hours ago
2
Why not just call the API and see if it returns a 404?
– David Reed
3 hours ago
you can query ApexClassMember
– Oleksandr Berehovskiy
3 hours ago
you can query ApexClassMember
– Oleksandr Berehovskiy
3 hours ago
2
2
Why not just call the API and see if it returns a 404?
– David Reed
3 hours ago
Why not just call the API and see if it returns a 404?
– David Reed
3 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
You can querry the ApexClass using the RestEndpoint and provide your class name in where clause. If it returns record you can say that class exists. You can also query the class code in the body parameter.
Endpoint:
/services/data/v43.0/query?q=SELECT+ID,Name,BODY+FROM+ApexClass+WHERE+NAME+=+'MyClass'
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
You can querry the ApexClass using the RestEndpoint and provide your class name in where clause. If it returns record you can say that class exists. You can also query the class code in the body parameter.
Endpoint:
/services/data/v43.0/query?q=SELECT+ID,Name,BODY+FROM+ApexClass+WHERE+NAME+=+'MyClass'
add a comment |Â
up vote
4
down vote
You can querry the ApexClass using the RestEndpoint and provide your class name in where clause. If it returns record you can say that class exists. You can also query the class code in the body parameter.
Endpoint:
/services/data/v43.0/query?q=SELECT+ID,Name,BODY+FROM+ApexClass+WHERE+NAME+=+'MyClass'
add a comment |Â
up vote
4
down vote
up vote
4
down vote
You can querry the ApexClass using the RestEndpoint and provide your class name in where clause. If it returns record you can say that class exists. You can also query the class code in the body parameter.
Endpoint:
/services/data/v43.0/query?q=SELECT+ID,Name,BODY+FROM+ApexClass+WHERE+NAME+=+'MyClass'
You can querry the ApexClass using the RestEndpoint and provide your class name in where clause. If it returns record you can say that class exists. You can also query the class code in the body parameter.
Endpoint:
/services/data/v43.0/query?q=SELECT+ID,Name,BODY+FROM+ApexClass+WHERE+NAME+=+'MyClass'
answered 2 hours ago


Pranay Jaiswal
9,45431949
9,45431949
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f236853%2fhow-to-check-whether-apex-class-with-specific-name-exists-or-not-using-c-net%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
you can query ApexClassMember
– Oleksandr Berehovskiy
3 hours ago
2
Why not just call the API and see if it returns a 404?
– David Reed
3 hours ago