• Geetha Reddy
  • NEWBIE
  • 50 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 29
    Questions
  • 37
    Replies

hi this is my controller and i am marking red where my test case is not covered

 

 

public class Netsmart_Portal_Homepage{

public list<case> opencaserecords{get;set;}
public list<case> closedcaserecords{get;set;}
public list<case> caserecords{get;set;}

public user u{get;set;}
public contact c{get;set;}
public Netsmart_Portal_Homepage(){
u = [Select id,name ,LastName,FirstName,ContactId,Profile.Name from user where id=:UserInfo.getUserId()];
c = [Select LastName,id from Contact where id =:u.Contactid];
caserecords=[select id,CaseNumber,Subject,Status, Priority ,CreatedBy.FirstName,CreatedDate,CreatedBy.id,ClosedDate from case where ContactId=:c.id ];

closedcaserecords=[select id,CaseNumber,Subject,Status, Priority ,CreatedDate,CreatedBy.FirstName,CreatedBy.id,ClosedDate from case where ContactId=:c.id and isclosed=true];

opencaserecords=[select id,Subject,CaseNumber,Status, Priority ,CreatedDate,CreatedBy.FirstName,CreatedBy.id,ClosedDate from case where ContactId=:c.id and isclosed=false];


}
  
}

the error i am getting is

 

System.QueryException: List has no rows for assignment to SObject for contact query 

 

this is my test case

 

@istest
private class Netsmart_Portal_Homepage_Tc
{
static testMethod void validatetest1()
{
Account a = new account();
a.name = 'Test';
a.Type = 'New Customer';
a.BillingState = 'AL';
a.recordtypeid='0127000000014u3';
insert a;


user u=[select id,contactid from user where isactive=true limit 1];
System.RunAs(u){

contact c1=[select id from contact where id=:u.contactid];



case c11=new case();
c11.Subject='aaa';
c11.Status='open';
c11.ContactId=c1.id;
c11.AccountId =a.id;
insert c11;

Netsmart_Portal_Homepage n1 =new Netsmart_Portal_Homepage();
}
}
}




public class Netsmart_Portal_Homepage{

public list<case> opencaserecords{get;set;}
public list<case> closedcaserecords{get;set;}
public list<case> caserecords{get;set;}

public user u{get;set;}
public contact c{get;set;}
public Netsmart_Portal_Homepage(){
u = [Select id,name ,LastName,FirstName,ContactId,Profile.Name from user where id=:UserInfo.getUserId()];
c = [Select LastName,id from Contact where id =:u.Contactid];
caserecords=[select id,CaseNumber,Subject,Status, Priority ,CreatedBy.FirstName,CreatedDate,CreatedBy.id,ClosedDate from case where ContactId=:c.id ];

closedcaserecords=[select id,CaseNumber,Subject,Status, Priority ,CreatedDate,CreatedBy.FirstName,CreatedBy.id,ClosedDate from case where ContactId=:c.id and isclosed=true];

opencaserecords=[select id,Subject,CaseNumber,Status, Priority ,CreatedDate,CreatedBy.FirstName,CreatedBy.id,ClosedDate from case where ContactId=:c.id and isclosed=false];


}
  
}

 Unable to cover this line: c = [Select LastName,id from Contact where id =:u.Contactid];

 

list has no rows im getting error

  

this is my testcase:

 

@istest
private class Netsmart_Portal_Homepage_Tc
{
static testMethod void validatetest1()
{
Account a = new account();
a.name = 'Test';
a.Type = 'New Customer';
a.BillingState = 'AL';
a.recordtypeid='0127000000014u3';
insert a;


user u=[select id,contactid from user where isactive=true limit 1];
System.RunAs(u){

contact c1=[select id from contact where id=:u.contactid];



case c11=new case();
c11.Subject='aaa';
c11.Status='open';
c11.ContactId=c1.id;
c11.AccountId =a.id;
insert c11;

Netsmart_Portal_Homepage n1 =new Netsmart_Portal_Homepage();
}
}
}

 

  • April 19, 2012
  • Like
  • 0

I seem to be having an issue with the Encrypt or decrypt portion of the password process.

 

Even i added security token to it but same problem.

 

 

0 [main] INFO com.salesforce.dataloader.process.ProcessConfig  - Loading process
 configuration from config file: C:\Datalodercli\process-conf.xml
