Forum Replies Created

Viewing 1 - 25 of 193 posts
  • Surbhi

    Member
    September 8, 2016 at 2:12 pm

    Hi Pranav,

    If you are using workflow email alerts to send emails, then you can set email as CC from email alert. If you are sending from code, then you can use setBccAddresses(bccAddresses) and setCcAddresses(ccAddresses) from SingleEmailMessage Methods.

    Thanks

  • Surbhi

    Member
    September 8, 2016 at 1:52 pm

    Hi Tanu,

    Below is the SOQL sample query:

    SELECT Id, Name FROM RecentlyViewed WHERE Type IN ('Account', 'Contact') ORDER BY LastViewedDate DESC

    Thanks

  • Surbhi

    Member
    September 8, 2016 at 8:34 am

    Hi Bhavesh,

    In the for loop, where you are deleting the record, you are performing DML operation inside the for loop and we can perform only limited DML operation in a thread.

    Instead of deleting this in for loop, you can add the records to a list and then delete that list. But as you are querying the custom object data into a list, then there is also limit of querying into a list.

    So, I would suggest using a batch class for this as it will handle really a huge amount of data. Please refer the below sample code for executing batch class from Post Install Script:

    public without sharing class InstallationSystem implements Database.Batchable<SObject>, InstallHandler {
    public void onInstall(InstallContext ic) {
    // Initialize some data here
    Database.executeBatch(this);
    }
    public Database.QueryLocator start(Database.BatchableContext bc) {
    return Database.getQueryLocator([some query]);
    }
    public void execute(Database.BatchableContext bc, Sobject[] records) {
    }
    public void finish(Database.BatchableContext bc) {
    }
    }

    I hope this will help you.

    Please let me know if you have any query.

    Thanks

  • Surbhi

    Member
    September 7, 2016 at 6:18 am

    Hi Mohit,

    You can try the below code:

    Datetime dt = DateTime.newInstance(Date.today(), Time.newInstance(0, 0, 0, 0));
    String dayOfWeek=dt.format('EEEE');
    System.debug('Day : ' + dayOfWeek);

    Thanks

  • Surbhi

    Member
    September 6, 2016 at 1:35 pm

    Hi Mohit,

    You can try below code:

    system.schedule('Scheduled hourly job ', '0 0 0/1 1/1 * ? *', new NameOfBatchClassScheduler());
    system.schedule('Scheduled hourly job', '0 30 0/1 1/1 * ? *', new NameOfBatchClassScheduler());

    The first will schedule class for i.e. 10:00 , 11: 00,...etc. and the second will for i.e. 10:30, 11:30,.. etc.

    Thanks

  • Surbhi

    Member
    September 6, 2016 at 1:26 pm

    Hi Mohit,

    You can use a JavaScript function for disabling the custom button. This function will run with "onclick" event of the button.

    Thanks

  • Surbhi

    Member
    August 31, 2016 at 5:00 pm

    Hi Pranav,

    An extension, which I used for this purpose, is Force.com LOGINS Options. You can use it.

    Thanks

  • Surbhi

    Member
    August 30, 2016 at 5:41 pm

    Hi Pranav,

    Please refer below code:

    Account acct = new Account(Name='SFDC Account');
    insert acct;

    system.debug("Inserted Account Id = "+acct.Id);

    As much I get from your question, this will give you id of inserted account. Please let me know if you have any query.

    Thanks

  • Surbhi

    Member
    August 30, 2016 at 5:36 pm

    Hi Tanu,

    This won't cause you any problems. The execution context will be different each time the batch job is fired.

    Thanks

  • Surbhi

    Member
    August 30, 2016 at 1:45 pm

    Hi Pranav,

    You just have to add @future in the trigger. This annotation is executed asynchronously when Salesforce has available resources. It is mainly used if in case, there are some calculation on an object, which is to be done after insert but no matter with the user operation. Then this can be done asynchronously with this future annotation. It can also be used to calls to external web services.

    Thanks

  • Surbhi

    Member
    August 30, 2016 at 12:44 pm

    Hi Tanu,

    You can refer to Metadata API document. Also please have a look on below code:

    CustomObject co = new CustomObject();
    co.setFullName(objectName+"__c");
    co.setDeploymentStatus(DeploymentStatus.Deployed);
    co.setDescription("Created by the WSC using the Metadata API");
    co.setLabel(displayName);
    co.setPluralLabel(displayName+"s");
    co.setSharingModel(SharingModel.ReadWrite);
    co.setEnableActivities(true);

    // create the text id field
    CustomField field = new CustomField();
    field.setType(FieldType.Text);
    field.setDescription("The custom object identifier field");
    field.setLabel(displayName);
    field.setFullName(objectName+"__c");
    // add the field to the custom object
    co.setNameField(field);

    AsyncResult[] ars = metadataConnection.create(new CustomObject[] { co });

    Thanks

  • Surbhi

    Member
    August 26, 2016 at 3:46 pm

    Hi Mohit,

    You can refer to below code:

    @isTest
    private class testMyController{

    private static testMethod void testAutoRun() {

    test.startTest();
    PageReference pageRef = Page.yourPageName;
    Account acc = new Account(Name='Abce');
    insert acc;
    Opportunity testOppty = new Opportunity();
    testOppty.name='testOppty';
    testOppty.AccountId=acc.id;
    testOppty.StageName='Open';
    testOppty.CloseDate=System.today();
    insert testOppty;
    Test.setCurrentPage(pageRef);
    pageRef.getParameters().put('id',testOppty.id);
    ApexPages.StandardController sc = new ApexPages.standardController(testOppty);
    Myclass controller = new Myclass(sc);
    System.assertNotEquals(null,controller.autoRun());

    test.stopTest();
    }

    }

    Thanks

  • Surbhi

    Member
    August 26, 2016 at 3:05 pm

    Hi Pranav,

    When you have to provide multiple parameters in the url, then you use & for separating the parameters. Otherwise use ?id= .

    Thanks

  • Surbhi

    Member
    August 26, 2016 at 2:29 pm

    Hi Mohit,

    You can use aggregate functions here. Use field in Group By for criteria of comparison.

    Thanks

  • Surbhi

    Member
    August 26, 2016 at 2:23 pm

    Hi Tanu,

    You can achieve this using trigger and for creating new field from apex, you have to use SOAP version of the API (Metadata API).

    Thanks

  • Surbhi

    Member
    August 26, 2016 at 2:19 pm

    Hi Pranav,

    You can create a formula field that will display the concatenated value.

    The formula field would be of type text and would have formula similar to

    FieldName1+ ' ' +FieldName2

    Thanks

  • Surbhi

    Member
    June 30, 2016 at 2:33 pm

    Hi Naman,

    Please follow the below approach:

    Setup > Domain Management > My Domain
    1. Enable MyDomain.
    2. Follow the instructions to set it up and deploy to users.
    3. Set "Require login from <mydomain>" to True.

    Browse to: Setup > Security Controls > Single Sign-On Settings
    4. Set "Identity Provider Login URL" to the URL users should be forced to log in.
    5. Set "Entity Id" to the <mydomain> value.

    * Note: The above process may take up to 48 hours for domain name propagation.

    Thanks

  • Surbhi

    Member
    June 27, 2016 at 1:04 pm

    That's Great !

    Thanks

  • Surbhi

    Member
    June 24, 2016 at 2:30 pm

    Hi Prabhat,

    Thanks for providing this information. Can you please provide some examples of using hierarchy custom settings in apex ?

    Thanks in advance

  • Surbhi

    Member
    June 23, 2016 at 2:11 pm

    Hi Danna,

    I think you can try using CSS for this

    Thanks

  • Surbhi

    Member
    June 23, 2016 at 2:09 pm

    Hi Prakhar,

    I tried this in my developer org and what I found is: In the left hand side section in lightning experience consists of tabs , not apps. So, for accessing apps, you have to click on the App Launcher, then you can see you apps. On clicking on any of app, will show all the tabs included in that app.

    Thanks

  • Surbhi

    Member
    June 22, 2016 at 2:14 pm

    Hi Himanshu,

    Dynamic Apex can only be access-able for the components with which the code is packaged. To provide access to standard objects not included in the package, the developer must set the API Access.

    Thanks

  • Surbhi

    Member
    June 22, 2016 at 2:11 pm

    Hi Himanshu,

    I am also looking for this. Can anyone please provide any information regarding this?

    Thanks

  • Surbhi

    Member
    June 21, 2016 at 2:37 pm

    Hi Karen,

    I think it is not possible as per my research but will let you know if find any progress regarding this.

    Thanks

  • Surbhi

    Member
    June 21, 2016 at 2:32 pm

    Hi Himanshu,

    I haven't found any solution for this. But I am still researching for this and will let you know if got anything.

    Thanks

Viewing 1 - 25 of 193 posts