• OnurK
  • NEWBIE
  • 50 Points
  • Member since 2010

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 16
    Replies

Hi all,

 

I want to mak a table and would like to use the days of the month as header. For example in January there would be 31 columns and February 28 coumns etc. Column headers can be 1 , 2, 3, 4 or anything else. Is there anyone can share a sample code with me?

 

Thank you all in advance. 

Hi,

 

I have a Master-Detail relationship between Opportunity and Deal.

When i save a record in Deal page(Visualforce page), i want it to get redirected to the Opportunity detail page.

 

Its kind of urgent, please let me know how can i do this.

 

Thanks..

I'm trying to write a class that will delete all records in a custom object with a specific status.  Can't seem to get pass the syntax.

 

I've got this...

 

public with sharing class DeletePostedToHistory{

 

List<CustomObj__c> CustomObj = [

select status__c  

from CustomObj__c  

where status__c = 'Posted to History'];  

 

delete CustomObj;

 

}

 

But I get the error "expecting right curly bracket, found 'delete'

 

What am I missing here?

 

Thanks,



 

 

Hi,
I have a scenario where I have to send an email on case creation. In the email template I am referring the field case owner. Also, in After Insert I am changing the owner of the case by running the assignment rules through code. But the issue is the emails I received show the old owner of the record and not the changed one.
Kindly reply asap.


Hi All,

 

Can anyone please explain me the difference between List and Array. 

 

Test__c[] t = new Test__c[0];

vs

List<Test__c> t = new List<Test__c>();

 

Thanks 

Can you helpm for adding the error message here? I am getting SObject row does not allow errors message

 

trigger beforeCase on Case (before insert, before update) {/*

   // List <Case> cs = Trigger.new;
   // 	TaxNumberDuplicate.checkDuplicates (cs);
   	
   		
        
         Set<String> taxNumber =new Set<String>();
         for (Case c : trigger.new) { 
         		
				taxNumber.add(c.Tax_Number__c);
			}
		
			List<Case> duplicatecaseList = new List<Case>();
			
			for(Case c : [SELECT id, Tax_Number__c, permit_duplicate__c FROM Case WHERE Tax_Number__c IN: TaxNumber])	
			
			duplicatecaseList.add(c);
			
            for(Case cs : duplicatecaseList){
            
            if(trigger.isInsert){
            
            
            		if(duplicatecaseList.size()> 0 && 
               		cs.permit_duplicate__c == FALSE && 
               		cs.Tax_Number__c != Null){
            
            		cs.Tax_Number__c.addError('ERROR!!!!!');
            	}
            }
            
            else if(trigger.isUpdate){
      
               
                if(duplicatecaseList.size()> 0 && 
                   cs.permit_duplicate__c == FALSE && 
                   cs.Tax_Number__c != Null &&
                   System.trigger.oldMap.get(cs.id).Tax_Number__c != System.trigger.newMap.get(cs.id).Tax_Number__c ){
            
                	cs.Tax_Number__c.addError('ERROR!!!!!');
            
               		 }
            }
        }    */
}

 

Hi All;

 

I have a class runs after trigger. I need my class not run after an update when the certain field not updated. (I need my trigger runs after tax number changes) In trigger body it is possible to accomplish this with;

 

System.trigger.oldMap.get(c.id).Tax_Number__c != System.trigger.newMap.get(c.id).Tax_Number__c )

 

I can not add this code in a class. There must be some other way we can compare old value vs new value in a class. Can anyone help me with the issue I have?

 

Thank you very much for your help.

I have a class runs before insert cases. It checks the duplicated tax number. It works perfect in Sandbox but there is covearge problem in Production. Can anyone help with the issue?

 

Thanks

public class TaxNumberDuplicate{