47 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader  -
Loading XML bean definitions from file [C:\Datalodercli\process-conf.xml]
47 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanDefinitionReader  -
 Using JAXP implementation [com.sun.org.apache.xerces.internal.jaxp.DocumentBuil
derFactoryImpl@1256ea2]
62 [main] DEBUG org.springframework.beans.factory.xml.ResourceEntityResolver  -
Trying to resolve XML entity with public ID [-//SPRING//DTD BEAN//EN] and system
62 [main] DEBUG org.springframework.beans.factory.xml.ResourceEntityResolver  -
Trying to locate [spring-beans.dtd] in Spring jar
78 [main] DEBUG org.springframework.beans.factory.xml.ResourceEntityResolver  -
th
94 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionPa
rser  - Loading bean definitions
94 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionPa
rser  - Default lazy init 'false'
94 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionPa
rser  - Default autowire 'no'
94 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionPa
rser  - Default dependency check 'none'
94 [main] INFO org.springframework.core.CollectionFactory  - JDK 1.4+ collection
s available
94 [main] INFO org.springframework.core.CollectionFactory  - Commons Collections
 3.x available
109 [main] DEBUG org.springframework.core.CollectionFactory  - Creating [java.ut
il.LinkedHashMap]
109 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionP
arser  - Found 1 <bean> elements in file [C:\Datalodercli\process-conf.xml]
109 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Creatin
g instance of bean 'accountMasterProcess' with merged definition [Root bean: cla
ss [com.salesforce.dataloader.process.ProcessRunner]; abstract=false; singleton=
false; lazyInit=false; autowire=0; dependencyCheck=0; initMethodName=null; destr
oyMethodName=null; factoryMethodName=null; factoryBeanName=null; defined in file
 [C:\Datalodercli\process-conf.xml]]
109 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Invokin
g BeanPostProcessors before instantiation of bean 'accountMasterProcess'
125 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Getting
 BeanInfo for class [com.salesforce.dataloader.process.ProcessRunner]
125 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Caching
 PropertyDescriptors for class [com.salesforce.dataloader.process.ProcessRunner]
 
140 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found p
roperty 'class' of type [java.lang.Class]
140 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found p
roperty 'configOverrideMap' of type [java.util.Map]
140 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found p
roperty 'controller' of type [com.salesforce.dataloader.controller.Controller]
140 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found p
roperty 'name' of type [java.lang.String]
140 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Class [
com.salesforce.dataloader.process.ProcessRunner] is cache-safe
156 [main] DEBUG org.springframework.core.CollectionFactory  - Creating [java.ut
il.LinkedHashMap]
156 [main] DEBUG org.springframework.beans.BeanWrapperImpl  - About to invoke wr
ite method [public synchronized void com.salesforce.dataloader.process.ProcessRu
nner.setName(java.lang.String)] on object of class [com.salesforce.dataloader.pr
ocess.ProcessRunner]
172 [main] DEBUG org.springframework.beans.BeanWrapperImpl  - Invoked write meth
od [public synchronized void com.salesforce.dataloader.process.ProcessRunner.set
Name(java.lang.String)] with value of type [java.lang.String]
172 [main] DEBUG org.springframework.beans.BeanWrapperImpl  - About to invoke wr
ite method [public synchronized void com.salesforce.dataloader.process.ProcessRu
nner.setConfigOverrideMap(java.util.Map)] on object of class [com.salesforce.dat
aloader.process.ProcessRunner]
172 [main] DEBUG org.springframework.beans.BeanWrapperImpl  - Invoked write meth
od [public synchronized void com.salesforce.dataloader.process.ProcessRunner.set
ConfigOverrideMap(java.util.Map)] with value of type [java.util.Map]
187 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Invokin
g BeanPostProcessors before initialization of bean 'accountMasterProcess'
187 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Invokin
g afterPropertiesSet() on bean with name 'accountMasterProcess'
187 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Invokin
g BeanPostProcessors after initialization of bean 'accountMasterProcess'
219 [accountMasterProcess] INFO com.salesforce.dataloader.controller.Controller
 - The controller config has been initialized
219 [accountMasterProcess] INFO com.salesforce.dataloader.process.ProcessRunner
 - Initializing process engine
219 [accountMasterProcess] INFO com.salesforce.dataloader.process.ProcessRunner
 - Loading parameters
922 [accountMasterProcess] ERROR com.salesforce.dataloader.config.Config  - Erro
r loading parameter: sfdc.password of type: java.lang.String
java.lang.NumberFormatException: For input string: "as"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
        at java.lang.Integer.parseInt(Integer.java:456)
        at java.lang.Integer.valueOf(Integer.java:526)
        at java.lang.Integer.decode(Integer.java:919)
        at com.salesforce.dataloader.security.EncryptionUtil.textToBytes(Encrypt
ionUtil.java:58)
        at com.salesforce.dataloader.security.EncryptionUtil.decryptString(Encry
ptionUtil.java:194)
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:6
68)
        at com.salesforce.dataloader.config.Config.postLoad(Config.java:620)
        at com.salesforce.dataloader.config.Config.loadParameterOverrides(Config
.java:646)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:95)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:75)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:227)
969 [main] FATAL com.salesforce.dataloader.process.ProcessRunner  - Unable to ru
n process accountMasterProcess
java.lang.RuntimeException: com.salesforce.dataloader.exception.ParameterLoadExc
eption: Error loading parameter: sfdc.password of type: java.lang.String
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:137)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:75)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:227)
Caused by: com.salesforce.dataloader.exception.ParameterLoadException: Error loa
ding parameter: sfdc.password of type: java.lang.String
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:6
83)
        at com.salesforce.dataloader.config.Config.postLoad(Config.java:620)
        at com.salesforce.dataloader.config.Config.loadParameterOverrides(Config
.java:646)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:95)
        ... 2 more
