• Archana Batta
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 10
    Replies
Hi,

For files that are uploaded under "Files" related list and tagged to a record. There will be "Sharing Settings" where we can see which user/group have access to the file & what type of permission do they have. Now, my question is, is there any way of adding/removing users to that file programatically or by configurations? I dont want to go each time to that file and update the Sharing settings manually as its a repeated process.
Hi,

I want to freeze the visualforce page on button click. I am using "apex:actionFunction" to call my controller method. I want to freeze the page and display loading icon until my controller method process is completed.

Please note: My VF page is wrapped in another VF page. So, i cant use "apex:facet"
Hi,

I have a Rich text field, and we are displaying its value on visualforce page using <apex:outputtext>. "Escape" attribute is set to false. 
  • Indentation is working fine
  • Bold, Italic, Underline & strike are working fine
But the points specified with bullets or numbers, displays only the contents of the points but doesnt display numbers or bullets.
Hello Everyone,

Is it Ok to have Schema statements inside for loop? Will it affect governor limits?

For ex, i want to have some statement like this
for(Employee emp : empList){
   String str = Schema.SObjectType.Employee__c.getRecordTypeInfosById().get(Employee__c.RecordTypeId).getName();
}

Thanks & Regards,
B Archana
Hi,

Can someone help me in understanding the difference between below mentioned two statements. You can see that its the same SOQL query being used in both the statements. But it's the collection to store the SOQL results that differs. How does List and Map behave in these two statements?

List<Account> acctsWithOpps = [SELECT Id,(SELECT Id,Name FROM Opportunities) FROM Account WHERE Id IN :Trigger.New];

AND

Map<Id, Account> AcctWithOpps = new Map<Id, Account>([SELECT Id,(SELECT Id FROM Opportunities) FROM Account WHERE ID IN:Trigger.New]);

Thanks & Regards,
B Archana
Hi,

Can someone explain me what is a dynamic quote? And what items or information can appear dynamically in a PDF document?

Thanks & Regards,
B Archana
How to cover exception code in below class :- Below is apex class - 
public class CRM_ForecastCommentary {
    @AuraEnabled
    public static void saveLFCommentary(String liveForecastId , String comment){
        CRM_Live_Forecast__c[] LFlst = new List<CRM_Live_Forecast__c>();
        CRM_Live_Forecast__c FLtoUpdate;
        Id LFId = Id.valueOf(liveForecastId);
        try {
            insert LFlst;       
            FLtoUpdate =  [SELECT Name , Id , CRM_Comment__c FROM CRM_Live_Forecast__c
           WHERE Id =: LFId ];    
            // Update the comment.
            FLtoUpdate.CRM_Comment__c = comment;
            // Make the update call.
            update FLtoUpdate;
        } catch(DmlException e) {
            System.debug('An unexpected error has occurred: ' + e.getMessage());
            // Verify that the comment s updated.
            CRM_Live_Forecast__c afterUpdate = [SELECT CRM_Comment__c FROM CRM_Live_Forecast__c WHERE Id =: LFId];
            System.assertEquals(comment, afterUpdate.CRM_Comment__c);
            
        }
    }
	
    @AuraEnabled
    public static void saveCFCommentary(String commitForecastId , String comment){
        CRM_Committed_Forecast__c[] CFlst = new List<CRM_Committed_Forecast__c>();
        CRM_Committed_Forecast__c CFtoUpdate;
        Id CFId = Id.valueOf(commitForecastId);
        try {
            insert CFlst;       
            CFtoUpdate =  [SELECT Name , Id , CRM_Comment__c FROM CRM_Committed_Forecast__c
                 WHERE Id =: CFId ];    
            // Update the comment.
            CFtoUpdate.CRM_Comment__c = comment;
            // Make the update call.
            update CFtoUpdate;
        } catch(DmlException e) {
            System.debug('An unexpected error has occurred: ' + e.getMessage());
            // Verify that the comment s updated.
            CRM_Committed_Forecast__c afterUpdate = [SELECT CRM_Comment__c FROM CRM_Committed_Forecast__c WHERE Id =: CFId];
            System.assertEquals(comment, afterUpdate.CRM_Comment__c);
            
        }
    }
}

Below is test class. All is covered except ​​​exceptions.
@isTest
public class CRM_ForecastCommentaryTest {
    
