• Satishakumar Awati
  • NEWBIE
  • 20 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 4
    Questions
  • 3
    Replies
I have below  package xml , deployment using sfdx is getting failed with error 'Not in package.xml'
<?xml version='1.0' encoding='utf-8'?>
<Package xlms="http://soap.sforce.com/2006/04/metadata">
	<types>
		<name>WorkflowRule</name>
		<members>Case.ABC: Update Requestor email</members>
	</types>
	<version>45.0</version>
</Package>

The command I used to deploy folder is 
sfdx force:mdapi:deploy -d deployFolder -u dev -w 5 --json

I noticed colon (:) in WorkflowRule name causing deployment to fail and it needs to be escaped with %3A.

Deployment succeded after escaping colon (:) special charecter in WorkflowRule name as below.
<?xml version='1.0' encoding='utf-8'?>
<Package xlms="http://soap.sforce.com/2006/04/metadata">
	<types>
		<name>WorkflowRule</name>
		<members>Case.ABC%3A Update Requestor email</members>
	</types>
	<version>45.0</version>
</Package>

What other all special charecters needs to be handled and escaped in package.xml?


 
Hello everyone, I am trying to build a screen which dispays all objects within a salesforce organization.

This is my controller code
 
​public class MySchemaController {
    
    public List<Schema.SObjectType> getSchemaSObjectTypes(){
        List<Schema.SObjectType> sobjectTypes = Schema.getGlobalDescribe().values();
        return sobjectTypes;
    }
    
    public List<Schema.DescribeSobjectResult> getSchemaSObjectTypeResults(){
           List<Schema.DescribeSobjectResult> describeSObjectResults = new List<Schema.DescribeSobjectResult>();

         for(Schema.SObjectType objResult : getSchemaSObjectTypes()){
             describeSObjectResults.add(getSObjectResult(objResult));
         }
         
        return describeSObjectResults;
    }
    
    public Schema.DescribeSobjectResult getSObjectResult(Schema.SObjectType obj){
        Schema.DescribeSObjectResult objResult = obj.getDescribe();
        return objResult;
    }
    
    public String getSobjectResultApiName(Schema.DescribeSobjectResult objResult){
        return objResult.getName();
    }
}
And my visualforce page code is 
 
<apex:page showHeader="false" sidebar="false" controller="MySchemaController">
    <apex:form>
    	<apex:pageBlock title="Objects">
        	<apex:pageBlockTable value="{!SchemaSObjectTypeResults}" var="objResult">
            	<apex:column value="{! objResult.getName()}"/>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>
While saving page code I am getting below error message.

Unknown function objResult.getName. Check spelling.

Kindly help me to get away with this error message and I am beginner to salesforce and trying to build my first visualforce page. 
I need the details of number of apex clasess, memory of code, simillarly I also want to know details for triggers, visualforce pages, email templates, visulforce components and etc. Is there screen or anything thing available to get all details on one shot?
I am trying list all the API Names available in a salesforce organization. I am able to retrieve all the object API names using below code:
 
for ( Schema.SObjectType o : Schema.getGlobalDescribe().values() )
{
    Schema.DescribeSObjectResult objResult = o.getDescribe();
    system.debug( 'Sobject: ' + objResult );
    system.debug( 'Sobject API Name: ' + objResult.getName() );
    system.debug( 'Sobject Label Name: ' + objResult.getLabel() );   
}

But the list does not contain the objects belongs to managed packages and unmanaged packages.

And also I am trying to access managed package objects records via workbench.developerforce.com , I am getting the error as

message: Select COUNT(id) FROM CustomObject__c ^ ERROR at Row:1:Column:23 sObject type 'CustomObject__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names. errorCode: INVALID_TYPE
Hello everyone, I am trying to build a screen which dispays all objects within a salesforce organization.

This is my controller code
 
​public class MySchemaController {
    
    public List<Schema.SObjectType> getSchemaSObjectTypes(){
        List<Schema.SObjectType> sobjectTypes = Schema.getGlobalDescribe().values();
        return sobjectTypes;
    }
    
    public List<Schema.DescribeSobjectResult> getSchemaSObjectTypeResults(){
           List<Schema.DescribeSobjectResult> describeSObjectResults = new List<Schema.DescribeSobjectResult>();

         for(Schema.SObjectType objResult : getSchemaSObjectTypes()){
             describeSObjectResults.add(getSObjectResult(objResult));
         }
         
        return describeSObjectResults;
    }
    
    public Schema.DescribeSobjectResult getSObjectResult(Schema.SObjectType obj){
        Schema.DescribeSObjectResult objResult = obj.getDescribe();
        return objResult;
    }
    
    public String getSobjectResultApiName(Schema.DescribeSobjectResult objResult){
        return objResult.getName();
    }
}
And my visualforce page code is 
 
<apex:page showHeader="false" sidebar="false" controller="MySchemaController">
    <apex:form>
    	<apex:pageBlock title="Objects">
        	<apex:pageBlockTable value="{!SchemaSObjectTypeResults}" var="objResult">
            	<apex:column value="{! objResult.getName()}"/>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>