Caused by: java.lang.NumberFormatException: For input string: "as"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
        at java.lang.Integer.parseInt(Integer.java:456)
        at java.lang.Integer.valueOf(Integer.java:526)
        at java.lang.Integer.decode(Integer.java:919)
        at com.salesforce.dataloader.security.EncryptionUtil.textToBytes(Encrypt
ionUtil.java:58)
        at com.salesforce.dataloader.security.EncryptionUtil.decryptString(Encry
ptionUtil.java:194)
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:6
68)
        ... 5 more
 
 
My process-conf.xml Files:
 

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="accountMasterProcess"
class="com.salesforce.dataloader.process.ProcessRunner"
singleton="false">
<description>accountInsert job gets the account record from the CSV file
and inserts it into Salesforce.</description>
<property name="name" value="accountMasterProcess"/>
<property name="configOverrideMap">
<map>
<entry key="sfdc.debugMessages" value="true"/>
<entry key="sfdc.debugMessagesFile"
value="C:\Datalodercli\accountInsertSoapTrace.log"/>
<entry key="sfdc.endpoint" value="https://login.salesforce.com"/>
<entry key="sfdc.username" value="mvrsreddy@gmail.com"/>
<entry key="sfdc.password" value="9016019f5e18b6c75f993da5924fd33bB0aszGmt639q7ut2j7UKT3ux"/>
<entry key="process.encryptionKeyFile"
value="C:\Datalodercli\key.txt"/>
<entry key="sfdc.timeoutSecs" value="600"/>
<entry key="sfdc.loadBatchSize" value="200"/>
<entry key="sfdc.entity" value="Account"/>
<entry key="process.operation" value="insert"/>
<entry key="process.mappingFile"
value="C:\Datalodercli\account.sdl"/>
<entry key="dataAccess.name"
value="C:\Datalodercli\accountInsert.csv"/>
<entry key="process.outputSuccess"
value="C:\Datalodercli\accountInsert_success.csv"/>
<entry key="process.outputError"
value="C:\Datalodercli\accountInsert_error.csv"/>
<entry key="dataAccess.type" value="csvRead"/>
<entry key="process.initialLastRunDate"
value="2005-12-01T00:00:00.000-0800"/>
</map>
</property>
</bean>
</beans>

 



Thanks in advance.

Hi to all,

 

I am new to Mobile apps.

Can any one post the tutorials , pdf etc regarding Mobile apps.

 

 

Thanks in Advance... 

hi,

 

can any one tell me that how can JSON data Converts in to our salesforce record 

Hello Everyone,

I am new to salesforce Integration , I want to integrate Twitter to salesforce(Saving Tweets to Object).

so please suggest me the learing resource for that.

Thanks

Hi

 

How can we get tweets of perticular user to salesforce object Like Twitter Account.

 

 

Thanks in advance.

Hi

 

How can we get tweets of perticular user to salesforce chatter.

 

 

Thanks in advance.

Hi,

 

I want to integrate Twitter application with my salesforce application. Can Any one help me how to retrive status from Twitter Using HTTP Request(OAuth).

 

Is there any sample code available then please share.

 

Thanks in advance.

Hi

 

How can we get tweets of perticular user to salesforce chatter.

 

 

Thanks in advance.

Hi,

How can we use this code in visualforce page

<script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 30,
interval: 30000,
width: 'auto',
height: 300,
theme: {
shell: {
background: '#333333',
color: '#ffffff'
},
tweets: {
background: '#000000',
color: '#ffffff',
links: '#4aed05'
}
},
features: {
scrollbar: true,
loop: false,
live: false,
behavior: 'all'
}
}).render().setUser('Venkatareddymv').start();
</script>

Hi,

 

I am new to integration in Salesforce.

I am trying to integrate Salesforce Chatter with Twitter, 

by using code :

http://wiki.developerforce.com/page/Getting_Started_with_TwitterForce

 

 

But Getting Error As:

 

<?xml version="1.0" encoding="UTF-8"?> <errors> <error code="53">Basic authentication is not supported</error> </errors> Username: xxxxxxxxxxx@txxx.com Password:xxxxxxxxxxx.


Can any one Help on this issue.

Thanks In advance

 

HI,

 

I am new to Integration part in Salesforce.

I want to integrate Salesforce Chatter for Twitter .

 

My fuctionality just like:

 

http://www.youtube.com/watch?v=FqeGxAuFqSM&feature=player_embedded

 

and 

 

