• pbattisson
  • SMARTIE
  • 1036 Points
  • Member since 2010
  • Technical Architect
  • Mavens Consulting


  • Chatter
    Feed
  • 30
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 258
    Replies

Hi Can anyone help me to resolve this. I am getting this error in VF controller. I am creating a custom picklist in VF controller wrapper class and  getting this
Error in debug while second run : System.TypeException: Invalid conversion from runtime type String to List<System.SelectOption>

sample code :
public class controller{
public class Wrapper
    {
      public boolean isCheck{get;set}
      public List<SelectOption> Picklist{get;set;}
      public String name{get;set;}
        }    

public List<wrapper> getwrapperlist()
    {
   
    return wrapperlist;
    } 

   public void setwrapperlist()
   {
    this.wrapperlist=wrapperlist;
   }

  public void method1()
{
 Wrapper w=new Wrapper();
w.addPicker=new List<selectoption>();
for(list<object> s:olist){
w.addPicker.add(new SelectOption (s.fname,s.fname));
}
wrapperlist.add(w);

}
}

 

Hi Everyone, in the module Wave Analytics Trail |Wave Analytics Basics | Creating Your First Wave Analytics App, the user is directed to go to http://startsurfingthewave.herokuapp.com/trailhead_dataflow, and download the file Analytics Trailhead Dataflow.json into a local directory.  Continuing to follow the directions, I go into the Wave Analytics app, navigate to the Dataflow View, click on Settings | Upload, select the Analytics Trailhead Dataflow.json file, and click on the "Upload" button.  Once I do that, I receive the following error: TypeError: Object doesn't support this property or method.  When I click the "Continue" button, the error "Upload failed because the file is not a valid .json file".  If anyone knows how to fix this, I would be grateful.  I don't know why this isn't working since the dataflow file is provided by Salesforce via the link.
Hi,

I need to apply custom styles to Ideas page. Is it possible to override the standard salesforce styles and apply our custom styling to it?

Thanks in advance
I may be missing something very obvious, but I need to figure out how to generate a pdf of an existing quote in Apex.  There has to be some way to call the native PDF generation on the quote page and just pass in the id of the quote as a parameter, but I'm having a hard time finding anything. And then once the quote is generated I would like to be able to email it.  Any help would be greatly appreciated!
Hi

Can anybody please assit me on how to integrate external application with in salesforce.

The business use case is there will a link in salesforce Account page and they need to redirect to external web application with the same User and role previlages.

Thanks in Advance!
Hi,

Can anybody help me out in understanding what are the specific area or functionality in which we can use remote objects. How complex programming we can do in remote objects. Apart from mobile version can we use in other areas like in Service cloud etc.

Regards
 
Hello, 

I recently started to research about Sales Force, I was trying to use Sales Force and Postman (REST Service) and I wondered about if is possible to create it using the trial version, because when go to create a class in the "develop" tab I cant see the Apex Class option, is there any other way to create a webservice? Apigee works exacly the same? just creating one service by my own?

Thank you very much for your help,
Greetings.
  • October 02, 2014
  • Like
  • 0
I created Apex Batch Class.
When I try to inport over 50,000 rows of CSV file, the following error appears.
"Batchable instance is too big".
I don't know how to resolve this issue...
The following is my batch code.


