• Vitap Ramdevputra
  • NEWBIE
  • 0 Points
  • Member since 2014


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

While creating a custom object, in object classification, we have this three options(either all enabled/disabled).
I want to know difference between these three.

Here is the image of object classification.
Object Classification

While creating a custom object, in object classification, we have this three options(either all enabled/disabled).
I want to know difference between these three.

Here is the image of object classification.
Object Classification

Hi,

I am getting an error  Error: Syntax error. Missing ')'  while saving a visualforce page on below line: 
<apex:inputCheckbox id="theScheduleCheckbox" styleClass="scheduleCheckbox" selected="{!IF(FbPost.scheduledHour = '', true, false)}"  onchange="showCalendar(this, 0);" />

As on inspection the if statement  "{!IF(FbPost.scheduledHour = '', true, false)}" causes the error.

Can anyone help me to find the solution?


I have a basic Custom Controller working fine on my sandbox but I'm having the most difficult time getting any code coverage %.  I can't tell what I have to do in order to get this covered to 75% because it is at 0% no matter what I have done now even though I have ran the following test or a variation of it successfully.

----

@isTest
private class changeCapacityControllerTestClass {
    static testMethod void changeCapacity() {
       //setdate = datetime.newInstance(1960, 2, 17);
       date myDate = date.newInstance(1960, 2, 17);
       Socket__c s = new Socket__c(Availability_Zone__c='a13e0000000g8QI', Activation_Date__c=mydate,Socket_Additions__c=33 );
       System.debug('AvailZone ' + s.Availability_Zone__c);
       System.debug('Activation Date: ' + s.Activation_Date__c);
       System.debug('sockets' + s.Socket_Additions__c);
       System.debug('Nothing: ' + 'blah');   

       // Insert
       insert s;
   
       // Retrieve the new Socket Addition
       s = [SELECT Socket_Additions__c FROM Socket__c WHERE Activation_Date__c =:s.Activation_Date__c];
       System.debug('Socket Count after this was ran: ' + s.Socket_Additions__c);

       // Test that the stuff worked
       //System.assertEquals('a13e0000000g8QI', s.Availability_Zone__c);
       System.assertEquals(33, s.Socket_Additions__c);
       System.assertEquals(mydate, s.Activation_Date__c);                    
    }
}
  • May 19, 2014
  • Like
  • 0
The documentation is not very good on writing a real, effective test class for the sendEmail method.  I've got a trigger that works fine and sends an email through apex, but I'm at a loss for how to write a test class for it:

trigger DocusignStatusTrigger on dsfs__DocuSign_Status__c (after update)
{
    for(dsfs__DocuSign_Status__c ds : Trigger.new){
       if(ds.dsfs__Envelope_Status__c == 'Completed'){
            
            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            String[] toAddresses = new String[]{'rosstesta4@gmail.com','rossgilb@gmail.com','rosstesta3@gmail.com'};
            mail.setToAddresses(toAddresses);
            mail.setReplyTo('rgilbert@pingidentity.com');
            mail.setSenderDisplayName('Ping Identity');
            mail.setSubject('A Ping Identity Sales Order has just been signed');
            mail.setBccSender(false);
            mail.setUseSignature(false);
            mail.setPlainTextBody('A Ping Identity Sales Order for '+ ds.Account_Name__c +' has just been signed.  You may view the signed document attached to this email, or view it as a PDF attachment in Salesforce, here: https://cs14.salesforce.com/' + ds.Id+'.  The opportunity record for this envelope can be viewed here: https://cs14.salesforce.com/'+ ds.dsfs__Opportunity__c); 
            mail.setTargetObjectId(ds.OwnerId);
            mail.saveAsActivity = false;       
           
            List<Messaging.Emailfileattachment> fileAttachments = new List<Messaging.Emailfileattachment>();
            
            for (Attachment a : [select Name, Body, BodyLength from Attachment where ParentId = :ds.Id]){
                Messaging.Emailfileattachment efa = new Messaging.Emailfileattachment();
                efa.setFileName(a.Name);
                efa.setBody(a.Body);
                fileAttachments.add(efa);
            }
            mail.setFileAttachments(fileAttachments);
    
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });  
        }       
    }
}


  • May 19, 2014
  • Like
  • 0
Hello,
I created a custom field of satisfaction with type number.
I made a reques to see what returned me:
select Name,Satisfaction__c from Contact

And I is not got what I wanted:

The desired:
Name, Satisfaction__c
Marcia Morgado, 10
Rosana Moreira, 8
Vanessa Pedrozo, 7

The obtained:
Name, Satisfaction__c
Marcia Morgado, 0032000001E3fVyAAJ
Rosana Moreira, 0032000001D8WWsAAN
Vanessa Pedrozo, 0032000001D8Y4nAAF

CODE:

String query=inputText;
String first=query.substringAfter('select ');  
first=  first.substringBefore('from');
     
    string title= first+'\n';
    string contenuCSV = title;

    string queryResultString = '';
    list<sObject> queryResult = (List<sObject>)database.query(inputText);
    for(sObject a: queryResult)
    {
        queryResultString = queryResultString + string.valueof(a);
    }
    list<string> queryLines = queryResultString.split('}');
    for(string s:queryLines){
        list<string> queryCol = s.split(',');
        for(string st:queryCol){
            contenuCSV = contenuCSV + st.substringAfter('=') + ',';
        }
        contenuCSV = contenuCSV.substringBeforeLast(',').substringBeforeLast(',') + '\n';
    }

How do I solve this problem with numeric fields?
Thank you,