http://techblog.appirio.com/2010/03/integrate-chatter-twitter-on-google-app.html

 

Thanks in advance!!

Hi all,

 

public void addRecord(){
String OBJ_NAME = objectName;
sObject dynObject= Schema.getGlobalDescribe().get(OBJ_NAME).newSObject() ;
dynObject.put('Sales_Order__c' , parentFieldId) ;
for(sObject obje : ssc.getRecords()){

upsert obje;

}

insert dynObject;

ssc = null;
getRecords();
}

 

I am getting error as :

 

Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Sales Order: id value of incorrect type: a09Q0000006SpTmIAK: [Sales_Order__c] 

 

Can any help on this issue..

HI

Can any one know Macros in Excel sheet.....

 

My Requirement :

 

For example we have n records , in it I want to delete n-1 records and I want to display nth Record...

 

 

Can any one help on this issue ....

Hi,
I want to add error for save functionallity
so can any one help on this..  
public void saveRecord(){
    for(sObject obje : ssc.getRecords())
    {
    if(obje.get('WSR_Product__c')!=NULL)
    {
     try{
     upsert obje;
    system.debug('!!!!!!!!!!!!!!!!!!!' +obje);
   }
   
   catch(Exception e)
    {
     ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Object API name is invalid')) ;  
    }
      }
       }
        //Make ssc variable null and execute get method
        ssc = null;
        getRecords();
        
    }
    

HI

 

I am new to PHP and I dont know were to upload or keep the PHP code in Instance  and how to use the code in visualforce page.

 

Can anyone help on this issue.

 

Thanks in advance.

 

 

Hi How can we find Api Names for Primary Campaign Source Check box while entering the Campaign in a perticular opportunity.

 

Can any one help on this ....

HI 

 

I am trying to restrict the web user from submitting the same form Repeatedly in an Hour .

 

Can any one help on this issue...


 

hi

 

I am generating a pdf using visualforce , while I am assinging td width in px so that it can be fixed width .

Now the data width id greater than width of td then it is distrubing alignment of other td and as well as table.

So can any one tell me that how can we fix the td width & word wrap to it.

 

Thank q in advance..

 

Hi 

 

I am trying to work on Generic Related List .

Here I am unable to add row . can any one help on this issue..

 

This is my code :


public with sharing class RelatedListController {

String objectLabel;
String objectLabelPlural;
Boolean showNewButton;
public ApexPages.StandardSetController ssc {get; set;}
public List<String> fieldNames {get; set;}
public Map<String,String> fieldAlignMap {get; set;}
public Map<String,String> nameLabelMap {get; set;}
transient Schema.DescribeSObjectResult objectDescribe;
public Id deleteRecordId {get; set;}
public String sortByField {get; set;}
public Map<String,String> fieldSortDirectionMap {get; set;}


//----Variables set from attributes defined in the component----
public String objectName {get; set;}
public String fieldsCSV {get; set;}
public List<String> fieldsList {get; set;}
public String parentFieldName {get; set;}
public Id parentFieldId {get; set;}
public String filter {get; set;}
public String orderByFieldName {get; set;}
public String sortDirection {get; set;}
public Integer pageSize {get; set;}


public List<sObject> getRecords(){
if(ssc == null){
//Do validation to ensure required attributes are set and attributes have correct values
//fieldList or fieldsCSV must be defined
Boolean validationPass = true;

if(fieldsList == null && fieldsCSV == null){
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.WARNING,'fieldList or fieldsCSV attribute must be defined.'));
validationPass = false;
}

//Ensure sortDirection attribute has value of 'asc' or 'desc'
if(sortDirection != null && sortDirection != 'asc' && sortDirection != 'desc'){
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.WARNING,'sortDirection attribute must have value of "asc" or "desc"'));
validationPass = false;
}

//Ensure parentFieldId is not null
if(parentFieldId == null){
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.WARNING,'parentFieldId attribute can not be null'));
validationPass = false;
}