global with sharing class NSRCOR_MER_Import_Batch implements Database.batchable<string>, Database.Stateful{
    private String m_csvFile;
    private String m_batchLogId;
    Boolean isHeader = true;
    private static Integer rowCount;
    private static Integer importCount =0;
    Boolean success = true;
    String remarks = '';
  
    global NSRCOR_MER_Import_Batch(String csfFile, String batchLogId){
        m_csvFile = csfFile;
        m_batchLogId = batchLogId;
    }
    global Iterable<string> start(Database.batchableContext batchableContext){
       return new NSRCOR_MER_CSVIterator(m_csvFile,'\n');
    }
    global void execute(Database.BatchableContext batchableContext, List<string> scope)  {    
        List<NSRCOR_MER_PO__c> importPO = new List<NSRCOR_MER_PO__c>();
        List<NSRCOR_MER_PO__c> updatePO = new List<NSRCOR_MER_PO__c>();
        Integer lineNo = 0;
        Integer countInsert = 0;
        Integer countUpdate = 0;
        if (rowCount == null){rowCount =0;}
    
        // Get list of exist PO data
        Map<String,NSRCOR_MER_PO__c> poMap = new Map<String,NSRCOR_MER_PO__c>();
        for (NSRCOR_MER_PO__c rt : [SELECT id,name,PO_Title__c, Vendor_Name__c FROM NSRCOR_MER_PO__c]){
            poMap.put(rt.name, rt);
        }
        NSRCOR_MER_Import_Log__c importLog =[SELECT Nubmer_of_Rows__c FROM NSRCOR_MER_Import_Log__c WHERE Id=:m_batchLogId ];
        if(importLog.Nubmer_of_Rows__c ==null){
            rowCount = 0;
        }else{
            rowCount = Integer.valueOf(importLog.Nubmer_of_Rows__c);
        }
      
        Map<Integer,Integer> toInsertRownum = new Map<Integer,Integer>();
        Map<Integer,Integer> toUpdateRownum = new Map<Integer,Integer>();
        Map<Integer,String> poMapInsert= new Map<Integer,String>();
        Map<Integer,String> POMapUpdate= new Map<Integer,String>();
 
        for(String row : scope){
            if(isHeader){
              isHeader = false;
            }else{
              List<String> csvValues = row.split(',');
              String poName = null;
              
                // PO
                NSRCOR_MER_PO__c po     = new NSRCOR_MER_PO__c();
                if(poMap.get(this.deSanitize(csvValues[0].trim()))==null){
                    po.Name             = this.deSanitize(csvValues[0].trim());
                    po.PO_Title__c      = this.deSanitize(csvValues[1].trim());
                    po.Vendor_Name__c   = this.deSanitize(csvValues[2].trim());
                    importPO.add(po);
                    poName = po.Name;
                    poMap.put(poName, po);
                    toInsertRownum.put(countInsert,lineNo);
                    poMapInsert.put(countInsert,poName);
                    countInsert++;
                        
                }else{
                    if(poMap.get(this.deSanitize(csvValues[0].trim())).PO_Title__c != this.deSanitize(csvValues[1].trim()) ||
                       poMap.get(this.deSanitize(csvValues[0].trim())).Vendor_Name__c != this.deSanitize(csvValues[2].trim())){
                        poMap.get(this.deSanitize(csvValues[0].trim())).PO_Title__c    = this.deSanitize(csvValues[1].trim());
                        poMap.get(this.deSanitize(csvValues[0].trim())).Vendor_Name__c = this.deSanitize(csvValues[2].trim());
                        updatePO.add(poMap.get(this.deSanitize(csvValues[0].trim())));
                        toUpdateRownum.put(countUpdate,lineNo);
                        poMapUpdate.put(countUpdate,poName);
                        countUpdate++;
                    }
                }
                lineNo++;
              
            }
         
        }
      
        if(importPO!=null && importPO.size()>0){
            //insert importPO;
            Database.SaveResult[] srList = Database.insert(importPO, false);
            Integer ln = 0;
            for (Database.SaveResult sr : srList) {
                if (sr.isSuccess()) {
                    //importCount ++;             
                }else{
                    success = false;
                    // Operation failed, so get all errors              
                    for(Database.Error e : sr.getErrors()) {
                        Integer num = toInsertRownum.get(ln) + rowCount + 1;
                        //remarks = remarks + 'ERROR: Row '+ num + '; '+ 'PO No. '+  poMapInsert.get(ln)+'; '+e.getMessage()+'\n';
                        remarks = remarks + 'ERROR: Row '+ num +'; '+e.getMessage()+'\n';
                    }
                }
                ln++;
            }       
          
        }
        if(updatePO!=null && updatePO.size()>0){
           // update updatePO;
            Database.SaveResult[] srList = Database.update(updatePO, false);
            Integer ln = 0;
            for (Database.SaveResult sr : srList) {
                if (sr.isSuccess()) {
                    //importCount ++;             
                }else{
                    success = false;
                    // Operation failed, so get all errors              
                    for(Database.Error e : sr.getErrors()) {
                        Integer num = toUpdateRownum.get(ln) + rowCount + 1;
                        //remarks = remarks + 'ERROR: Row '+ num + '; '+ 'PO No. '+  poMapUpdate.get(ln)+'; '+e.getMessage()+'\n';
                        remarks = remarks + 'ERROR: Row '+ num +'; '+e.getMessage()+'\n';
                    }
                }
                ln++;
            }
        }
      
        rowCount =  rowCount + lineNo;         
        importLog.Nubmer_of_Rows__c =  rowCount;
        update importLog;

    }
    global void finish(Database.BatchableContext batchableContext){
      
      
        NSRCOR_MER_Import_Log__c importLog = [SELECT Id,Name,Status__c,Remarks__c,Import_Count__c, Nubmer_of_Rows__c FROM NSRCOR_MER_Import_Log__c WHERE Id=:m_batchLogId];
        if(!success){
            if(remarks.length() > 2000){
                importLog.Remarks__c = remarks.substring(0,2000);
            }else{
                importLog.Remarks__c = remarks;
            }
            importLog.Status__c = 'Failed';
          
        }
        //importLog.Import_Count__c = String.valueOf(importCount);
        importLog.Nubmer_of_Rows__c =0;
        Update importLog;
      
        Database.executeBatch(new NSRCOR_MER_Items_Import_Batch(m_csvFile, m_batchLogId));
      
    }
  
    private String deSanitize(String value) {
        return value.replace('#comma#',',').replace('#dbc#','"');
    }
}
Hey,,
Can anyone tell me how can I reset the governor limits??
My class is similar to this class: 

