• mintotsai@dev.jasmine
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 8
    Replies
This seems to be new behavior in Summer '18.

I'm using the Ant Migration Tool to deploy code to a test org. During deployment, it errors on VisualForce pages that contain override buttons.
 
[sf:deploy] Component Failures:
[sf:deploy] 1.  pages/Enrollment.page -- Error: You can't change the standard controller object Enrollment__c because this page is referenced in the action override New.

Has anyone seen this before and is there a work around?


 
I'm getting the error message while adding multiple Visualforce pages to a Standard page layout. What is the maximum number allowed?

User-added image
I'm getting the error message while adding multiple Visualforce pages to a Standard page layout. What is the maximum number allowed?

User-added image
As an ISV, I've been given support access by my customer to debug an email issue. I'm Logged In as Administrator. And, generated an email log to download, however, when I try to download the zip file, I am getting:

"Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary. For more information, see Insufficient Privileges Errors."

How do I get the necessary privileges?
When using the Identity URL, I have a client who is getting Bad_OAuth_Token. The same code works in the same instance for other clients. The instance is na16.

The code is:
static public String protocolAndHost {
        get {
            if (protocolAndHost == null) {
                //memoize
                String orgId = UserInfo.getOrganizationId();
                String userId = UserInfo.getUserId();
                String sessionId = UserInfo.getSessionId();

                //use getSalesforceBaseUrl within batches and schedules (not Visualforce), and fix inconsistent protocol
                if (sessionId == null) return Url.getSalesforceBaseUrl().toExternalForm().replace('http:', 'https:');

                PageReference pr = new PageReference('/id/' + orgId + '/' + userId);
                pr.getParameters().put('oauth_token', sessionId);
                pr.getParameters().put('format', 'json');

                //within test context use url class, else derive from identity api
                String data = Test.isRunningTest() ? '{"urls": {"rest": "' + Url.getSalesforceBaseUrl().toExternalForm() + '"}}' : pr.getContent().toString();
                Map<String,Object> result = (Map<String,Object>)Json.deserializeUntyped(data);
                Map<String,Object> urls = (Map<String,Object>)result.get('urls');

                //compose pod from the REST endpoint
                Url rest = new Url((String)urls.get('rest'));
                protocolAndHost = rest.getProtocol() + '://' + rest.getHost();
            }

            return protocolAndHost;
        }
    }


The error return is:
403 status code return from request to https://na16.salesforce.com/id/00Dj0000001tO6KEAU/005j000000BYfmLAAT?format=json&oauth_token=00Dj0000001tO6K%21AQwAQHsiQOYRd7vpLI2.iY0vRYMzUbbiXUkZQiLdx593O2hxAbtIrbjU3TfYa6KTNPBAeVA.Pg3pUQQOrWlJgbsbG7ppWcU8&inline=1
An unexpected error has occurred. Your solution provider has been notified.

Please help!
While deploying code with the Ant Migration Tool, I am getting the error, "Error: limit exceeded" for a custom field on the Contact object.

[sf:deploy] Component Failures: [sf:deploy] 1. objects/Contact.object (Contact.Emergency_Contact_Relationship__c) -- Error: limit exceeded (line 107, column 13)

I've deleted everything from the recycle bin. Any ideas on what might be causing this? Thanks.
 
I am trying to fire a trigger when a new LMA License is created from a SignupRequest  via customer trial, so that I can send an email. The new License from the SignupRequest is created by the License Management App user and I suspect this is causing it to fail. When I create a License manually, the trigger will fire.

Is it possible to fire the LMA License object trigger when it's created from a SignupRequest for customer trials?
When updating field level security for Activity fields for a profile using the Metadata api (from Rails Metaforce Gem), I am seeing the resetting of field level security for other fields.

For example, in the following code, when Activity.What is done, the Activity.Who is reset to not Visible.

MetadataUtils.admin_profile_field_permissions(metadataClient, 'Activity.'+'Who')
MetadataUtils.admin_profile_field_permissions(metadataClient, 'Activity.'+'What')

Here is the method for updating field level security,