//Proceed with returning the related list if validation passed
if(validationPass == false){
return null;
}else{
//Build the query string dynamically
String queryString = 'SELECT ';

/*If field CSV was defined use this and also add fields to the fieldNames
List so they can be used with Visualforce dynamic binding to define coloumns*/
if(fieldsCSV != null){
queryString += fieldsCSV;
fieldNames = fieldsCSV.split(',');
}else{
//Add fields to fieldNames list so it can be used with VF dynamic binding to define coloumns
fieldNames = fieldsList.clone();

//Loop through list of field names in fieldList and add to query
for(String fld : fieldsList){
queryString += fld + ',';
}

//Remove the very last comma that was added to the end of the field selection part of the query string
queryString = queryString.substring(0,queryString.length() - 1);
}

//add from object and parent criteria
queryString += ' FROM ' + objectName + ' WHERE ' + parentFieldName + ' = \'' + parentFieldId + '\'';

//Add any addtional filter criteria to query string if it was defined in component
if(filter != null){
queryString += 'AND ' + filter;
}

//Add order by field to query if defined in component
//If sortByField != null then user has clicked a header and sort by this field
if(sortByField != null){
queryString += 'order by ' + sortByField;
}else if(orderByFieldName != null){
queryString += 'order by ' + orderByFieldName;
}

//If sortByField != null then user has clicked a header, sort based on values stored in map
if(sortByField != null){
/*Use a map to store the sort direction for each field, on first click of header sort asc
and then alternate between desc*/
if(fieldSortDirectionMap == null){
fieldSortDirectionMap = new Map<String,String>();
}

String direction = '';

//check to see if field has direction defined, if not or it is asc, order by asc
if(fieldSortDirectionMap.get(sortByField) == null || fieldSortDirectionMap.get(sortByField) == 'desc' ){
direction = 'asc';
fieldSortDirectionMap.put(sortByField,'asc');
}else{
direction = 'desc';
fieldSortDirectionMap.put(sortByField,'desc');
}

queryString += ' ' + direction;
}else if(sortDirection != null){
//Add sort direction to query if defined in component
queryString += ' ' + sortDirection;
}

//Add limit clause to end of the query
queryString += ' limit ' + (Limits.getLimitQueryRows() - Limits.getQueryRows());

//Query records and setup standard set controller for pagination
ssc = new ApexPages.StandardSetController(Database.query(queryString));

//Check to see if more than 10,000 records where return, if so display warning as standard set controller can only process 10,000 recores
if(ssc.getCompleteResult() == false){
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.WARNING,'There were more related records than could be processed. This is a partially complete list.'));
}

//Set pagination size based on value set in component
if(pageSize != null){
ssc.setPageSize(pageSize);
}

/*For the fields that will be displayed identify the field type and set styleClass for
cell alignment. Numbers, Currency, %, etc should align right in table. put in map FieldName -> class name*/
//Get the meta data info for the fields is the related object
Map<String, Schema.SObjectField> fieldMap = getObjectDescribe().fields.getMap();

//For the fields in the related list populate fieldAlignMap map with the name of the correct style class. Also populate name->label map for header display
fieldAlignMap = new Map<String,String>();
nameLabelMap = new Map<String,STring>();
for(String fld : fieldNames){
String fieldType = fieldMap.get(fld).getDescribe().getType().name();

if(fieldType == 'CURRENCY' || fieldType == 'DOUBLE' || fieldType == 'PERCENT' || fieldType == 'INTEGER'){
fieldAlignMap.put(fld,'alignRight');
}else{
fieldAlignMap.put(fld,'alignLeft');
}

//Add to name->label map
String label = fieldMap.get(fld).getDescribe().getLabel();
nameLabelMap.put(fld,label);
}
}
}
return ssc.getRecords();
}

public Boolean getShowNewButton(){
//Display new button if user has create permission for related object
return getObjectDescribe().isCreateable();
}

public DescribeSObjectResult getObjectDescribe(){
/*Returns object describe for related list object. This is used in many places so we are using a dedicated method that only invokes
Schema describe calls once as these count against Apex limits. Because this methodo returns a DescribeSObjectResult all the get
methods for this object can be used directly in Visualforce: {!objectDescribe.label}*/
if(objectDescribe == null){
objectDescribe = Schema.getGlobalDescribe().get(objectName).getDescribe();
}
return objectDescribe;
}

public void sortByField(){
//Making ssc variable null will cause getRecords method to requery records based on new sort by field clicked by user
ssc = null;
}

public void deleteRecord(){
//Delete the selected object
for(sObject obj : ssc.getRecords()){
if(obj.get('Id') == deleteRecordId){
delete obj;
break;
}
}

//Make ssc variable null and execute get method
ssc = null;
getRecords();

}
public void saveRecord(){
for(sObject obje : ssc.getRecords()){
upsert obje;
}
//Make ssc variable null and execute get method
ssc = null;
getRecords();

}
}

Hi,

 

I am trying to pull the data from invoice & invoice line item using Dynamic Visualforce Bindings .  but i am unable to retrivre related list values.

 

Here i am keeping my code : 

public class AAA_DynamicBinding
{
public Invoice__c inv{get;set;}

// constructor
public AAA_DynamicBinding(){
inv= new Invoice__c ();
}

// get sobject fields of account object
public static List<String> getSobjectFields()
{
List<String> fields = new List<String>();

Map<String,Schema.SObjectType> gd = Schema.getGlobalDescribe();
Schema.SObjectType sobjType = gd.get('inv');
//Schema.SObjectType sobjType = gd.get('account');
Schema.DescribeSObjectResult r = sobjType.getDescribe();
Map<String,Schema.SObjectField> M = r.fields.getMap();

for(String fieldName : M.keyset())
{
Schema.SObjectField field = M.get(fieldName);
Schema.DescribeFieldResult fieldDesc = field.getDescribe();
fields.add(fieldName.toLowerCase());
}
return fields;
}
public PageReference save()
{
upsert inv;
return null;
}
}

 

 