@RestResource(urlMapping='/MyRestContextExample/*')
                           
global with sharing class MyRestContextExample {

    @HttpGet
    global static Account doGet() {
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
        String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
        Account result = [SELECT Id, Name, Phone, Website FROM Account WHERE Id = :accountId];
        return result;
    }
 
}

Test method :

public static testMethod void AttendeeTest(){
        createData();
        String contactId = [Select Id from Contact where Email= : 'testNew@test.com'].Id;
        test.startTest();
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
        req.requestURI = 'https://ap1.salesforce.com/MyRestContextExample/'+contactId;
        req.httpMethod = 'GET';
        system.debug('---requestURI'+req.requestURI);  // here i am getting correct URL 
        List<Account> atndInsert = MyRestContextExample.doGet();
        test.stopTest();
    }

Above method is returning null pointer exception at line 
String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
On debugging I found RestRequest req has value null so req.requestURI is throwing exception. But I am providing request uri in my test class.(req.requestURI= 'https://ap1.salesforce.com/MyRestContextExample/'+contactId;). Then how come it is null. 
Please help.
I need to write a trigger which reassigns a lead to a community user and so need to be able to create a community user in a unit test.

Is this possible?

Does anyone have an example of doing this?

I am having an issue with this SOQL query doesn't recognise the relation ship between a campaign and a contact

heres the code

public String crmid { get; set; }

public List<SelectOption> getValues(){
cmoptions.clear();
cmoptions.add(new selectOption('--None--','--None--'));

for(Campaign camp:[select id,name, (select id,status,contactId,Status_Changed__c,Call_Result__c, Contact.Account.PersonMobilePhone, Contact.Account.PersonEmail, Contact.Account.Name, Contact.Account.G1_Client_Relationship_Manager__c,Contact.Account.Mobile_Clean__c, Contact.Account.PersonHomePhone,Contact.Account.PersonMailingStreet, Contact.Account.PersonMailingCity,Contact.Account.PersonMailingState, Campaign.name from CampaignMembers) from Campaign WHERE Campaign_Call_List__c = true AND Contact.Account.G1_Client_Relationship_Manager__c = :crmid ORDER BY Name ASC]){

cmoptions.add(new selectOption(camp.id,camp.name));
maplstcm.put(camp.id,camp.campaignmembers);
}
return cmoptions;
}
Hi,
I want to know if it is possible to call C++ or C# DLL functions in Apex? I know that it could be done via SOAP protocol which needs a web service implementation. If this is the only way to integrate DLLs, does Salesforce.com host the web service or not?

Thanks
  • September 02, 2014
  • Like
  • 0
Hi Everybody,
          I am new to Rest Api.. I dont know how to use rest api ???
Can anyone tell me how to use rest api  with rest explorer...



Thanks in advance
karthick
Hi All,

Is it possible to access Rest ApI's from external system using cusomer portal logins(portal licence, profile etc) instead of regular salesforce user (sys admin).