def self.admin_profile_field_permissions(metadataClient, field)
    puts 'Field Permission: '+field
    metadataResponse = metadataClient.update_metadata(:profile, :fieldPermissions => [:field => field, :editable => true, :readable => true], :fullName => 'Admin')
    puts 'Success=' + metadataResponse.success.to_s
end

The problem is only happening for the Activity object. 

I have created a custom app. The custom app shows in the apps dropdown. I've recently created a custom tab with a custom page (code below) to show the Activities/Events calendar.

 

<apex:page action="/007">
    Please wait...
</apex:page>

I've set this as the default tab for the app. Now when I select my app from the drop down, the selection doesn't switch to my app.

 

If I choose a different tab as the default tab for my app, the selection sticks.

 

Has anyone encountered this? Is there sometime I can do?

When using the Identity URL, I have a client who is getting Bad_OAuth_Token. The same code works in the same instance for other clients. The instance is na16.

The code is:
static public String protocolAndHost {
        get {
            if (protocolAndHost == null) {
                //memoize
                String orgId = UserInfo.getOrganizationId();
                String userId = UserInfo.getUserId();
                String sessionId = UserInfo.getSessionId();

                //use getSalesforceBaseUrl within batches and schedules (not Visualforce), and fix inconsistent protocol
                if (sessionId == null) return Url.getSalesforceBaseUrl().toExternalForm().replace('http:', 'https:');

                PageReference pr = new PageReference('/id/' + orgId + '/' + userId);
                pr.getParameters().put('oauth_token', sessionId);
                pr.getParameters().put('format', 'json');

                //within test context use url class, else derive from identity api
                String data = Test.isRunningTest() ? '{"urls": {"rest": "' + Url.getSalesforceBaseUrl().toExternalForm() + '"}}' : pr.getContent().toString();
                Map<String,Object> result = (Map<String,Object>)Json.deserializeUntyped(data);
                Map<String,Object> urls = (Map<String,Object>)result.get('urls');

                //compose pod from the REST endpoint
                Url rest = new Url((String)urls.get('rest'));
                protocolAndHost = rest.getProtocol() + '://' + rest.getHost();
            }

            return protocolAndHost;
        }
    }


The error return is:
403 status code return from request to https://na16.salesforce.com/id/00Dj0000001tO6KEAU/005j000000BYfmLAAT?format=json&oauth_token=00Dj0000001tO6K%21AQwAQHsiQOYRd7vpLI2.iY0vRYMzUbbiXUkZQiLdx593O2hxAbtIrbjU3TfYa6KTNPBAeVA.Pg3pUQQOrWlJgbsbG7ppWcU8&inline=1
An unexpected error has occurred. Your solution provider has been notified.

Please help!
Hi all,

I am trying to add custom buttons to search layouts using metadata API. Here is the java code:
ReadResult result = connection.readMetadata("CustomObject", new String[]{objectName});
Metadata[] records = result.getRecords();
CustomObject customObject = (CustomObject) records[0];
SearchLayouts layouts = customObject.getSearchLayouts();
ArrayList<String> buttons = Lists.newArrayList(layouts.getListViewButtons());
buttons.add(BUTTON_NAME);
layouts.setListViewButtons(buttons.toArray(new String[buttons.size()]));
customObject.setSearchLayouts(layouts);
connection.updateMetadata(new Metadata[]{customObject});

BUTTON_NAME is the name of the WebLink which has been created previously.
This works, but only when I have never accessed any of the list views of the object for which I want to add the button (I have a fresh dev instance set up, so this is still possible). 

If the list view has ever been visited, the button does not show up (see screenshot).
User-added image
However, the button does show up in the setup for "Search Layouts" for the object in question - as if it has been added to the layout. Plus querying the custom object reports the button as present in the layout also. And when I click the "Save" button in on that page (without modifying anything), the button suddenly appears in the list view!
User-added image
It is as if salesforce is doing some additional work when I click "Save" in addition to what the metadata API does. Plus the same additional work is apparently performed when the list view is accessed for the first time.

This is not a browser caching issue (I have tried on may browsers simultaneously).
This has also previously been reported by at least two people on some forums:

