• lauraeci
  • NEWBIE
  • 25 Points
  • Member since 2011

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

I have a simple VisualForce page which allows me to select 3 different options in a dropdown.  I'd like to be able to store that result in a field on a custom object but I'm not sure how to do that.  I can't use a picklist type.  

 

Thanks!

 

<apex:page >
<!-- Begin Default Content REMOVE THIS -->
<h1>Congratulations</h1>
This is your new Page: OptionPicker
<!-- End Default Content REMOVE THIS -->
<apex:form >
<apex:selectList id="recent" size="1" >
<apex:actionSupport event="onchange" action="{!changeRt}" reRender="recentmodify"></apex:actionSupport>
<apex:selectoption itemLabel="option1" itemValue="card"></apex:selectoption>
<apex:selectoption itemLabel="option2" itemValue="check"></apex:selectoption>
<apex:selectoption itemLabel="option3" itemValue="Scholarship"></apex:selectoption>
</apex:selectList>
</apex:form>
</apex:page>

I have an object that has a master detail relationship with the account.  I query the object and get the Account Id from it for an existing Account associated with myObject, myObject.Account_ID__c.

 

Trying to create a new account out of that Id so I can get the email from it but when I do the assignment to a new account, the email is null.  

 

Any help is appreciated!

 

Thanks!

-Laura

 

Account a = new Account(Id=myObject.Account_ID__c);

 

System.debug(a.PersonEmail);  // PersonEmail is null

 

 

Trying to create a Post to the Silverpop Engage API with this code.  Getting the error System.CalloutException: no protocol.  Tried the same call in Chrome's Advanced Rest Client and it works there.

 

Any help would be appreciated!

 

Thanks!

 

 

          HttpRequest req = new HttpRequest();
          req.setEndpoint(url);
          req.setHeader('Content-Type', 'text/xml;charset=UTF-8');
          
          System.debug('SEND HTTP BODY: ' + body);
          
          req.setBody(body);
          req.setMethod('POST');
                
          Http http = new Http();
          HTTPResponse res = http.send(req);        // FAILING HERE
          System.debug('REQUEST BODY' + res.getBody());

 

url is set to the Silverpop engage API EndPoint.

 

body is set to:

 

<?xml version="1.0"?>
<Envelope>
<Body>
<Login>
<USERNAME>me@myemail.com</USERNAME>
<PASSWORD>mypassword</PASSWORD>
</Login>
</Body>
</Envelope>

 

Error:

 

11:30:55.032 (32265000)|SYSTEM_METHOD_EXIT|[17]|System.Http.send(APEX_OBJECT)
11:30:55.032 (32319000)|FATAL_ERROR|System.CalloutException: no protocol: ://<http:silverpop API Endpoint here>


I am trying to get this trigger working where after I have converted a Lead to a contact, I want to save data from the Lead.Secondary_Email__c to the Contact.Secondary_Email__c.

 

I feel like I'm close but I can't get a contact from the Lead...  Any help would be appreciated!

 

trigger onLeadConverts on Lead (before update){

for (Lead l: trigger.new){
if(l.isconverted==TRUE){
// l.ConvertedContactId;

// Contact c = new Contact(id = l.ConvertedContactId);
//Contact c = Contact(id = l.ConvertedContactId);

 

// l.ContactId is not recognized?? How do I get the ContactID from the Lead?
System.assert(l.ContactId);

Contact[] c = [select Id from Contact where Id = l.ContactId];


c.Secondary_Email__c = l.Secondary_Email__c;
}
}
}

In my view, I have a lookup relationship between two objects.  When I create the first object, if the lookup object is not already created on search, I would like to be able to create a new one then select the newly created object.

 

Any help on how to do this would be appreciated!

 

Thanks!

 

 

Using the PHP API code...

$theQuery = "Select s.TranscriptGrade__c, s.SystemModstamp, s.StudentID__c, 
            s.StudentCourseID__c, s.SignatureGrade__c, s.ReceiptNumber__c, s.Project_ID__c, 
            s.OwnerId, s.Name, s.Multi_Class_Project_id__c, s.LastModifiedDate, s.LastModifiedById, 
            s.IsDeleted, s.Id, s.GradeDate__c, s.EvalPosted__c, s.CreditStatus__c, s.CreatedDate, 
            s.CreatedById, s.ClientID__c From STUDENT_COURSE__c s Where s.ClientID__c='" . $theContactID . "'";
 
$result = $theSFConnection->query($theQuery); 

I am getting the error:

Unexpected exception of type [SoapFault] with message [INVALID_TYPE: 
s.CreatedById, s.ClientID__c From STUDENT_COURSE__C s Where s.ClientID__c=''
                                  ^
ERROR at Row:5:Column:47
sObject type 'STUDENT_COURSE__C' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names

Tried the same call using the Java Eclipse schema tool and the query succeeds so there seems to be an issue with the PHP API.  We are developing our application with the requirement of using PHP so we would like to figure out a work around to this issue.

Thanks,
-Laura 

Record type unavailable Cannot find default record type of the appropriate type.

 

I am seeing this error when trying to Convert a lead. I have checked the profile for the current user, and the default record types are both Contacts and Accounts are accessible. (I have selected Do Not Create Opportunity, though there are no opportunity record types).

 

The docs were no help at all, no results in Google for the error. Does anyone know what the solution is?