• naypers rtf
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hi!, I hope someone can help me.

 

I'm creating a function to check if I have a record in a SOQL table, I using a custom object, my app will need a 'Default' record to work, if this record doesn't exist, I'd like to create it from here.

 

I have something like this, but this function doesn't create the record and I dont know why.

 

    public void checkDefault(){

        try{ 
        
	// If is possible to do this, it means I have a record 'Default'.
        customObject__c obj = [ SELECT Concept1__c,Concept2__c,Concept3__c,Concept4__c  FROM customObject__c WHERE name='Default' LIMIT 1 ];
        update obj;  

        } 
		
	// If I don't have it... create it.
         catch(Exception ex){ 

             customObject__c obj = new customObject__c(
                name='Default',
                Concept1__c = ' Text ',
                Concept2__c = ' Text ',
                Concept3__c = ' Text ',
                Concept4__c = ' Text ');
        }
            
    }

 

Please help!

Is very simple, but I can't see the values of a custom field in a pageBlockTable when I use the group edition, I don't have problems when I use the developer edition. Anyone know why??

This is the problem

I'm using a pageBlockTable in a VF page, and I using a controller. The database is OK, I see the values there.

 

I hope someone can help me, thank you...

Hi, I'd like to know how I can to insert this filter in the query, without Security problems. thank you

  

public Opportunity[] getMyObjectOpportunities() {
 
List<Opportunity> itemsOpportunities;

String filter = ' order by ' + columnName + ' ' + sortDirection;

itemsOpportunities = [ SELECT o.Name, o.stageName, o.closeDate, o.Id, o.Probability FROM Opportunity o WHERE CreatedById =: getUserId()    /* ADD "filter"  */  ];
 
return itemsOpportunities ;
}