Thanks in Advance!!
I'm very new to working with webservices in Salesforce, though I'm experienced with using Apex for triggers and Visualforce. We are trying to create a webservice that receives XML data as a string from an external application - and that's all it does. I keep trying to research how to set this up, but all the documentation I've found seems to be based on a user actually logging into an external application with OAuth. No users are going to be logging into an external application, and we really don't want to give the external application a username and password to use. What other options can be used to authenticate?

We will be using the REST API. This is the webservice class that I wrote:

@RestResource(urlMapping='/servicechannel/*')
global class ServiceChannelWS {
    @HttpPost
    global static void doPost(String xml) {
        //insert logic to parse the XML and do things with it
    }
}

If anyone could please just point me in the right direction, I would greatly appreciate it!
Greetings!

I'm working on integrating a Wordpress site with Salesforce (not just leads and cases). And I'm finding (https://www.salesforce.com/us/developer/docs/api_rest/) that it seems like the only way to use the api is with either an oauth token or salesforce session id. The problem with this is that it requires the integration to work from user sessions, but I'd like it to work for non-logged in users and also forego the token redirect process.

The web-to-lead applet offers something like this, but only for leads and cases.

If I have to use OAuth, is it bad practice to have the user provide the credentials then store the token in the database for all future use? The same token would then be used for every purpose. Would the token have a lifespan by default?

Thanks for any and all input! :)
Followed through the steps and I am receiving the error


There was an unhandled exception. Please reference ID: AKWLPXWN. Error: Faraday::ClientError. Message: INVALID_FIELD: SELECT Id FROM Contact where name='Edna Frank' ^ ERROR at Row:1:Column:30 field 'name' can not be filtered in a query call

Any suggestions?

I have a page which is being rendered as a PDF that cause the values of certain outputExt field to not be displayed. These were initially ones where I had bound to a related object. I firstly tried to change them to display the name of the related object by retrieving this information in a SOQL query however this seemed not to work so I changed it to use just simple strings.

 

 

An example field on my VF PDF page is 

 

<apex:outputText label="Cause of Injury" escape="false" value="{!cause}" />
hello -> {!cause} - here

I have added the text below to try and locate the information on the page to see if the value was being returned. If I remove the renderAs ="pdf" part of the page then all the information displays as required. It is only when I am rendering as a pdf that this fails to work. 

 

Any ideas?

 

Thanks

 

Paul

Hi

 

I have come up against a requirement where my customer wants a user to be able to view all the Names of Accounts (so a global read-only) but only be able to see another Account field for those Account in their region (or  Role group). I have been banging my head against trying to set this up but can't see it is possible. Wondering if anyone had any suggestions?

 

An example would be

Account Name (global read-only)

Account Address (global read-only)

Account Value (regional read-only)

Account Number (regional read-only)

 

Thanks in advance

 

Paul

Hey Everyone

 

I was wondering if anybody had any idea as to why the following query is working in apigee and not in my iOS app.

 

iOS query:

 

https://na7.salesforce.com/services/data/v20.0/query/?q=Select Id, Name, Phone, Type, Website, AccountNumber, Site, AnnualRevenue, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry, ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode, ShippingCountry, Description, NumberOfEmployees, Fax, Industry, Rating, Sic, TickerSymbol, Active__c, CustomerPriority__c, NumberofLocations__c, SLA__c, SLAExpirationDate__c, SLASerialNumber__c, UpsellOpportunity__c From Account order by Name -H "Authorization: OAuth myloongtoekngoeshere"

 apigee (which provides its own token)

 

https://na7.salesforce.com/services/data/v20.0/query?q=Select Id, Name, Phone, Type, Website, AccountNumber, Site, AnnualRevenue, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry, ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode, ShippingCountry, Description, NumberOfEmployees, Fax, Industry, Rating, Sic, TickerSymbol, Active__c, CustomerPriority__c, NumberofLocations__c, SLA__c, SLAExpirationDate__c, SLASerialNumber__c, UpsellOpportunity__c From Account order by Name

 Thanks for any help guys and girls.

 

Paul

 

 

Hey

 

I am running thr following query through the REST API and it is returning (null) for the Account.Name field. The same query in SOQL Explorer shows evrry contact has an account linked to it which has a name.

 

 

"Select Name, LastName, Title, AccountId, Account.Name, Department, MailingStreet, MailingCity, MailingState, MailingPostalCode, MailingCountry, Phone, Fax, MobilePhone, Email from Contact Order By Account.Name, LastName"

 

 