<apex:page standardController="Invoice__c" extensions="AAA_DynamicBinding">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >

<apex:pageBlockTable value="{!inv}" var="i">

<apex:column headerValue="Name">
<apex:inputField value="{!i.name}"/>
</apex:column>
<apex:column headerValue="Quantity">
<apex:inputField value="{!i.invoice_status__c}"/>
</apex:column>
<apex:column headerValue="Invoice">
<apex:inputField value="{!i.invoice_tot__c}"/>
</apex:column>


</apex:pageblocktable>

</apex:pageBlockSection>
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Can any one help on this issue.

I seem to be having an issue with the Encrypt or decrypt portion of the password process.

 

Even i added security token to it but same problem.

 

 

0 [main] INFO com.salesforce.dataloader.process.ProcessConfig  - Loading process
 configuration from config file: C:\Datalodercli\process-conf.xml
47 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader  -
Loading XML bean definitions from file [C:\Datalodercli\process-conf.xml]
47 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanDefinitionReader  -
 Using JAXP implementation [com.sun.org.apache.xerces.internal.jaxp.DocumentBuil
derFactoryImpl@1256ea2]
62 [main] DEBUG org.springframework.beans.factory.xml.ResourceEntityResolver  -
Trying to resolve XML entity with public ID [-//SPRING//DTD BEAN//EN] and system
62 [main] DEBUG org.springframework.beans.factory.xml.ResourceEntityResolver  -
Trying to locate [spring-beans.dtd] in Spring jar
78 [main] DEBUG org.springframework.beans.factory.xml.ResourceEntityResolver  -
th
94 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionPa
rser  - Loading bean definitions
94 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionPa
rser  - Default lazy init 'false'
94 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionPa
rser  - Default autowire 'no'
94 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionPa
rser  - Default dependency check 'none'
94 [main] INFO org.springframework.core.CollectionFactory  - JDK 1.4+ collection
s available
94 [main] INFO org.springframework.core.CollectionFactory  - Commons Collections
 3.x available
109 [main] DEBUG org.springframework.core.CollectionFactory  - Creating [java.ut
il.LinkedHashMap]
109 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionP
arser  - Found 1 <bean> elements in file [C:\Datalodercli\process-conf.xml]
109 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Creatin
g instance of bean 'accountMasterProcess' with merged definition [Root bean: cla
ss [com.salesforce.dataloader.process.ProcessRunner]; abstract=false; singleton=
false; lazyInit=false; autowire=0; dependencyCheck=0; initMethodName=null; destr
oyMethodName=null; factoryMethodName=null; factoryBeanName=null; defined in file
 [C:\Datalodercli\process-conf.xml]]
109 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Invokin
g BeanPostProcessors before instantiation of bean 'accountMasterProcess'
125 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Getting
 BeanInfo for class [com.salesforce.dataloader.process.ProcessRunner]
125 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Caching
 PropertyDescriptors for class [com.salesforce.dataloader.process.ProcessRunner]
 
140 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found p
roperty 'class' of type [java.lang.Class]
140 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found p
roperty 'configOverrideMap' of type [java.util.Map]
140 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found p
roperty 'controller' of type [com.salesforce.dataloader.controller.Controller]
140 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found p
roperty 'name' of type [java.lang.String]
140 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Class [
com.salesforce.dataloader.process.ProcessRunner] is cache-safe
156 [main] DEBUG org.springframework.core.CollectionFactory  - Creating [java.ut
il.LinkedHashMap]
156 [main] DEBUG org.springframework.beans.BeanWrapperImpl  - About to invoke wr
ite method [public synchronized void com.salesforce.dataloader.process.ProcessRu
nner.setName(java.lang.String)] on object of class [com.salesforce.dataloader.pr
ocess.ProcessRunner]
172 [main] DEBUG org.springframework.beans.BeanWrapperImpl  - Invoked write meth
od [public synchronized void com.salesforce.dataloader.process.ProcessRunner.set
Name(java.lang.String)] with value of type [java.lang.String]
172 [main] DEBUG org.springframework.beans.BeanWrapperImpl  - About to invoke wr
ite method [public synchronized void com.salesforce.dataloader.process.ProcessRu
nner.setConfigOverrideMap(java.util.Map)] on object of class [com.salesforce.dat
aloader.process.ProcessRunner]
172 [main] DEBUG org.springframework.beans.BeanWrapperImpl  - Invoked write meth
od [public synchronized void com.salesforce.dataloader.process.ProcessRunner.set
ConfigOverrideMap(java.util.Map)] with value of type [java.util.Map]
187 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Invokin
g BeanPostProcessors before initialization of bean 'accountMasterProcess'
187 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Invokin
g afterPropertiesSet() on bean with name 'accountMasterProcess'
187 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Invokin
g BeanPostProcessors after initialization of bean 'accountMasterProcess'
219 [accountMasterProcess] INFO com.salesforce.dataloader.controller.Controller
 - The controller config has been initialized
219 [accountMasterProcess] INFO com.salesforce.dataloader.process.ProcessRunner
 - Initializing process engine
219 [accountMasterProcess] INFO com.salesforce.dataloader.process.ProcessRunner
 - Loading parameters
922 [accountMasterProcess] ERROR com.salesforce.dataloader.config.Config  - Erro
r loading parameter: sfdc.password of type: java.lang.String
java.lang.NumberFormatException: For input string: "as"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
        at java.lang.Integer.parseInt(Integer.java:456)
        at java.lang.Integer.valueOf(Integer.java:526)
        at java.lang.Integer.decode(Integer.java:919)
        at com.salesforce.dataloader.security.EncryptionUtil.textToBytes(Encrypt
ionUtil.java:58)
        at com.salesforce.dataloader.security.EncryptionUtil.decryptString(Encry
ptionUtil.java:194)
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:6
68)
        at com.salesforce.dataloader.config.Config.postLoad(Config.java:620)
        at com.salesforce.dataloader.config.Config.loadParameterOverrides(Config
.java:646)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:95)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:75)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:227)
969 [main] FATAL com.salesforce.dataloader.process.ProcessRunner  - Unable to ru
n process accountMasterProcess
java.lang.RuntimeException: com.salesforce.dataloader.exception.ParameterLoadExc
eption: Error loading parameter: sfdc.password of type: java.lang.String
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:137)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:75)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:227)
Caused by: com.salesforce.dataloader.exception.ParameterLoadException: Error loa
ding parameter: sfdc.password of type: java.lang.String
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:6
83)
        at com.salesforce.dataloader.config.Config.postLoad(Config.java:620)
        at com.salesforce.dataloader.config.Config.loadParameterOverrides(Config
.java:646)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:95)
        ... 2 more
