• simple-force
  • NEWBIE
  • 50 Points
  • Member since 2013

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 15
    Replies

Hi, 

 

  I wrote a  scheduler, I locate in India. I want to know how to set the time zone formate to schule the program to run based on user locality.  Please let me know. 

 

Thanks

Sudhir

 

 

  

I am having two Workflows-FieldUpdate formula in same object to update two different fields as Field1 and Field2. And i am using Field1 value on Field2's workflow-FieldUpdate formula. But in my org Field2's workflow is running first and Field1's worflow is running second. So the value is getting wrong.

 

Based on which order two workflow is running on Same object?

Hi, 

 

  I wrote a  scheduler, I locate in India. I want to know how to set the time zone formate to schule the program to run based on user locality.  Please let me know. 

 

Thanks

Sudhir

 

 

  

Hi All,

 

I'm not a developer but learning slowly, however this time I'm stuck!

 

I'm looking to create a custom 'Log a Call' button used on a campaign page. The button will show the standard 'Log a Call' fields however I need it to lookup the Name 'Contact' of the record that I'm looking at. Right now it's only prefilling the Related To 'Campaign'.

 

The contact name is Master-Detail(Contact) Contact__c

The campaign I'm looking at is Campaign__c

 

Any clue son how to build the button?

 

 

 

 

 

 

 

 

Hi everyone, 

 

    I've been playing around with an apex trigger and class that will basically create a rollup field that counts the number of subCases that are related to a ParentCase.  Since I am new to APEX I am having a tough time.  I can get the trigger to work fine when I am not trying to "Bulkify" it.  But once I started trying this thing got a little out of hand lol.  Anyway HEre is the trigger and the class and the error I am getting.  Any help would be greatly appreciated.

 

 

ERROR: 

Error:Apex trigger NAME caused an unexpected exception, contact your administrator: NAME: execution of BeforeUpdate caused by: System.StringException: Invalid id: : Trigger.NAME: line 5, column 1

 

 

 

TRIGGER

 

Trigger NAME on Case (before update){
	List<String> parentIDs = new List<ID>();

	for(Integer i = 0; i < trigger.new.size(); i++){
		if(trigger.new[i].Standard_Change_Related_Case__c != null && trigger.new[i].Standard_Change_Related_Case__c != ''){
			parentIDs.add(trigger.new[i].Standard_Change_Related_Case__c);
		}
	}
	
	if(parentIDs.size() > 0 && parentIDs.size() != null){
		testClass.findAndUpdate(parentIDs);
	}
}

 

 

CLASS

Public Class testClass{	

	public static void findAndUpdate(List<String> parentIDs){
		list <case> casesTOupdate = new list <case>();
		list <case> subCaseList = new list<case>();
		
		if (parentIDs.size() > 0 && parentIDs.size() != null){
			For(integer i = 0; i < parentIDs.size(); i++){
				if(i < 100){ //limits the number of iterations for governor limits on SOQL queries
					for(list<Case> tmpCaseList: [Select id, Standard_Change_Request_Iteration__c 
												FROM Case c 
												WHERE c.Standard_Change_Related_Case__r.id =: parentIDs.get(i)]){
												
						subCaseList.addAll(tmpCaseList);
					}
					if(subCaseList.size() > 0 && subCaseList.size() != null){
						integer recordCount = subCaseList.size() + 1;
						for(integer h = 0; h < subCaseList.size(); h++){
							subCaseList.get(h).Standard_Change_Request_Iteration__c = recordCount;
						}
						case tmpCase = [Select id, Standard_Change_Request_Iteration__c 
										FROM Case c 
										WHERE c.id =: parentIDs.get(i)];
										
						tmpCase.Standard_Change_Request_Iteration__c = recordCount;
						subCaseList.add(tmpCase);
						casesTOupdate.addAll(subCaseList);
					}
					subCaseList.clear();
				}
			}			
			update casesTOupdate;
		}
	}
}

 

 

Sorry for the bad Formatting, When I paste it over it gets all screwy.

  • September 03, 2013
  • Like
  • 0