Any ideas?

FailuresHey everyone

 

I am a newbie iOS/Objective C developer and have just downloaded the iPhone SDK and XCode and successfully got a "Hello World" app running on the iPad/iPhone simulator.

 

With this success I then downloaded the Force.com iOS toolkit and tried to run the SVNTest project but get "BASE SDK missing" errors and the drop down list in the top left is empty along with a series of "red frameworks" see the following pic:

 

 

If it doesn't display it is at http://www.twitpic.com/4c29xq

 

Thanks for your help in getting it working.

 

Paul

Hey All

 

I have a system where I am loading a csv and retrieveing a list of strings from it. The first half of the list is the names of the fields I wish to populate, the second half is ther values to push in.

 

I am trying to find a way of setting the value string to be a generic type which will then populate the field in question - basically performing automatic conversion.

 

For example: 

for(integer i=0; i<(split.size()/2); i++)
{
  Object o = split[i+(split.size()/2)];
  m_task.put(split[i].trim() + '__c',o);  
}

 Whwre split is my list and m_task is my sObject. I could write a long list of if statements to cast dependent upon the type from a describe results, but just feel that this has to be possible. I currently get an error from a xxxx type field of "Illegal assignment from String to xxxx".

 

Thanks for any help guys, I think it would be far more elegant a solution if it were possible this way!

 

Paul

 

Hey

 

I have a VF page with a VF component on it. The component has an attribute which is of the page controllers type. I am attempting to pass the page controller into the component controller and then have the component controller populate a value on the page controller. 

 

The Component is to allow the adding of an attachment to an object and the object is referenced on the page's controller:

 

Component Markup:

 

<apex:component controller="UploadComponentController" >
	<apex:attribute name="pageController" description="This is the controller of the page which the component is on." type="UploadPageController" required="true" assignTo="{!pageController}"/>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
<script type="text/javascript" >
	$(document).ready(function() {
		
	if($('div.trigger').length > 0) {
		$('div.trigger').click(function() {
			if ($(this).hasClass('open')) {
				$(this).removeClass('open');
				$(this).addClass('close');
				$(this).next().slideDown(200);
				return false;
			} else {
				$(this).removeClass('close');
				$(this).addClass('open');
				$(this).next().slideUp(200);
				return false;
			}			
		});
	}
	
});
</script>
    <apex:form enctype="multipart/form-data">
      <div class="trigger open"><a href="#">Upload</a></div> 
			<div class="cnt"> 
				    <apex:pageBlock >
				 
				      <apex:pageBlockSection showHeader="false" columns="2" id="block1">
				 
				        <apex:pageBlockSectionItem >
				          <apex:outputLabel value="File Name" for="fileName"/>
				          <apex:inputText value="{!attachment.name}" id="fileName"/>
				        </apex:pageBlockSectionItem>
				 
				        <apex:pageBlockSectionItem >
				          <apex:outputLabel value="File" for="file"/>
				          <apex:inputFile value="{!attachment.body}" filename="{!attachment.name}" id="file"/>
				        </apex:pageBlockSectionItem>
				 
				        <apex:pageBlockSectionItem >
				          <apex:outputLabel value="Description" for="description"/>
				          <apex:inputTextarea value="{!attachment.description}" id="description"/>
				        </apex:pageBlockSectionItem>
				 
				      </apex:pageBlockSection>
				 
				    </apex:pageBlock>
	</div> 
    </apex:form>
 
    <style type="text/css">
	    .trigger,.trigger a {
			display: block;
			width: 60px;
			height: 20px;
			text-indent: -999999em;
			overflow: hidden;
	    }
  		.trigger {
			background: url({!$Resource.Button}) no-repeat 0px 0px;
		}
		.close {
			background: url({!$Resource.Button}) no-repeat 0px -20px;
		}
		.cnt {
			display: none;
			padding: 10px;
			margin: 10px;
			background: #f9f9f9;
		}
    </style>
</apex:component>

 

 

Component Controller:

 

public with sharing class UploadComponentController 
{
	public UploadPageController pageController {get; set;}
	
	
	public Attachment getAttachment()
	{
		return pageController.attach;
	}
	
	public void setAttachment(Attachment a)
	{
		pageController.attach = a;
	}
	
}

 

 

