• rockForce
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 3
    Replies

Hello

 

I have created a trigger which hits the governor limits. Is there any way to sort this.

 

Here is my trigger code:

trigger sampleTrigger on sample__c (before insert, before update) {

	 
    List<Demo__c> demoCodeList = 
        [SELECT Id, Name FROM Dmeo__c WHERE status_code__c IN ('A', 'B', 'C', 'D', 'E')];
        

	Map<Id,Demo__c> demoCodeMap = new Map<Id, Demo__c>(demoCodeList);
    
    
    for (sample__c sam : trigger.new) {
    	
        if(demoCodeMap.containsKey(sam.demo_code_id__c)) {

            Integer statCount = [Select count() from sample__c 
                where demo_code_id__c IN :demoCodeList
                and year__c = 0];
                

            test__c tt = [select total_sample__c from test__c];
            
            if( statCount >= tt.total_test__c){
                sam.addError('Demo Error');     
            }
            
        }
    }
}

 Thanks in advance.

I want the test class code. Can anyone suggest me with the test class code for the apex code.

 

 

public with sharing class TextMessage {

List<text__c> appTextMessage = [select text_message__c FROM text__c ];
Map<ID, Contact> contactMap = new Map<ID, Contact>([select id, firstname from contact]);
List<String> displayMessage = new List<String>();

public List<String> messageTemplate()
{  
  
  for (text__c textMessage : appTextMessage)
     {
    String text = textMessage.text_message__c;
  if(text !=null  ){
    Set<ID> keyId = contactMap.keySet();
    for(ID c :keyId){
      displayMessage.add(contactMap.get(c).firstname + ' ' + text + '\n');
      System.debug(displayMessage);
    }
  }
      }
    
  return displayMessage;
}

}

 Thanks in advance.

One record TEST is created by User U2 (profile - Demo) in the standard object Account and user U1 (profile - admin) is trying to create a record in Contact object and after clicking on the lookup field Account Name it doesn’t displays the record TEST created by User U2. Guide me where I am going wrong.



Thanks

Rock

I have created 4 users U1, U2, U3 and U4, here users U1 and U2 are assigned to profile P1 and users U3 and U4 are assigned to profile P2. In this users assigned to profile P1 has access to object O1 and O2 and don’t has access to O3 and O4, profile P2 is able to access all these four objects. Due to some reason users U1 need to access object O3 as well, to do this I need to create a new profile P3 for U1 having access to O1, O2 and O3 but I don’t want to create lots of profiles for this purpose.

Is there any solution to solve this scenario other than creating the third profile as mentioned above?

 

Thanks

Rock

I am using the standard list view which contains couple of links (Edit, Create New View) and button (Go). Is there any way to control (show or hide) these links and button, is there any way to create new links and buttons to show in this standard list view?

 

Thanks

Rock

Hello

 

I have created a custom object which has a standard field First Name (name) with the datatype Text and i want to make this field to be unique and the value entered in this field should not be repeat. Can anyone tell how to achieve this functionality.

 

Thanks

Rock

Hello,

 

I am using Standard Layout to insert a new record in the custom object but i want to make this layout dynamic, means I want to show or hide some of the fields w.r.t. the value selected in the picklist in this view. So, is there any way to do this in the Standard UI of Force.com. Any suggestion will be helpful for me.

 

Thanks in advance

Rock

I have created 4 users U1, U2, U3 and U4, here users U1 and U2 are assigned to profile P1 and users U3 and U4 are assigned to profile P2. In this users assigned to profile P1 has access to object O1 and O2 and don’t has access to O3 and O4, profile P2 is able to access all these four objects. Due to some reason users U1 need to access object O3 as well, to do this I need to create a new profile P3 for U1 having access to O1, O2 and O3 but I don’t want to create lots of profiles for this purpose.

Is there any solution to solve this scenario other than creating the third profile as mentioned above?

 

Thanks

Rock

I am using the standard list view which contains couple of links (Edit, Create New View) and button (Go). Is there any way to control (show or hide) these links and button, is there any way to create new links and buttons to show in this standard list view?

 

Thanks

Rock

Hello,

 

I am using Standard Layout to insert a new record in the custom object but i want to make this layout dynamic, means I want to show or hide some of the fields w.r.t. the value selected in the picklist in this view. So, is there any way to do this in the Standard UI of Force.com. Any suggestion will be helpful for me.

 

Thanks in advance

Rock