• 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

 

 

Hi!

 

The the same query that works in the workbench fails running in Salesforce:

 

System.QueryException: unexpected token: FIND

 

Any help is appreciated!

 

Thanks!

Laura

 

The object eci_HTTPEventLog__c contains the following:

eci_HTTPEventLog__c.response__c = '<Envelope><Body><RESULT><SUCCESS>true</SUCCESS<SESSIONID>349557C0E497DDFC154379B4DF528057</SESSIONID><ORGANIZATION_ID>5872ae98-1341ac53619-d7c8ec57ae636c7258d3eb0ef0e531f2</ORGANIZATION_ID<SESSION_ENCODING>;jsessionid=349557C0E497DDFC154379B4DF528057</SESSION_ENCODING</RESULT></Body></Envelope>';

 

 

            String response = '';

            

            String queryString = 'FIND {jsessionid} IN ALL FIELDS RETURNING eci_HTTPEventLog__c';  // fails here

            

            for (LIST<SObject> sobj : database.query(queryString)) {

              for (SObject objs : sobj) {

                  

                if (objs.getSObjectType() == eci_HTTPEventLog__c.sObjectType)

                {

                  eci_HTTPEventLog__c event = (eci_HTTPEventLog__c) objs;

                  response = event.response__c;

                }

              }

            }

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>


Apex script unhandled trigger exception by user/organization: 005U0000000IWs4/00DU0000000JDvW

 

AssociateSection: execution of BeforeUpdate

 

caused by: System.CalloutException: Callout from triggers are currently not supported.

 

Trigger.AssociateSection: line 58, column 1

 

Is there a work around for adding an HTTP post inside a trigger? Apex Classes??

 

Thanks!

I have an Outbound Message set to post to a URL when a custom object is created.  The message is part of a workflow.  I can tell the workflow is working correctly because the Update Field part works to update the field but the Outbound Message is not being sent to the URL.

 

There are no errors in the log or anything shown at all.  Everything was working correctly yesterday so I'm not sure what happened.  

 

Is there anyway to test an Outbound Message or work around to creating an Outbound Message, perhaps through Apex??

 

This functionality is critical to our process and we have an alpha test coming up within a couple days when this is expected to work so finding a solution is urgent.  Any help would be very appreciated!

 

Thanks!

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!

 

 

I'd like to be able to remove the mass email option from the leads so that users are not allowed to perform a mass email.

Using the Saleforce SforcePartnerClient, getting this error when I try to query a custom object.  I am using the associated partner wsdl xml file for the account.

 

Error:

 

Unexpected exception of type [SoapFault] with message [Element {}item invalid at this location] in [/Applications/XAMPP/xamppfiles/htdocs/xampp/libraries/sforce/SforceBaseClient.php line 782]

 

Thanks,

-Laura

 

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 

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?