I am a beginner and I have to write an apex class that allows only one opportunity product to be added to any opportunity and then invoke it using trigger.It sounds simple,but I cant seem to develop the logic.

 

Any sample code or any help would be much appreciated.

Hi there, I hope you can help me!

Basically, as the subject title suggests, I am trying (but failing) to assign say a group of 3 fields to a particular section header (of which I have created).

 

The aim is to make the form 'report-friendly' if you like, thus enabling the user to run a report on particular sections to have an overview of the performance of that aspect... with them also bieng able to dig deeper into that section for more detail (i.e. individual questions included under section header) if needed.

 

The problem I am having is not creating the fields themselves, or the section headers for that matter, it is more so to do with getting the section header to link with the relevant fields and how this will translate into a report.

 

It sounds simple enough but I have tried a number of different apporaches but cannot seem to create this grouping/nesting/relationship/linkage...

 

Any ideas? Or is this unrealistic/unachievable??

 

Thanks in advance for your help!

Kimberley

  • September 03, 2013
  • Like
  • 0

I am now, finally, in a position to deploy the code which a kind developer on this board wrote for me a couple of weeks ago.  The hold-up was in getting our organisation upgraded to Enterprise edition, which has now been done.

 

I have downloaded and installed the force.com IDE, but I am a complete newbie and am now absolutely terrified.  What do I need to do to get this code actually installed on our company's Salesforce system?

 

 

I notice thae Salesforce.com have a requirement that 75%, and preferably 100% of the code be covered by automated tests.  I assume I need to find out how to do this?

 

Someone, please help!

 

Best regards,

 

Alex.

Hi,

 

I have a requirement to disable few lead records checkbox using wrapper class.

 

I have used disabled attribute to check some conditions and if the conditions returns true, it should disable the checkbox of tat particular lead records and remaining lead records should not be disabled.

 

Still i am not able to achieve it. Could some one help me.

 

class

public String UserRegion{get;set;}

currentUser = [select id,email,name,GCAM_Region__c from User where id =: userInfo.getUserId()];
         if(currentUser.GCAM_Region__c != null)
         {
         UserRegion = currentUser.GCAM_Region__c.substring(0,3);
         system.debug('XXX'+UserRegion );
         }

 

 

class LeadWrapper
    {
         public Boolean isSelected{get; set;}
         public Lead ld{get; set;}
         
         public LeadWrapper(Lead l,Boolean flag)
         {
              ld = l;
              isSelected = flag;
         }
    }
   

 

VF

<apex:pageBlockTable value="{!allLeads}" var="leadVar">
                                     <apex:column width="20px">
                                       <apex:facet name="header">
                                          <input type="checkbox" name="chk" id="chk" onclick='masterCheck(this.checked);'/>
                                       </apex:facet>
                                       <apex:inputCheckbox value="{!leadVar.isSelected}" onclick="childCheck(this.checked)" disabled="{IF(UserRegion!=leadVar.ld.LTC_Leads_Region_Name__r.Name,True,False)}" title="Please contact Retail Leads Team for Transfer of this Lead"/>
                                     </apex:column>

 

if the current user Region code is not matching with the leads Region Code, then the checkbox for that lead should be disabled.

 

Please help me to find out how to handle it if disabled attribute doesnt support.

 

  • September 03, 2013
  • Like
  • 0

Hi,

I am using Business hours object to calculate the difference between two days using apex.Here i am facing a problem to calculate the difference between start time and end time of a business day(Ex.difference between Mondayendtime and Mondaystarttime)
is there method to calculate the difference?

can someone post the syntax how to calculate the difference between start time and end time of a business day?

Two objects are there object1 & object2 

 

if object1 is update then automatically object2 is updating, vice versa object2 is update automatically update object1

 

these two objects are in loop conditions.

 

My question is how u will stop the updating. 

Explain me how many ways we can stop the updating..

 

Please reply this question...

Hi everyone,
                       I have a detail page onclick javascript cutom button which need to be clicked everytime right after I save a record. Is it possible to automate this function? I heard about a click() function but it is only usable if I can override the save function. Is there some fuction I can add to the script of the custom button to achieve this?

  • September 02, 2013
  • Like
  • 0