Forum Replies Created

  • Hello Shariq,

    But we can call one batch class from another batch, finish() method.

    Thanks and Regards
    Aastha Jain

    • This reply was modified 4 years, 6 months ago by  Aastha.
  • Aastha

    Member
    June 11, 2020 at 4:00 pm in reply to: Can we delete custom setting from manage package in Salesforce?

    Hello Aditya,
    No we can't delete custom setting from manage package.
    Infact we can't delete anything from manage package.

    NOTE : Only Admin have access to make changes to custom settings.

    Thanks and Regards
    Aastha Jain

  • Aastha

    Member
    June 11, 2020 at 3:48 pm in reply to: How many types of API’s avaliable in salesforce?

    Hello Marziya,
    There are 4 types of API's in Salesforce,

    1. REST API
    2. SOAP API
    3. BULK API
    4. STREAMING API

    To know about them in detail, you can refer to the below link :API Link
    Thanks and Regards
    Aastha Jain

  • Aastha

    Member
    June 11, 2020 at 3:41 pm in reply to: What is System.RunAs () is the test class?

    Hello Shweta,
    System.runAs() : It enable us to Changes the current user to the specified user.
    we use This Method when we need to execute the test as a context of a current user .
    When to use :
    We use System.runAs() when we need to perform mixed DML operations in our test by enclosing the DML operations within the runAs block.
    To bypass the mixed DML error that is otherwise returned when inserting or updating setup objects together with other sObjects.
    System.runas() enables you to write test methods that change the user context to an existing user .
    How To use :
    Now we will learn how we can use System.runAs() in our test class.
    Here is our test class code :
    --------------------------------------------------------------------------------------------
    @isTest
    public class YourTestClassName {
    public static testMethod void TestMethod(){
    test.startTest();
    // Fetching profile
    Id AdminProfileID = [Select Id From profile Where Name = ‘System Administrator’ Limit 1].Id;
    Id RoleID = [Select Id From UserRole Where PortalType = ‘None’ Limit 1].Id;
    //Now we are creating a user
    User l = new User(
    email=’[email protected]’,
    profileid = AdminProfileID ,
    userroleid = RoleID,
    UserName=’[email protected]’,
    alias=’Admin’,
    TimeZoneSidKey=’America/New_York’,
    LocaleSidKey=’en_US’,
    EmailEncodingKey=’ISO-8859-1′,
    LanguageLocaleKey=’en_US’,
    FirstName = ‘testAdminFirstName’,
    LastName = ‘testAdminLastName’,
    IsActive = true
    );
    insert thisUser;
    //After inserting user we insert account and perform required operation in System.runAs() method.
    System.runAs(thisUser){
    Account acc = new Account(
    Name = ‘testAcc’,
    Industry = ‘test’,
    Description = ‘test’,
    BillingStreet = ‘test’,
    BillingCity = ‘test’,
    BillingPostalCode = ‘test’,
    Website = ‘www.test.com’,
    Phone = ‘221714’,
    NumberOfEmployees = 10
    );
    insert acc;
    }
    test.stopTest();
    }
    }
    Thanks and Regards

  • Hello Deepak,

    Please give this link a look. I hope this will help.
    https://developer.salesforce.com/forums/?id=9062I000000IGAzQAO

    Thanks and Regards
    Aastha Jain

  • Aastha

    Member
    June 11, 2020 at 3:15 pm in reply to: What is contentType in Attachments in Salesforce?

    Hello Deepak,

    ‘ContentType’ is a restricted picklist field in Attachment object, which means it accepts only the values that are listed in picklist values.
    It has values like :
    application/html
    application/java-archive
    application/javascript
    application/msword
    application/octet-stream
    application/octet-stream;type=unknown
    application/opx
    application/pdf
    application/postscript
    application/rtf
    application/vnd.google-apps.document
    application/vnd.google-apps.drawing
    application/vnd.google-apps.form
    application/vnd.google-apps.presentation
    application/vnd.google-apps.script
    application/vnd.google-apps.spreadsheet
    application/vnd.ms-excel
    application/vnd.ms-excel.sheet.macroEnabled.12
    application/vnd.ms-infopath
    application/vnd.ms-powerpoint
    application/vnd.ms-powerpoint.presentation.macroEnabled.12
    application/vnd.ms-word.document.macroEnabled.12
    application/vnd.oasis.opendocument.presentation
    application/vnd.oasis.opendocument.spreadsheet
    application/vnd.oasis.opendocument.text
    application/vnd.openxmlformats-officedocument.presentationml.presentation
    application/vnd.openxmlformats-officedocument.presentationml.slideshow
    application/vnd.openxmlformats-officedocument.presentationml.template
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
    application/vnd.openxmlformats-officedocument.spreadsheetml.template
    application/vnd.openxmlformats-officedocument.wordprocessingml.document
    application/vnd.openxmlformats-officedocument.wordprocessingml.template
    application/vnd.visio
    application/x-gzip
    application/x-java-source
    application/x-javascript
    application/x-shockwave-flash
    application/x-sql
    application/x-zip-compressed
    application/xhtml+xml
    application/xml
    application/zip
    audio/mp4
    audio/mpeg
    audio/x-aac
    audio/x-ms-wma
    audio/x-ms-wmv
    audio/x-wav
    image/bmp
    image/gif
    image/jpeg
    image/png
    image/svg+xml
    image/tiff
    image/vnd.adobe.photoshop
    image/vnd.dwg
    image/x-photoshop
    message/rfc822
    text/css
    text/csv
    text/html
    text/plain
    text/rtf
    text/snote
    text/stypi
    text/webviewhtml
    text/x-c
    text/x-c++
    text/xml
    video/mp4
    video/mpeg
    video/quicktime
    video/x-m4v
    video/x-ms-asf
    video/x-msvideo

    Thanks and Regards
    Aastha Jain

Popular Salesforce Blogs