http://salesforce.stackexchange.com/questions/59784/metadata-api-searchlayouts-not-showing-updates
https://github.com/financialforcedev/apex-mdapi/issues/55


Does anybody know what is going on? And how I could fix this?
I'm getting the error message while adding multiple Visualforce pages to a Standard page layout. What is the maximum number allowed?

User-added image
When using the Identity URL, I have a client who is getting Bad_OAuth_Token. The same code works in the same instance for other clients. The instance is na16.

The code is:
static public String protocolAndHost {
        get {
            if (protocolAndHost == null) {
                //memoize
                String orgId = UserInfo.getOrganizationId();
                String userId = UserInfo.getUserId();
                String sessionId = UserInfo.getSessionId();

                //use getSalesforceBaseUrl within batches and schedules (not Visualforce), and fix inconsistent protocol
                if (sessionId == null) return Url.getSalesforceBaseUrl().toExternalForm().replace('http:', 'https:');

                PageReference pr = new PageReference('/id/' + orgId + '/' + userId);
                pr.getParameters().put('oauth_token', sessionId);
                pr.getParameters().put('format', 'json');

                //within test context use url class, else derive from identity api
                String data = Test.isRunningTest() ? '{"urls": {"rest": "' + Url.getSalesforceBaseUrl().toExternalForm() + '"}}' : pr.getContent().toString();
                Map<String,Object> result = (Map<String,Object>)Json.deserializeUntyped(data);
                Map<String,Object> urls = (Map<String,Object>)result.get('urls');

                //compose pod from the REST endpoint
                Url rest = new Url((String)urls.get('rest'));
                protocolAndHost = rest.getProtocol() + '://' + rest.getHost();
            }

            return protocolAndHost;
        }
    }


The error return is:
403 status code return from request to https://na16.salesforce.com/id/00Dj0000001tO6KEAU/005j000000BYfmLAAT?format=json&oauth_token=00Dj0000001tO6K%21AQwAQHsiQOYRd7vpLI2.iY0vRYMzUbbiXUkZQiLdx593O2hxAbtIrbjU3TfYa6KTNPBAeVA.Pg3pUQQOrWlJgbsbG7ppWcU8&inline=1
An unexpected error has occurred. Your solution provider has been notified.

Please help!
While deploying code with the Ant Migration Tool, I am getting the error, "Error: limit exceeded" for a custom field on the Contact object.

[sf:deploy] Component Failures: [sf:deploy] 1. objects/Contact.object (Contact.Emergency_Contact_Relationship__c) -- Error: limit exceeded (line 107, column 13)

I've deleted everything from the recycle bin. Any ideas on what might be causing this? Thanks.
 
When we install a managed package our permission sets are missing the system permissions defined in our DE:
  1. System Permissions hasn't been populated after package was installed.
  2. System Administrator can't edit System Permissions after deployment from managed package

Is this by design or should we be able to deploy system permissions?

Thanks,
Ross
When updating field level security for Activity fields for a profile using the Metadata api (from Rails Metaforce Gem), I am seeing the resetting of field level security for other fields.

For example, in the following code, when Activity.What is done, the Activity.Who is reset to not Visible.

MetadataUtils.admin_profile_field_permissions(metadataClient, 'Activity.'+'Who')
MetadataUtils.admin_profile_field_permissions(metadataClient, 'Activity.'+'What')

Here is the method for updating field level security,

def self.admin_profile_field_permissions(metadataClient, field)
    puts 'Field Permission: '+field
    metadataResponse = metadataClient.update_metadata(:profile, :fieldPermissions => [:field => field, :editable => true, :readable => true], :fullName => 'Admin')
    puts 'Success=' + metadataResponse.success.to_s
end

The problem is only happening for the Activity object. 

I have created a custom app. The custom app shows in the apps dropdown. I've recently created a custom tab with a custom page (code below) to show the Activities/Events calendar.

 

<apex:page action="/007">
    Please wait...
</apex:page>

I've set this as the default tab for the app. Now when I select my app from the drop down, the selection doesn't switch to my app.

 

If I choose a different tab as the default tab for my app, the selection sticks.

 

Has anyone encountered this? Is there sometime I can do?