Caused by: java.lang.NumberFormatException: For input string: "as"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
        at java.lang.Integer.parseInt(Integer.java:456)
        at java.lang.Integer.valueOf(Integer.java:526)
        at java.lang.Integer.decode(Integer.java:919)
        at com.salesforce.dataloader.security.EncryptionUtil.textToBytes(Encrypt
ionUtil.java:58)
        at com.salesforce.dataloader.security.EncryptionUtil.decryptString(Encry
ptionUtil.java:194)
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:6
68)
        ... 5 more
 
 
My process-conf.xml Files:
 

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="accountMasterProcess"
class="com.salesforce.dataloader.process.ProcessRunner"
singleton="false">
<description>accountInsert job gets the account record from the CSV file
and inserts it into Salesforce.</description>
<property name="name" value="accountMasterProcess"/>
<property name="configOverrideMap">
<map>
<entry key="sfdc.debugMessages" value="true"/>
<entry key="sfdc.debugMessagesFile"
value="C:\Datalodercli\accountInsertSoapTrace.log"/>
<entry key="sfdc.endpoint" value="https://login.salesforce.com"/>
<entry key="sfdc.username" value="mvrsreddy@gmail.com"/>
<entry key="sfdc.password" value="9016019f5e18b6c75f993da5924fd33bB0aszGmt639q7ut2j7UKT3ux"/>
<entry key="process.encryptionKeyFile"
value="C:\Datalodercli\key.txt"/>
<entry key="sfdc.timeoutSecs" value="600"/>
<entry key="sfdc.loadBatchSize" value="200"/>
<entry key="sfdc.entity" value="Account"/>
<entry key="process.operation" value="insert"/>
<entry key="process.mappingFile"
value="C:\Datalodercli\account.sdl"/>
<entry key="dataAccess.name"
value="C:\Datalodercli\accountInsert.csv"/>
<entry key="process.outputSuccess"
value="C:\Datalodercli\accountInsert_success.csv"/>
<entry key="process.outputError"
value="C:\Datalodercli\accountInsert_error.csv"/>
<entry key="dataAccess.type" value="csvRead"/>
<entry key="process.initialLastRunDate"
value="2005-12-01T00:00:00.000-0800"/>
</map>
</property>
</bean>
</beans>

 



Thanks in advance.

Hi to all,

 

I am new to Mobile apps.

Can any one post the tutorials , pdf etc regarding Mobile apps.

 

 

Thanks in Advance... 

I am trying to round the decimal places that are being displayed in an outputField to remove trailing zeros. The custom field that I am trying to display is set to be a number with 7 decimal places. There are cases though where not all 7 decimal places will be used, so I want to strip away trailing zeros.


Example: If I had 10.0001000 I want it to display as 10.0001 on my Visualforce page.

 

I tried doing something like this:

 

<apex:outputField value="{0}">
   <apex:param value="{!ROUND(customField__c, number)}" />