Page Markup:

 

 

<apex:page controller="UploadPageController">
	<apex:pageBlock title="New TestObject">
	<apex:pageMessages />
 		<apex:pageBlockSection >
 			<apex:form >
				<apex:outputLabel value="Object Name" for="objName"/>
				<apex:inputText value="{!name}" id="objName" />
			</apex:form>
		</apex:pageBlockSection>
		<apex:pageBlockSection >
			<c:uploadComponent pageController="{!controller}" />
		</apex:pageBlockSection>
		<apex:pageBlockSection >
			<apex:form >
				<apex:commandButton action="{!save}" value="Save"/>
			</apex:form>
		</apex:pageBlockSection>
	</apex:pageBlock>  
</apex:page>

 

 

Page Controller:

 

public with sharing class UploadPageController
{ 
	public Attachment attach {get; set;}
	
  	private TestObject__c m_testObj = new TestObject__c();
  		
  	public UploadPageController()
  	{
  		attach = new Attachment();
  	}
  		
	public string getName()
	{
		return m_testObj.Name; 
	}
	
	public void setName(string oName)
	{
		m_testObj.Name = oName; 
	} 
	
	public UploadPageController getController()
	{
		return this;
	}
	
	public void setController(UploadPageController con)
	{
		
	}
	
	public PageReference save()
	{
		insert m_testObj;
 		
    	attach.OwnerId = UserInfo.getUserId();
    	attach.ParentId = m_testObj.Id; // the record the file is attached to
    	attach.IsPrivate = false;
 		
    	try 
    	{
      		insert attach;
    	} 
    	catch (DMLException e) 
    	{
      		ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading attachment'));
      		return null;
    	}
    	finally 
    	{
      		attach = new Attachment(); 
    	}
 
    	ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Attachment uploaded successfully'));
    	
		PageReference page = new ApexPages.StandardController(m_testObj).view();
		page.setRedirect(true);
		return page;
	}
}

 

 

I get an error of "Cannot insert attachment, fields missing : File Name, Body" or somethng to that affect. Any ideas? I can't see why this isn't working!

 

Thanks 

 

Paul

Followed through the steps and I am receiving the error


There was an unhandled exception. Please reference ID: AKWLPXWN. Error: Faraday::ClientError. Message: INVALID_FIELD: SELECT Id FROM Contact where name='Edna Frank' ^ ERROR at Row:1:Column:30 field 'name' can not be filtered in a query call

Any suggestions?
Hi all,

We have a customer community based on Visualforce (custom made case page).
I was trying to embbed a few drag & drop attachment apps in the page to improve the user experience, but each one had some sort of incompitability to Visualforce / external page. 

Anyone knows a drag & drop app that would fit for this scenario? Or independent way to develop it for that matter?

Many thanks,
Eran
Hi,

How can heroku postgres DB be checked ? How see records and tables in Heroku Postgres ?

Thanks,
Abhi
Hello Everyone,
I have a schedule job which creates Child records for every month for more than 40000 parent records. I want to send a confirmation email to child record email address.
How can i send email to all 40000 records?
Please Suggest.
Thanks

Hi Can anyone help me to resolve this. I am getting this error in VF controller. I am creating a custom picklist in VF controller wrapper class and  getting this
Error in debug while second run : System.TypeException: Invalid conversion from runtime type String to List<System.SelectOption>

sample code :
public class controller{
public class Wrapper
    {
      public boolean isCheck{get;set}
      public List<SelectOption> Picklist{get;set;}
      public String name{get;set;}
        }    

public List<wrapper> getwrapperlist()
    {
   
    return wrapperlist;
    } 

   public void setwrapperlist()
   {
    this.wrapperlist=wrapperlist;
   }

  public void method1()
{
 Wrapper w=new Wrapper();
w.addPicker=new List<selectoption>();
for(list<object> s:olist){
w.addPicker.add(new SelectOption (s.fname,s.fname));
}
wrapperlist.add(w);

}
}

 

i want to create a link , when this link is clicked a http callout is made to a server url and a Vf page is generated in response.
it happens in a app SPimage. i want to achieve same functionallity need help.
Hi
I am trying to create a custom clone button on Order Product.

The code I am using is as follows
/{!OrderItem.Id}/e?clone=1

All appears to function correctly until such time as I try to save this new record. I then get the following error:

