-
ChatterFeed
-
5Best Answers
-
0Likes Received
-
0Likes Given
-
3Questions
-
55Replies
API version 32 - Creating new SforceService gives error
On the login call:
SforceService sforceSession = new SforceService();
it is generating the following error:
System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS0030: Cannot convert type 'xxx.ListViewRecordColumn[]' to 'xxx.ListViewRecordColumn'
error CS0030: Cannot convert type 'xxx.ListViewRecordColumn[]' to 'xxx.ListViewRecordColumn'
error CS0029: Cannot implicitly convert type 'xxx.ListViewRecordColumn' to 'xxx.ListViewRecordColumn[]'
error CS0029: Cannot implicitly convert type 'xxx.ListViewRecordColumn' to 'xxx.ListViewRecordColumn[]'
It works fine is I use the previous wsdl. Did the object change?
Thanks
-
- webservices2
- September 09, 2014
- Like
- 0
- Continue reading or reply
Issues with date format for [28-31] Dec
I have an issue with Date formating for the following dates 28-Dec-2014, 29-Dec-2014, 30-Dec-2014, 31-Dec-2014. Whenever I format one of these dates using either apex of Visualforce, a year is added to the formated date (31 Dec 2014 becomes 31 Dec 2015)
Other dates work fine.
This is really easy to reproduce using execute anonymous:
Date testDate = Date.newInstance(2014, 12, 31);
System.debug('Date.newInstance(2014, 12, 31) : ' + testDate);
Output: Date.newInstance(2014, 12, 29) : 2014-12-30 00:00:00
System.debug('year : ' + testDate.year() + ' - month : ' + testDate.month() + ' - day : ' + testDate.day());
Output: year : 2014 - month : 12 - day : 30
System.debug('Datetime.newInstance(testDate.year(), testDate.month(), testDate.day()) : ' + Datetime.newInstance(testDate.year(), testDate.month(), testDate.day()));
Output: Datetime.newInstance(testDate.year(), testDate.month(), testDate.day()) : 2014-12-29 23:00:00
System.debug('Datetime.newInstance(testDate.year(), testDate.month(), testDate.day()).format("dd MMM YYYY") : ' + Datetime.newInstance(testDate.year(), testDate.month(), testDate.day()).format('dd MMM YYYY'));
Output: Datetime.newInstance(testDate.year(), testDate.month(), testDate.day()).format("dd MMM YYYY") : 30 Dec 2015
The visualforce formating rendering the same is:
<apex:outputText value="{0, date, dd MMM YYYY}"><apex:param value="{!testDate}"/></apex:outputText>
Can someone please explain me what's going on?
Thanks
-
- Parra d'Andert
- August 08, 2014
- Like
- 0
- Continue reading or reply
Compile Error: unexpected token: '<' in date comparison
for(List<Opportunity> opportunities : [Select Id from Opportunity]) {for(Opportunity o : opportunities) {if(o.CloseDate < :Date.valueOf('2011-01-01') && o.StageName = 'Received');}} Map<Id, Opportunity> opportunitiesById = new Map<Id, Opportunity>(opportunities);
I'm getting the error on the {if(o.CloseDate < :Date.valueOf('2011-01-01') snippet. How can I do a date comparison without the < ?
Thank you!!
-
- amyer2240
- June 13, 2014
- Like
- 0
- Continue reading or reply
Email To case
When a user is sending an email from a case, the senders email address should be based on the case record type. If the case record type is returns, then it should be returns@Test.com. If recor dtype is test then it should be test@test.com.
How can this be done ?? Please help me on this.
Thanks
-
- chiranth
- October 18, 2012
- Like
- 0
- Continue reading or reply
Reports for Excell
Hello,
On the following, I've downloaded the zip file
http://wiki.developerforce.com/page/Salesforce_Reports_for_Excel_(Pilot)
I've tried to install it on a XP machine with all the requirement and last service packs, I've got an error message telling me that the operating system is not supported.
Installation work fine on 7.
Is there something wrong with XP ? Wiki and PDF documentation tell that it should work.
-
- Jean-Noel
- February 07, 2013
- Like
- 0
- Continue reading or reply
IDE issue
Hello,
When I create a new salesforce project and import the object from Salesforce, the following error occur.
An error has occurred. See error log for more details. com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.internal.bind.v2.runtime.reflect.Accessor
Anyone have an idea about that ?
I've already try to remove eclipse, reinstall it, install it on a fresh new computer, it's the same issue.
-
- Jean-Noel
- September 11, 2012
- Like
- 0
- Continue reading or reply
Salesforce PHP SOAP API - Unable to get custom WebService working
I have a PHP developer that need to use a webservice to enter information in Salesofrce. I've send to them partner.wsdl and CatalystWebservice.wsdl files along with login details to my sandbox to run all this on. The PHP developer need to use the SOAP API of Salesforce and once connected and logged in he need to call ->makeContact("FormField1", "FormField2", "etc...");
So after spending all day trying many things to try to help him and hitting many problems he have finally hit a wall he cannot climb. Here is the PHP code he have now:
<pre>
<?php
define("SOAP_CLIENT_BASEDIR","../soapclient");
$USERNAME ='******@********';
$PASSWORD ='******************************';
require_once (SOAP_CLIENT_BASEDIR.'/SforcePartnerClient.php');
require_once (SOAP_CLIENT_BASEDIR.'/SforceHeaderOptions.php');
try{
$mySforceConnection =newSforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/partner2.wsdl.xml');
$loginResult = $mySforceConnection->login($USERNAME, $PASSWORD);
$location = $mySforceConnection->getLocation();
$session_ID = $mySforceConnection->getSessionId();
$client =newSoapClient(SOAP_CLIENT_BASEDIR.'/CatalystWebservice.wsdl.xml');
$sforce_header =newSoapHeader("http://soap.sforce.com/schemas/class/CatalystWebservice","SessionHeader", array("sessionId"=> $session_ID ));
$client->__setSoapHeaders( array( $sforce_header ));
$client->makeContact("*****","*****","Address1","Address2","London","****","no-one@****","0123456789","07891236456","New Build Homebuy","This is my question\n\nAnd an other line","1","Test");
}catch(Exception $e){
print_r($e);
}
?>
</pre>
I have starred out sensitive information for here. When I run the above code I get the following output:
SoapFaultObject
(
[message:protected]=> UNKNOWN_EXCEPTION:An unexpected error occurred.Please include thisErrorIdif you contact support:***********-***(***********)
[string:Exception:private]=>
[code:protected]=>0
[file:protected]=>/home/******/public_html/********/test/partner.php
[line:protected]=>23
[trace:Exception:private]=>Array
(
[0]=>Array
.....
From C#, I can call the webservice without any problem, have anyone an idea of the part that is missing in the PHP code ?
-
- Jean-Noel
- March 02, 2012
- Like
- 0
- Continue reading or reply
API version 32 - Creating new SforceService gives error
On the login call:
SforceService sforceSession = new SforceService();
it is generating the following error:
System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS0030: Cannot convert type 'xxx.ListViewRecordColumn[]' to 'xxx.ListViewRecordColumn'
error CS0030: Cannot convert type 'xxx.ListViewRecordColumn[]' to 'xxx.ListViewRecordColumn'
error CS0029: Cannot implicitly convert type 'xxx.ListViewRecordColumn' to 'xxx.ListViewRecordColumn[]'
error CS0029: Cannot implicitly convert type 'xxx.ListViewRecordColumn' to 'xxx.ListViewRecordColumn[]'
It works fine is I use the previous wsdl. Did the object change?
Thanks
- webservices2
- September 09, 2014
- Like
- 0
- Continue reading or reply
how to mail merge using using the API
I use the SF API to query for distribution lists, contacts, and mail templates to provide custom mass mail capability.
The next step is to add support for personalization, ie: Hello {!Contact.Name} or {!Lead.Name} or {!User.Name}.
I found connection.Merge(mergeRequest[]) method, but not quite sure if this is what I am looking for, and google is not giving me anything obvious so far.
Can you steer me in the right direction?
I want to take a email template, and merge in contact, user etc information, and get a personalized email template string back, so I could pass it to my custom mail program.
thanks!
- Rafal buch
- September 05, 2014
- Like
- 0
- Continue reading or reply
Get manager id based on user id
Can anyone tell me the soql query getting manager id ??/
like user-->manager-->manager's manager and user1-->manager1-->manager of manager1
I wanna all managers id based on user
Thanks in advance
Karthick
- SS Karthick
- August 20, 2014
- Like
- 0
- Continue reading or reply
need help on my pagination visualforce page
public class sampleOutput5Cases { private List<Case> ca; private Contact cntact; public ApexPages.StandardSetController setController{get; set;} public sampleOutput5Cases (ApexPages.StandardController controller) { this.cntact= (Contact)controller.getRecord(); } public List<Case> getCa() //public void getCa() { ca = [Select id, CaseNumber, Origin, Status, Subject from Case where ContactId = :cntact.id]; setController = new ApexPages.StandardSetController(ca); setController.setPageSize(10); renderTable = true; return (List<Case>)setController.getRecords(); //return ca; } public Boolean renderTable { get{ if(renderTable == null) return false; return renderTable; } set; } public void Next() { setController.Next(); } public void Previous() { setController.Previous(); } /*public ApexPages.StandardSetController setController { get { if(cntact == null){ List<Case> caseList = new List<Case>(); return new ApexPages.StandardSetController(caseList); }else return setController; } set; }*/ public Boolean getHasNext() { if(setController==null) return false; return setcontroller.getHasNext(); } public Boolean getHasPrevious() { if(setController==null) return false; return setcontroller.getHasPrevious(); } public String getPageRangeText() { if(setController == null) return ''; else { Integer startP = ((setController.getPageNumber() - 1) * setController.getPageSize()) + 1; Integer endP; if(setController.getPageNumber()*setController.getPageSize() > setcontroller.getResultSize()) endP = setcontroller.getResultSize(); else endP = setController.getPageNumber()*setController.getPageSize(); return 'Showing Records : ' + startP + ' - ' + endP + ' of total ' + setcontroller.getResultSize(); } } public Boolean getShowPageRangeText() { if (setController==null) return false; if(setcontroller.getResultSize() > 0) return true; else return false; } }
and my VF page:
<apex:page standardController="Contact" extensions="sampleOutput5Cases"> <apex:includeScript value="/support/console/29.0/integration.js"/> <script type="text/javascript"> // Opens a subtab when a related Case Number is clicked function OpenNewCaseDetailTab(theId, name) { sforce.console.openPrimaryTab(null, '/' + theId, true, name ); } </script> <apex:form > <apex:pageBlock > <apex:pageBlockTable value="{!ca}" var="oCase" > <apex:column headerValue="CaseNumber" > <a HREF="#" onClick="OpenNewCaseDetailTab('{!oCase.Id}','{!oCase.CaseNumber}')" >{!oCase.CaseNumber}</a> <!--apex:commandLink value="{!oCase.CaseNumber}" action="/{!oCase.Id}" target="_blank"/--> <!--apex:commandlink style="margin-left:0px;color:#000;font-size:11px;" onclick="openPrimaryTab();return false;" value="{!oCase.CaseNumber}" /--> </apex:column> <apex:column value="{!oCase.Subject}"/> <apex:column value="{!oCase.Origin}"/> <apex:column value="{!oCase.Status}"/> </apex:pageBlockTable> </apex:pageBlock> <apex:commandButton id="btnPrev" value="Prev" action="{!Previous}" rendered="{!HasPrevious}" /> <apex:commandButton id="btnNext" value="Next" action="{!Next}" rendered="{!HasNext}" /> <br /> <br /> <apex:outputLabel id="opPageRangeText" styleClass="brandTertiaryBgr pbSubheader tertiaryPalette" rendered="{!ShowPageRangeText}" value="{!PageRangeText}" /> </apex:form> </apex:page>
- hy.lim1.3897974166558203E12
- August 15, 2014
- Like
- 0
- Continue reading or reply
Returning Logical SalesForce API Values?
Greetings Folks
I am new to this and have been thrown in to this project. I am wondering if you can tell me why the following query returns garbled
strings as opposed to logical values.
For example, this should a Bin Location field (gii__BinLocation__c) from a custom table (gii__ProductInventory__c). And it does, in fact,
do that. But the field returned should be something like "F-5". Instead, it looks like "a0Mi0000002lir9EAA".
Got any ideas?
Dim results As JacoApex.QueryResult = Nothing
results = bindingService.query("select gii__BinLocation__c from gii__ProductInventory__c WHERE Product_Name__c = '" & productid & "' ")
If results.records Is Nothing Then
Return ""
Else
Dim record As JacoApex.sObject = results.records(0)
Dim sfval As String = getFieldValue(gii__BinLocation__c", record.Any)
Return sfval
End If
- SF ADMINISTRATOR
- August 12, 2014
- Like
- 0
- Continue reading or reply
Exporting live data to an external website
The central idea is that my website developer would take the data and create a filterable table with it.
From my understanding, WordPress uses PHP, HTML, and a bit of CSS.
Is it possible to export such data to a WordPress website?
If anyone can shed a bit of light on to this inquiry, it would be greatly appreciated.
- David Gibbs 5
- August 12, 2014
- Like
- 0
- Continue reading or reply
Issues with date format for [28-31] Dec
I have an issue with Date formating for the following dates 28-Dec-2014, 29-Dec-2014, 30-Dec-2014, 31-Dec-2014. Whenever I format one of these dates using either apex of Visualforce, a year is added to the formated date (31 Dec 2014 becomes 31 Dec 2015)
Other dates work fine.
This is really easy to reproduce using execute anonymous:
Date testDate = Date.newInstance(2014, 12, 31);
System.debug('Date.newInstance(2014, 12, 31) : ' + testDate);
Output: Date.newInstance(2014, 12, 29) : 2014-12-30 00:00:00
System.debug('year : ' + testDate.year() + ' - month : ' + testDate.month() + ' - day : ' + testDate.day());
Output: year : 2014 - month : 12 - day : 30
System.debug('Datetime.newInstance(testDate.year(), testDate.month(), testDate.day()) : ' + Datetime.newInstance(testDate.year(), testDate.month(), testDate.day()));
Output: Datetime.newInstance(testDate.year(), testDate.month(), testDate.day()) : 2014-12-29 23:00:00
System.debug('Datetime.newInstance(testDate.year(), testDate.month(), testDate.day()).format("dd MMM YYYY") : ' + Datetime.newInstance(testDate.year(), testDate.month(), testDate.day()).format('dd MMM YYYY'));
Output: Datetime.newInstance(testDate.year(), testDate.month(), testDate.day()).format("dd MMM YYYY") : 30 Dec 2015
The visualforce formating rendering the same is:
<apex:outputText value="{0, date, dd MMM YYYY}"><apex:param value="{!testDate}"/></apex:outputText>
Can someone please explain me what's going on?
Thanks
- Parra d'Andert
- August 08, 2014
- Like
- 0
- Continue reading or reply
Apex Test Class Error after Error
I have set up a simple APEX class that is an extension for a Visualforce page. The VF page has a commandButton that saves and takes you to a different page called "Congratulations.vfp"
When I save my test I get this error:
Error: Compile Error: Variable does not exist: controller.Account.Joe_Test__c at line 15 column 9
Here is my Code:
APEX CLASS --
public class linkToVFP {
private ApexPages.StandardController controller;
public linkToVFP(ApexPages.StandardController controller) {
this.controller = controller;
}
public PageReference saveAndCongrat() {
controller.save(); // This takes care of the details for you.
PageReference congratsPage = Page.Congratulations;
congratsPage.setRedirect(true);
return congratsPage;
}
}
VF Page --
<apex:page standardController="Account" extensions="linkToVFP">
<apex:form >
<apex:inputCheckbox value="{!Account.Joe_Test__c}" selected="" />
<apex:commandButton value="Go To New Page" action="{!saveAndCongrat}"/>
</apex:form>
</apex:page>
Test --
@isTest
public class linkToVFP_TEST {
public static testMethod void testMyClass(){
Account a = new Account(Name = 'Test Account', Joe_Test__c = false);
insert a;
PageReference pg = Page.Congratulations;
Test.setCurrentPage(pg);
ApexPages.StandardController stdController = new ApexPages.StandardController(a);
linkToVFP customController = new linkToVFP(stdController);
system.assertEquals(false, a.Joe_Test__c);
controller.Account.Joe_Test__c = true;
PageReference newPage = controller.saveAndCongrat();
Account newAccount = [Select Id, Joe_Test__c From Account Where Id =: a.Id];
system.assertEquals(true, a.Joe_Test__c);
system.assertEquals(Page.Congratulations, newPage);
}
}
It is probably something simple that I am missing but I havent been working with Apex for long and I have come from a HTML/CSS/PHP background so you might need to dumb it down a little for me.
Thank you.
- westofoxley
- July 29, 2014
- Like
- 1
- Continue reading or reply
Trigger Help!
Well i'm trying to develop a trigger that when i create a record he brings me the twelve records before.
trigger aiu_InterfaceDesconto on InterfaceDesconto__c (after insert, after update) { for(InterfaceDesconto__c mDesconto:trigger.new){ Desconto__c Desc1 = new Desconto__c( DescontoMes1__c = Desc1.DescontoMes1__c, DescontoMes2__c = Desc1.DescontoMes2__c, DescontoMes3__c = Desc1.DescontoMes3__c, DescontoMes4__c = Desc1.DescontoMes4__c, DescontoMes5__c = Desc1.DescontoMes5__c, DescontoMes6__c = Desc1.DescontoMes6__c, DescontoMes7__c = Desc1.DescontoMes7__c, DescontoMes8__c = Desc1.DescontoMes8__c, DescontoMes9__c = Desc1.DescontoMes9__c, DescontoMes10__c = Desc1.DescontoMes10__c, DescontoMes11__c = Desc1.DescontoMes11__c, DescontoMes12__c = Desc1.DescontoMes12__c, TipoDesconto__c = Desc1.TipoDesconto__c, DataInclusao__c = Desc1.DataInclusao__c ); List<Desconto__c> desList = new List<Desconto__c>{ desList.DescontoMes1__c, desList.DescontoMes2__c, desList.DescontoMes3__c, desList.DescontoMes4__c, desList.DescontoMes5__c, desList.DescontoMes6__c, desList.DescontoMes7__c, desList.DescontoMes8__c, desList.DescontoMes9__c, desList.DescontoMes10__c, desList.DescontoMes11__c, desList.DescontoMes12__c }; upsert desList IdExterno__c; } }when i try to create the list the salesforce tells me that my variable desc1 doesn't exist.
- SolidLucas
- July 16, 2014
- Like
- 0
- Continue reading or reply
Only one condition is working?
<td >
<b><u>SUB/CustomerID(Accountcode) :</u> </b><td colspan="3"> <apex:outputField value="{!Quote__c.Account_Name__r.Account_Code__c }"/></td>
</td>
<td><apex:inputtext value="{!test}" /></td>
</tr>
<apex:commandButton value="Save" action="{!Save}"/>
controller:
public class createorder {
public List<quote__c> q {get;set;}
public List<Quote_line_Item__c> q1 {get;set;}
public List<Quote_line_Item__c> lineitemdata {get;set;}
public List<batch__c> modifiedbatch=new List<batch__c>();
public List<batch__c> finalbatch=new List<batch__c>() ;
public Date Today { get { return Date.today(); }}
public List<batch__C> lstbatch {get;set;}
public String quoteId{get;set;}
public String imageURL{get;set;}
public date date1{get;set;}
public date date2{get;set;}
public String customerponumber{get;set;}
public String Carrier{get;set;}
public String comment{get;set;}
public String quantity{get;set;}
public boolean discount{get;set;}
public decimal price{get;set;}
public String inputvalue{get;set;}
public quote__c quote{get;set;}
public string test{get;set;}
public createorder(ApexPages.StandardController controller) {
q1 = [select id,Name,Client_P_N__c, final_quantity__c, Final_Discount__c, Requested_Date__c,Final_Price__c from quote_line_item__c WHERE quote1__c = : Apexpages.currentPage().getParameters().get('Id')];
}
public pageReference Save(){
// q =[select id,Customer_PO_number__c,Account_name__c,Account_Name__r.Account_Code__c,order_date__c,requested_date__c,comment__c,Carrier__c from Quote__c where id=:Apexpages.currentPage().getParameters().get('Id')];
// update q;
quoteId=ApexPages.CurrentPage().getParameters().get('id');
quote__c q=[select id,Account_Code__c from quote__C where id=:quoteid];
quote__c qu= new quote__c();
qu.id=q.id;
qu.Customer_PO_number__c=customerponumber;
qu.Carrier__c=Carrier;
qu.order_date__c=date.today();
qu.comment__c=comment;
If(test==NULL){
qu.Test_field__c=test;}
else{
qu.test_field__c=qu.Account_Code__c;}
update qu;
update q1;
return null;
}
In this one condition is working every but not both .
I want that if value not there at text box qu.test_field__c=qu.Account_Code__c;
I want that if value there in textbox qu.tex_field__c=test;
why it is not taking two condition ?
Any other way?
}
- d.tejdeep@nicomatic.in
- July 04, 2014
- Like
- 0
- Continue reading or reply
How to get SMS request via twilio
The site url "https://somesalesforce.com/smsToApex" and same as the twilio account sms URL but this class can't called.
@RestResource(urlMapping='/smsToApex')
global class smsToApex
{
Static TwilioAccount account = TwilioAPI.getDefaultAccount();
@HttpPost
global static void incomingSMS()
{
// This will error out with System.LimitException if we would exceed
// our daily email limit
Messaging.reserveSingleEmailCapacity(1);
String expectedSignature = RestContext.request.headers.get('X-Twilio-Signature');
system.debug('ES' + expectedSignature);
String url = 'https://' + RestContext.request.headers.get('Host') + '/services/apexrest' + RestContext.request.requestURI;
Map <String, String> params = RestContext.request.params;
system.debug('smsToApex========>'+params);
// Validate signature
if (!TwilioAPI.getDefaultClient().validateRequest(expectedSignature, url, params)) {
RestContext.response.statusCode = 403;
RestContext.response.responseBody = Blob.valueOf('Failure! Rcvd '+expectedSignature+'\nURL '+url/*+'\nHeaders'+RestContext.request.headers*/);
return;
}
RestContext.response.responseBody = Blob.valueOf('ok');
String caseFrom = params.get('From');
String caseTo = params.get('To');
String caseBody = params.get('Body');
System.debug('Step 4 smsToApex caseFrom==>'+caseFrom);
System.debug('Step 5 smsToApex caseTo===>'+caseTo);
System.debug('Step 6 smsToApex caseBody===>'+caseBody);
Case ca = new Case();
ca.Subject = 'Test smsToApex caseFrom'+caseFrom;
ca.Description = 'Test smsToApex caseBody'+caseBody+','+caseTo;
ca.Origin = 'Phone';
INSERT ca;
}
}
- Ramesh Somalagari
- June 23, 2014
- Like
- 0
- Continue reading or reply
Compile Error: unexpected token: '<' in date comparison
for(List<Opportunity> opportunities : [Select Id from Opportunity]) {for(Opportunity o : opportunities) {if(o.CloseDate < :Date.valueOf('2011-01-01') && o.StageName = 'Received');}} Map<Id, Opportunity> opportunitiesById = new Map<Id, Opportunity>(opportunities);
I'm getting the error on the {if(o.CloseDate < :Date.valueOf('2011-01-01') snippet. How can I do a date comparison without the < ?
Thank you!!
- amyer2240
- June 13, 2014
- Like
- 0
- Continue reading or reply
How can i get the data from SQL server to salesforce via dataloader or jitterbit or any middleware tools..?
Does the data get stored in salesforce ?
Any help is greatly appreciated..
- sfdc2705
- April 29, 2014
- Like
- 0
- Continue reading or reply
Trigger which fires every 24 hours after created date
After 24 hours of record creation charges__c should be updated to a value(assume 200 then 0+200 = 200).
Later after 48 hours charges__c should be updated to(200+200=400).
This cycle is repeated every 24 hours. Any Suggestions ?
- ezdhanhussain
- January 20, 2014
- Like
- 0
- Continue reading or reply
outbound notifications exception
- RamaKrishna
- March 19, 2008
- Like
- 1
- Continue reading or reply