    static testmethod void testSaveLFCommentary(){

        // insert forecast assignment test data
        CRM_Forecast_Assignment__c fassignment = new CRM_Forecast_Assignment__c();
        fassignment.Name = 'test FA';
        insert fassignment;
        system.assert(fassignment.Id != null);

        // insert Forecast period test data
        CRM_Forecast_Period__c fperiod = new CRM_Forecast_Period__c();
        fperiod.Name = 'test forecast period';
        fperiod.CRM_Fiscal_Year__c = '2020';
        fperiod.CRM_Fiscal_Quarter__c = 'FY2020 Q1';
        insert fperiod;
        system.assert(fperiod.Id != null);

        // create live forecast test data
        CRM_Live_Forecast__c liveForecast = new CRM_Live_Forecast__c();
        liveForecast.CRM_Forecast_Assignment__c	 = fassignment.Id;
        liveForecast.CRM_Forecast_Period__c = fperiod.Id;
        liveForecast.CRM_Comment__c = 'test comment';
        insert liveForecast;
        system.assert(liveForecast.Id != null);

        test.startTest();
        CRM_ForecastCommentary.saveLFCommentary(liveForecast.Id, 'testcomment');
        test.stopTest();
    }

    static testmethod void testSaveCFCommentary(){

        // insert forecast assignment test data
        CRM_Forecast_Assignment__c fassignment = new CRM_Forecast_Assignment__c();
        fassignment.Name = 'test FA';
        insert fassignment;
        system.assert(fassignment.Id != null);

        CRM_Committed_Forecast__c commitFA = new CRM_Committed_Forecast__c();
        commitFA.CRM_Comment__c = 'Forecast Committed';
        commitFA.CRM_Forecast_Assignment__c = fassignment.Id;
        try{
            insert commitFA;
            system.assert(commitFA.Id != null);
        } catch(DmlException e){
            system.assertEquals(e.getMessage(), e.getMessage());
        
        }
        test.startTest();
        CRM_ForecastCommentary.saveCFCommentary(commitFA.Id, commitFA.CRM_Comment__c );
        test.stopTest();

    }
}
  • April 13, 2020
  • Like
  • 0
How can we get the names of fields when any record in inserted in any object using apex. I need field API name not value.
Suppose I had created a record in Account and inserted name. Then I need to know from apex that what is the field API name for the record I inserted.
Hi,

I want to freeze the visualforce page on button click. I am using "apex:actionFunction" to call my controller method. I want to freeze the page and display loading icon until my controller method process is completed.

Please note: My VF page is wrapped in another VF page. So, i cant use "apex:facet"
Hi,

I have a Rich text field, and we are displaying its value on visualforce page using <apex:outputtext>. "Escape" attribute is set to false. 
  • Indentation is working fine
  • Bold, Italic, Underline & strike are working fine
But the points specified with bullets or numbers, displays only the contents of the points but doesnt display numbers or bullets.
Hello All, 

I have been tasked to builda RSVP solution for our Salesteam that can work with Pardot and Salesforce. Flow should be like this: 

RSVP Event Registration > Pardot > Salesforce. OR RSVP Event Registration > Salesforce > Pardot

Salesteam would like to track multiple events for the same contact record. So I have created a custom object in Salesforce, BUT Pardot doesnt have relationships ( unsupported ) with Custom Objects and thats what they want to use to send emails etc. 

I am looking for the right direction to start investing my time in, thanks in advance!
Hello,
We are looking into the possibility of adding a custom related lists on one of our custom object. I also need to add a button in the custom related list called 'Edit', so when clicks the button , the user is taken to another VF page to edit or add information to the related list.
Has anyone implemented any such similar functionality in their org?
Based on  my research, adding the hover link at the top of the page is not possible? Is this true?

If I use a visual force page to display the custom related list as a page block table, how can I add this cutom related list at the bottom of the detail page of the custom object?
 
Hi all,

User-added image

There is some kind of problem with this... Seems the filter is on:

User-added image

Thanks in advance

joseluis

Hi,

 

I got a compliant from the user that he is unable to use cross filter in the report. I also saw the report and found that he is unable to add cross filter as it is not available for selecting. What might be the reason? Will using joined reports solve the problem.

 

 

Thank you in advance.

  • February 13, 2013
  • Like
  • 0

Hello Everybody,

 

   I am new in SalesForce. I don't understand what is the difference between the lookup and master-details relationships. Both are one to many relation ship.... and I can't imagine while developing when I should use each.. So, please advice

 

Thank you,

    Sally

I would like to have the following: If i want to add a company with one or more contacts our Salesforce DB, then we take the usual route: Create Account (parent). Then we create a contact, and associate it the the Account (for business that is B to B).

 

But what if i'm doing business B to C. I dont want to create an Account with the name of the person, and then an extra record for the Contact info. Its like having 2 records pointing to the same person. In this case i'd like to only create an account (being the person) containing all relevant info, no need to create a contact since this person is the same.

 

Is there some way to do this?

I have heard about Person Accounts, how do they work? How can i create a new Person Account for each new customer i have for my B to C?