Forum Replies Created

Viewing 176 - 193 of 193 posts
  • Surbhi

    Member
    May 25, 2016 at 1:17 pm

    Hi Himanshu,

    For getting All Parent objects:

    for(Schema.SobjectField strFld: Account.SobjectType.getDescribe().fields.getMap().Values()){
    if(strFld.getDescribe().getType() == Schema.DisplayType.REFERENCE){
    system.debug('==parent object='+strFld.getDescribe().getReferenceTo());
    }
    }

    For getting All Child objects:

    Schema.DescribeSObjectResult R = Account.SObjectType.getDescribe();
    for (Schema.ChildRelationship cr: R.getChildRelationships()) {
    system.debug('====child object==='+cr.getChildSObject());
    }

    *Change Account as per your requirement.

    Thanks

  • Surbhi

    Member
    May 25, 2016 at 12:51 pm

    Hi Himanshu,

    Please find the below code for chatter post through apex:

    //Adding a Text post
    FeedItem post = new FeedItem();
    post.ParentId = oId; //eg. Opportunity id, custom object id..
    post.Body = 'Enter post text here';
    insert post;

    //Adding a Link post
    FeedItem post = new FeedItem();
    post.ParentId = oId; // Record Id eg. Opportunity id, custom object id..
    post.Body = 'Enter post text here';
    post.LinkUrl = 'http://www.infallibletechie.com';
    insert post;

    //Adding a Content post
    FeedItem post = new FeedItem();
    post.ParentId = oId; // Record Id eg. Opportunity id, custom object id..
    post.Body = 'Enter post text here';
    post.ContentData = base64EncodedFileData;
    post.ContentFileName = 'infallible.pdf';
    insert post;

    Hope this will help you.

    Thanks

  • Surbhi

    Member
    May 25, 2016 at 6:03 am

    Hi Piyush,

    Use "queryAll" in the API to retrieve the activities. The Data Loader exposes queryAll as "Export All." Then you have to perform an update to the records. You only need to call update() using records by Id. Archived activities will be restored upon saving.

    Thanks

     

  • Surbhi

    Member
    May 25, 2016 at 5:56 am

    Hi Piyush,

    Lightning events should be put into their own directory, separate from the components.

    Thanks

  • Surbhi

    Member
    May 25, 2016 at 5:42 am

    Hi Ravi,

    This doesn't support "EmailTemplate". You have to individually name each template. You can also refer to below link:

    http://www.salesforce.com/us/developer/docs/daas/Content/daas_package.htm

    Thanks

  • Surbhi

    Member
    May 25, 2016 at 5:36 am

    Hi Ravi,

    I guess you are talking about chatter file public links. So, for that you can refer to below link:

    https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentdistribution.htm

    Thanks

  • Surbhi

    Member
    May 25, 2016 at 5:20 am

    Hi Ravi,

    It's not possible to pass a value to a getter variable. It seems getter methods get executed exactly once and are then cached in the background so if your VF page calls the same getter twice, it will simply receive the data from the first execution and the getter code will not be executed again.

    Thanks

  • Surbhi

    Member
    May 24, 2016 at 10:51 am

    Hi Himanshu,

    I don't think there is any way to check the current logging level in apex.

    Thanks

  • Surbhi

    Member
    May 24, 2016 at 10:45 am

    Hi Himanshu,

    There is no guarantee of the order of results unless you used an "ORDER BY" in your query.

    Thanks

  • Surbhi

    Member
    May 24, 2016 at 10:43 am

    Hi Himanshu,

    The problem was with initializing the DateTime variable by casting from a Date. Instead of directly casting the Date to a DateTime, the DateTime.newInstance(date, time) method should be used to construct the DateTime in the local time zone as Date doesn't have any time zone.

    Thanks

  • Surbhi

    Member
    May 24, 2016 at 10:33 am

    Hi Ravi,

    You can better look on the below url:

    https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm

    This is consists of "Triggers and Order of Execution". I hope this will help you to understand the flow of execution.

    Thanks

  • Surbhi

    Member
    May 24, 2016 at 10:07 am

    Hi Nitish,

    You can create the new fields of opportunity with same API name as of the fields of custom object but you can't just move that field directly to the Opportunity.

    Thanks

  • Surbhi

    Member
    May 24, 2016 at 9:58 am

    Hi Himanshu,

    We can write triggers on multiple standard object and all custom object. But if you are using Eclipse IDE then there is an easy way. When you select new ApexTrigger, it will give you all available object on which you can create trigger.

    Thanks

  • Surbhi

    Member
    May 24, 2016 at 9:38 am

    Hi Ravi,

    Below is the code for your requirement:

    String numVal = '123';
    system.debug('numVal::'+numVal.isNumeric()); // Writes "numVal::TRUE" to the debug log

    Thanks

  • Surbhi

    Member
    May 24, 2016 at 8:04 am

    Hi Himanshu,

    Here is the query:

    "SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM Contact)"

    Thanks

  • Surbhi

    Member
    May 24, 2016 at 7:56 am

    Hi Himanshu,

    SOQL statements can use the "ALL ROWS" keywords to query all records in an organization, including deleted records and archived activities. You can use ALL ROWS to query records in your organization's Recycle Bin.

    But, you cannot use this keywords with the "FOR UPDATE" operation . This is supported by apex, but does not supported by developer console. 

    Thanks

  • Surbhi

    Member
    May 24, 2016 at 7:29 am

    Hi Sourabh,

    This requirement can be achieved by two ways:

    1. Field update using workflow. But you have to create unique workflow for each possible picklist value.
    2. Using process builder.You can have entry criteria as per your requirement. The formula for update record will be : IF(FormulaFieldName,'Active','Inactive').

    Thanks

  • Surbhi

    Member
    May 24, 2016 at 6:48 am

    You can create Customer Community in Dev org using following steps:
    Setup -> Customize -> Communities Settings.

    You have to first enable communities. Then with specific domain name, you can create customer community.

    Thanks

Viewing 176 - 193 of 193 posts