• Swapnil Pal
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 3
    Replies
Trying to complete the Salesforce Platform Basics, Get Started with Salesforce Platform.  
Customize the Salesforce Platform Challenge:
I added the new field under Contacts, Prequalified Amount. The field name was automatically created/assigned as "Prequalified_A__c".  The data field type is currency.  I tested it to make sure, but I'm getting this error.  

Challenge Not yet complete... here's what's wrong: 
The field 'Prequalified_Amount__c' either does not exists on the Contact object or it is not of type currency.

Thus, I manually edited the field name to "Prequalifed_Amount__c", but then  this error displays: 
Error: The custom field name you provided Prequalified_Amount__c on object Contact can only contain alphanumeric characters, must begin with a letter, cannot end with an underscore or contain two consecutive underscore characters, and must be unique across all Contact fields.

How do I resolve the first error?
@istest
public class TestNoteOnContentDocuments {
  static testmethod void NoteOnContentDoc(){
    ContentVersion contentVersion = new ContentVersion(
      Title = 'Penguins',
      PathOnClient = 'Penguins.jpg',
      VersionData = Blob.valueOf('Test Content'),
      IsMajorVersion = true
    );
    insert contentVersion;  
     

	List<ContentDocument> documents = [SELECT Id, Title, LatestPublishedVersionId FROM ContentDocument];      
    
        ContentDocumentLink link=new ContentDocumentLink();
            link.LinkedEntityId=ContentDocumentLink.id;
            link.contentdocumentid=[select contentdocumentid from contentversion where id =:                  ContentDocument.id].contentdocumentid;
            link.ShareType = 'A';
   
        insert link;
 
      
     DmlException expectedException;
    Test.startTest();
        try { delete documents; }
        catch (DmlException dmx) { 
            
       Boolean expectedExceptionThrown = dmx.getMessage().contains('Approval pending. You do not have the permission to edit/delete this note/attachment, please contact your administrator.') ? true : false; 
       System.assertEquals(expectedExceptionThrown, true);  
        }
    Test.stopTest();
 }
}

 

Hi

 

Could someone explain me what ti means when saying a type is serializable (or not serializable) reference to an object? For example token is serializable to an sObject and describe result not!

 

Thanks

 

VNForce