</apex:outputField>

 This returned an error value for <apex:outputField> is not a dynamic binding!

 

If I change it to an outputText it works, but I need this field to be based on user locale which is why I was using an outputField.

 

Thanks in advance!

  • August 22, 2012
  • Like
  • 0

Hello Everyone,

I am new to salesforce Integration , I want to integrate Twitter to salesforce(Saving Tweets to Object).

so please suggest me the learing resource for that.

Thanks

Hi

 

How can we get tweets of perticular user to salesforce object Like Twitter Account.

 

 

Thanks in advance.

Hi,

How can we use this code in visualforce page

<script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 30,
interval: 30000,
width: 'auto',
height: 300,
theme: {
shell: {
background: '#333333',
color: '#ffffff'
},
tweets: {
background: '#000000',
color: '#ffffff',
links: '#4aed05'
}
},
features: {
scrollbar: true,
loop: false,
live: false,
behavior: 'all'
}
}).render().setUser('Venkatareddymv').start();
</script>

Hi All,

 

I have a requirement where i need to get the link of the file shared/attached in chatter feed.

FeedItem does not have information related to this. FeedItem has RelatedRecordId which is a ID of a ContentVersion. But i could not able to get the link for that file. can someone please guide me or share the code how to get the link to that file. since i need to use that link in some custom object where the user should be able to go to that file on click on the link.

 

Thanks in advance 

Hi guys,

 

I'm trying to write a query selecting top 5 sales persons, this doesn't work:

 

SELECT SUM(Amount)AmountSum,OwnerId FROM Opportunity GROUP BY OwnerId ORDER BY AmountSum DESC LIMIT 5

 

What is the way to sort by aggregate column? I've been searching for almost an hour now but I'm nowhere closer. 

Hi Friends,

 

I have an Html file and I am extracting some data dynamically from the database and passing it to the HTML file.In the Html file I have two text fields in which I want to show he extracted vaalues.However  I have not been able to show those values.

 

Does any one knows how to do that,Any ideas are most welcome.?

Below give is what I am doing 

 

Testapp.html file is the file to which I am sending data

 

<apex:iframe src="http://bostonbusiness.s3.amazonaws.com/testapp/TestApp.html? parameter1=Hello&parameter2={!account.Name}  height="700" width="100%"/>

 

Thanks,

Trick123

Hello.  I have VF page which allows the User to select some records.  Then the User presses a button - which calls a controller method that returns a PageReference to a VF page with the contentType attribute set to a Word doc type.  Works perfectly - except that in addition to launching Word it also tries to load the page in the browser...so the browser is blank (Word doc looks fine).  What do i have to do to make the browser stay on the same page?  (i thought setting the contentType would have prevented the browser change, but apparently i'm mistaken there.

 

thanks

chris

I am testing to post file cotent to feedcomment from SOAP UI,  I am successfully able to post file to my feedItem but not in feedcomment. 

 

Here is my request xml for posting file content in feedcomment

 

 <sObjects xsi:type="FeedComment">
            <FeedItemId>${#TestCase#FeedItemId}</FeedItemId>
            <CommentBody>${#TestCase#Body}</CommentBody>
            <commentType>${#TestCase#ContentComment}</commentType>
 </sObjects>

 And here is the working one for feedItem 

 

<sObjects xsi:type="FeedItem">
           <ParentId>${#TestCase#ParentId}</ParentId>
           <Type>ContentPost</Type>
           <ContentData>${#TestCase#ContentData}</ContentData>
           <ContentFileName>${#TestCase#ContentFileName}</ContentFileName>
</sObjects>

 

I think there is some issue with order in how to send it, or I am missing few fields, see this link http://www.salesforce.com/us/developer/docs/api/index_Left.htm#CSHID=sforce_api_objects_feeditem.htm|StartTopic=Content%2Fsforce_api_objects_feeditem.htm|SkinName=webhelp

 

 

Thanks 

HI

Can any one know Macros in Excel sheet.....

 

My Requirement :

 

For example we have n records , in it I want to delete n-1 records and I want to display nth Record...

 

 

Can any one help on this issue ....

Hi,
I want to add error for save functionallity
so can any one help on this..  
public void saveRecord(){
    for(sObject obje : ssc.getRecords())
    {
    if(obje.get('WSR_Product__c')!=NULL)
    {
     try{
     upsert obje;
    system.debug('!!!!!!!!!!!!!!!!!!!' +obje);
   }
   
   catch(Exception e)
    {
     ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Object API name is invalid')) ;  
    }
      }
       }
        //Make ssc variable null and execute get method
        ssc = null;
        getRecords();
        
    }
    

Hi,

 

I need to connect to twitter and get posts/tweets from twitter.  Has any one connected/integrated to twitter ?, Any help must be highly appreciated.

 

Thanks in advance !

 

 

Regards,

RSK

  • April 16, 2012
  • Like
  • 0