User-added image
Of which the URL is: https://cs81.salesforce.com/802/e

Is there any way I could reference the OrderId in the RetURL? I think that may fix the problem.

Thanks

Jane
 
Dear Folks,

Can some one please get me the logic.

Requirement: The below Integration code is working fine for Insert but unable to get it work for Update.. Your help is highly appreciated and thanks in advance.

Integration Code:
ServicesPostcodeanywhereCoUk.ArrayForWayPoints wpoint = new ServicesPostcodeanywhereCoUk.ArrayForWayPoints();           
            ServicesPostcodeanywhereCoUk.PostcodeAnywhere_Soap pcode = new ServicesPostcodeanywhereCoUk.PostcodeAnywhere_Soap();
            ServicesPostcodeanywhereCoUk.DistancesAndDirections_Interactive_Distance_v1_00_ArrayOfResults result = pcode.DistancesAndDirections_Interactive_Distance_v1_00('XXXX-FKXX-RX91-NT72',weblead.Pick_Up_Post_Code__c,weblead.Destination_Postal_Code__c,wpoint,'Fastest');       

Here is the code might need to be updated:           
Integer pickupdropdis = result.DistancesAndDirections_Interactive_Distance_v1_00_Results[0].TotalDistance/1600;

Regards,
Kumar
Hi All,

I'm developing a App in salesforce using apex and visualforce, the application has algorithm but it is in python 
Now, how can i integrate python code in apex.
My idea is to have to make a webservice call from apex to my python code whether this method is correct or is there is any best method ?
If suppose i have to use a webservice call then where i have to host my code in my own server or salesforce provide facility for that?

Thanks,
Venkat
Hi Everyone, in the module Wave Analytics Trail |Wave Analytics Basics | Creating Your First Wave Analytics App, the user is directed to go to http://startsurfingthewave.herokuapp.com/trailhead_dataflow, and download the file Analytics Trailhead Dataflow.json into a local directory.  Continuing to follow the directions, I go into the Wave Analytics app, navigate to the Dataflow View, click on Settings | Upload, select the Analytics Trailhead Dataflow.json file, and click on the "Upload" button.  Once I do that, I receive the following error: TypeError: Object doesn't support this property or method.  When I click the "Continue" button, the error "Upload failed because the file is not a valid .json file".  If anyone knows how to fix this, I would be grateful.  I don't know why this isn't working since the dataflow file is provided by Salesforce via the link.
Hi All,

          Two of my test classes are passing without any issues but the code coverage on the respective classes is 0% . Can anyone let me know what the possible issue might have been?
  • October 21, 2015
  • Like
  • 0
Our SF interface says we have 9.9GB of Apex Logs in the system and it's taking us way over our data allowance. We have no way of accessing them or deleting them from the interface or Apex. I've come across various posts e.g. soql 'select ID from apexlogs' and delete etc but none of them work. Does anyone know how to access / delete these logs? As i'm new to SF i'm either missing something obvious or they have.
Hi,

I have extended functionality Rootstock by adding a trigger to the object to save the data in another object to be used by other custom applications. The trigger functionality is invoked during an update and works fine in sandbox; however I've been unable to create tests for it to deploy. This is because instantiating the object to create testdata results in an error. Is there a workaround to writing tests to objects that cannot be directly instantiated?
I am new to Force.com and I am still having a hard time to wrap my head around so many things.

In every "normal" production system, logs are constantly collected and kept for a reasonable amount of time according to a retention policy. Usually days or weeks. Thus, system administrators can monitor logs and detect potential problems before users even notice them.

However, with Salesforce, thinks seem to be very different:

Apparently logs will only be collected in a "per-session" basis and for a specific user. I can't find any practical way to generate logs for all the users of my "org" and retain them for any period longer than a few minutes.

My Salesforce "org" contains a lot of Apex code that interacts with external services and performs DML operations against "the database". Hence, there are many things that can go wrong during a normal business day for our users.

Alas, it seems that Force.com expects us to only collect logs to "debug" whatever goes wrong. Thus, we have to wait for a user to complain about something, enable the logs for his or her session, and ask him or she to reproduce whatever went wrong.

So, I wonder if this is really the best we can do with Force.com in terms of logging.

If so, it couldn't be more disappointing. I just can't believe that such a successful platform can have such a narrow-minded approach to logging.

Thank you.