While saving page code I am getting below error message.

Unknown function objResult.getName. Check spelling.

Kindly help me to get away with this error message and I am beginner to salesforce and trying to build my first visualforce page. 
I need the details of number of apex clasess, memory of code, simillarly I also want to know details for triggers, visualforce pages, email templates, visulforce components and etc. Is there screen or anything thing available to get all details on one shot?
I'm struggling to understand what kind of restrictions are in place when making a HTTP request to a Salesforce resource within a custom REST endpoint. When I construct the request in a console as such ...
HttpRequest request = new HttpRequest();
request.setEndpoint('https://<my hostname>/apex/MyVisualforcePage');
request.setMethod('GET');
request.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());
request.setBody('param1=foo&param2=bar');

HttpResponse response = new Http().send(request);
System.debug(response.getBody());
... I get the page content in HTML correctly.

However, when I make the same call in a custom REST endpoint I get the following output:
\r\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n    <meta HTTP-EQUIV=\"PRAGMA\" CONTENT=\"NO-CACHE\">\n\n\n\n\n\n<script>\nif (this.SfdcApp && this.SfdcApp.projectOneNavigator) { SfdcApp.projectOneNavigator.handleRedirect('https://evestment--dev.cs13.my.salesforce.com?ec=302&startURL=%2Fapex%2FInvoiceNotificationEmail'); }  else \nif (window.location.replace){ \nwindow.location.replace('https://evestment--dev.cs13.my.salesforce.com?ec=302&startURL=%2Fapex%2FInvoiceNotificationEmail');\n} else {;\nwindow.location.href ='https://evestment--dev.cs13.my.salesforce.com?ec=302&startURL=%2Fapex%2FInvoiceNotificationEmail';\n} \n</script>\n\n</head>\n\n\n</html>\n\n\n\n\n\n<!-- Body events -->\n<script type=\"text/javascript\">function bodyOnLoad(){if(window.PreferenceBits){window.PreferenceBits.prototype.csrfToken=\"null\";};}function bodyOnBeforeUnload(){}function bodyOnFocus(){}function bodyOnUnload(){}</script>\n\t\t\t\n</body>\n</html>\n\n\n<!--\n...................................................................................................\n...................................................................................................\n...................................................................................................\n...................................................................................................\n-->\n\n\n

The response appears to be a page that is redirecting to a login page, but I could be wrong. I'm making the call to the custom REST endpoint via Postman when I received the undesirable output above. I've tried obtaining a session id via Postman and using the same session id in the call to the REST endpoint AND the call to the Salesforce resource (i.e. replacing UserInfo.getSessionId() with the session id). The user authenticating is a sys admin and is the same user running the anonymous code in the console for the positive test.

Can anyone shed any light on why this might be happening?
I'm struggling to understand what kind of restrictions are in place when making a HTTP request to a Salesforce resource within a custom REST endpoint. When I construct the request in a console as such ...
HttpRequest request = new HttpRequest();
request.setEndpoint('https://<my hostname>/apex/MyVisualforcePage');
request.setMethod('GET');
request.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());
request.setBody('param1=foo&param2=bar');

HttpResponse response = new Http().send(request);
System.debug(response.getBody());
... I get the page content in HTML correctly.

However, when I make the same call in a custom REST endpoint I get the following output:
\r\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n    <meta HTTP-EQUIV=\"PRAGMA\" CONTENT=\"NO-CACHE\">\n\n\n\n\n\n<script>\nif (this.SfdcApp && this.SfdcApp.projectOneNavigator) { SfdcApp.projectOneNavigator.handleRedirect('https://evestment--dev.cs13.my.salesforce.com?ec=302&startURL=%2Fapex%2FInvoiceNotificationEmail'); }  else \nif (window.location.replace){ \nwindow.location.replace('https://evestment--dev.cs13.my.salesforce.com?ec=302&startURL=%2Fapex%2FInvoiceNotificationEmail');\n} else {;\nwindow.location.href ='https://evestment--dev.cs13.my.salesforce.com?ec=302&startURL=%2Fapex%2FInvoiceNotificationEmail';\n} \n</script>\n\n</head>\n\n\n</html>\n\n\n\n\n\n<!-- Body events -->\n<script type=\"text/javascript\">function bodyOnLoad(){if(window.PreferenceBits){window.PreferenceBits.prototype.csrfToken=\"null\";};}function bodyOnBeforeUnload(){}function bodyOnFocus(){}function bodyOnUnload(){}</script>\n\t\t\t\n</body>\n</html>\n\n\n<!--\n...................................................................................................\n...................................................................................................\n...................................................................................................\n...................................................................................................\n-->\n\n\n

The response appears to be a page that is redirecting to a login page, but I could be wrong. I'm making the call to the custom REST endpoint via Postman when I received the undesirable output above. I've tried obtaining a session id via Postman and using the same session id in the call to the REST endpoint AND the call to the Salesforce resource (i.e. replacing UserInfo.getSessionId() with the session id). The user authenticating is a sys admin and is the same user running the anonymous code in the console for the positive test.

Can anyone shed any light on why this might be happening?