• Manas Gupta
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I've overridden "New" button of custom object with Visualforce page. When I click this button it should redirect to another one.app page in Salesforce1 but it's not working and says "Something has gone wrong. $A.getDefinition. Please try again."

My Visualforce page:
<apex:page standardController="Note__c" sidebar="false" showHeader="false" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false" showQuickActionVfHeader="false">
<script>
    var url = '/one/one.app#eyJjb21wb25lbnREZWYiIDogImM6cXVpY2tBZGQiLCJhdHRyaWJ1dGVzIiA6IHt9fQ==';
sforce.one.navigateToURL(url, true);
</script>    
</apex:page>

However, it's working when I do
window.parent.location = '/one/one.app#eyJjb21wb25lbnREZWYiIDogImM6cXVpY2tBZGQiLCJhdHRyaWJ1dGVzIiA6IHt9fQ==';

Any suggestions much appreciated.
Thanks.

Customer has a use case to be able to "Archive Document" at the end of its life. Clearly there is a UI function to perform this which keeps the document from appearing in search results or lists. There appears to be no method or object property that is accessible from the API to perform this operation. Most ContentDocuments originate and are "retired" via an integration with third-party system. We need to reproduce this "Archive" functionality via API.

We have tried re-associating the contentDocument with another Workspace that is hidden, but there are built-in validation rules preventing this using the ContentWorkspaceDoc object (ie deleting existing Workspace associations and creating new ContentWorkspaceDoc record).

 

Ideas?