-
ChatterFeed
-
1Best Answers
-
0Likes Received
-
0Likes Given
-
11Questions
-
11Replies
Storing an option from apex:selectoption in a custom field on a custom object
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>
-
- lauraeci
- September 26, 2012
- Like
- 0
- Continue reading or reply
Trying to get Account email from an Object with a master detail relationship with the account
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
-
- lauraeci
- July 25, 2012
- Like
- 0
- Continue reading or reply
SOSL Help needed: System.QueryException: unexpected token: FIND
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;
}
}
}
-
- lauraeci
- May 01, 2012
- Like
- 0
- Continue reading or reply
System.CalloutException: no protocol Error on posting to Silverpop Engage API
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>
-
- lauraeci
- April 24, 2012
- Like
- 0
- Continue reading or reply
HTTP HttpRequest fails in Triggers Callout from triggers are currently not supported.
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!
-
- lauraeci
- February 14, 2012
- Like
- 0
- Continue reading or reply
OutboundMessage is not sent on Creation of Custom Object
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!
-
- lauraeci
- February 13, 2012
- Like
- 0
- Continue reading or reply
Passing Custom Field Data from the Lead to the Contact on Convert
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;
}
}
}
-
- lauraeci
- February 02, 2012
- Like
- 0
- Continue reading or reply
How to go to the a new object page on edit when a search is empty
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!
-
- lauraeci
- January 31, 2012
- Like
- 0
- Continue reading or reply
How to disable the mass email option
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.
-
- lauraeci
- January 30, 2012
- Like
- 0
- Continue reading or reply
[Element {}item invalid at this location]
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
-
- lauraeci
- November 21, 2011
- Like
- 0
- Continue reading or reply
sObject type is not supported when using custom objects in the PHP Soap API
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 . "'"; 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 |
-
- lauraeci
- November 18, 2011
- Like
- 0
- Continue reading or reply
Storing an option from apex:selectoption in a custom field on a custom object
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>
- lauraeci
- September 26, 2012
- Like
- 0
- Continue reading or reply
Trying to get Account email from an Object with a master detail relationship with the account
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
- lauraeci
- July 25, 2012
- Like
- 0
- Continue reading or reply
System.CalloutException: no protocol Error on posting to Silverpop Engage API
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>
- lauraeci
- April 24, 2012
- Like
- 0
- Continue reading or reply
Passing Custom Field Data from the Lead to the Contact on Convert
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;
}
}
}
- lauraeci
- February 02, 2012
- Like
- 0
- Continue reading or reply
How to go to the a new object page on edit when a search is empty
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!
- lauraeci
- January 31, 2012
- Like
- 0
- Continue reading or reply
sObject type is not supported when using custom objects in the PHP Soap API
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 . "'"; 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 |
- lauraeci
- November 18, 2011
- Like
- 0
- Continue reading or reply
Record type unavailable. Cannot find default record type of the appropriate type.
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?
- ollie123
- September 08, 2009
- Like
- 0
- Continue reading or reply