    public static void checkDuplicates (List<Case> caseList) {
    
        List<Case> duplicatecaseList = new List<Case>();
        
        for (Case c : caseList) { 
		
				duplicatecaseList = [SELECT id FROM Case WHERE Tax_Number__c =: c.Tax_Number__c];
			}
            
            if(trigger.isInsert){
            
            
            if(duplicatecaseList.size()> 0 && 
               c.Permit_Duplicate__c== FALSE && 
               c.Tax_Number__c != Null){
            
            c.Tax_Number__c.addError('ERROR');
            }
            }
            else if(trigger.isUpdate){
            
                duplicatecaseList = [SELECT id FROM Case WHERE Tax_Number__c =: c.Tax_Number__c];
            
                if(duplicatecaseList.size()> 0 && 
                   c.Permit_Duplicate__c == FALSE && 
                   c.Tax_Number__c != Null){
            
                c.Tax_Number__c.addError('ERROR');
            
                }
            }

    }
}

 

When I perform a certain export operation using the Apex Data Loader GUI, the operation takes about 10 seconds to complete.

 

When I attempt the exact same operation using the Apex Data Loader through the command line, the operation takes almost 1 hour to complete.

 

Has anyone else encountered this massive discrepancy?  And does anyone have any ideas on how to speed up the command line operation?

Hi everyone,

 

I have US university names stored in Accounts. I also collect information from web-to-lead, "university name"  is a drop down comes as a text field from web site to lead. Landing field in Leads is called 'University Name". (University_name__c) I would like to update lookup field "University" in Leads (University__c) (which is a lookup and connected to Accounts) by using the text value from University_name__c. Here is the code I am working with. I appreciate a lot if anyone can help.

 

trigger LeadAccount on Lead (before insert, before update) {

   

List<String> LeadUni = new List<String>();
   

    //University_name__c is a text field in Leads

   

    for(Lead ld : trigger.new)
    if(ld.University_name__c != null)
    LeadUni.add(ld.University_name__c);

 
    //AccountMap stores Account id from University_name__c field because Account.Name = Lead.University_name__c.

     
    Map<String, Account> AccountMap = new Map<String, Account>(
    [SELECT id from Account where name IN: LeadUni]);
    
  

    for(Lead ld : Trigger.new)

    ld.University__c = AccountMap.get(ld.University_name__c).id;
   
   }

 

Thanks

Hi All,

 

I have two objects Event__C and Registrant__C .on Registrant object we hav a lookup field event link pointing to event object .

 

Now i have created a VF page on event object which i am displaying on site.

in this page the first part shows details of events using output field and the second part shows registrant object fields so that a site user can register for the event .But i am not able to do it properly .Please help me .

 

Getting error "

 

Error: Invalid field Registrant__r for SObject Event__c

"

Heres the code

 

<apex:page standardController="event__c" sidebar="false" showHeader="false" extensions="Registerbutton">

<table width="90%" align="center">
<tr>
<td>
<apex:form >
<apex:pageBlock title="Welcome For Registration" >

<apex:pageBlockSection title="Event Details">

<apex:Outputfield value="{!Event__c.Name}"  />
</apex:pageBlockSection>


<apex:pageBlockSection title="Guest Information" columns="2">
<apex:inputField value="{!Event__c.Registrant__r.First_Name__c}" />
<apex:inputField value="{!Event__c.Registrant__r.Last_Name__c}" />
<apex:inputField value="{!Event__c.Registrant__r.Company__c}" />
<apex:inputField value="{!Event__c.Registrant__r.Email__c}" />
<apex:inputField value="{!Event__c.Registrant__r.Phone__c}" />
<apex:inputField value="{!Event__c.Registrant__r.Address__c}" />
</apex:pageBlockSection>



<apex:pageBlockButtons location="bottom" >
<apex:commandButton action="{!Register}" value="Register " />
</apex:pageBlockButtons>
</apex:pageBlock>
<apex:image value="{!$Resource.elephant1}" width="100%" height="50%" />
</apex:form>
</td>
</tr>
</table>

</apex:page>

Hi,

 

 

I need to create one Grid Structure in Visualforce page. The row Headings and Column headings will get populatetd from 2 lists. Can anybody please tell me how to achieve this..

 

I will give one example. Say, I have a list of Strings containings Account Names and another List containing Contact Names. Now, I need to keep Account Names in rows and Contact names in columns. At least I am trying to acheve this before proceeding further.

 

Please help..

 

Thanks in advance,

Suvra