• Raghu Ch 2
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 0
    Replies
Hi,

I am parsing .csv file in visualforce. While parsing a percentage column from .csv file and assigning to the a percentage column (FMC_Ownership__c) in salesforce. I get the below error.

Invalid decimal error.

Code below let me know what the issue could be.

public class upload{

public string fileName{get;set;}
    public blob fileBody{get;set;}
    public attachment att{set;get;}
    
    public String[] filelines = new String[]{};
    
    public string nameFile{get;set;}


nameFile=fileBody.toString();
             //nameFile=EncodingUtil.base64Encode(fileBody);
           filelines = nameFile.split('\n');
            system.debug('#######' + filelines.size());
            
            List<Acquisition__c> aqList=new List<Acquisition__c>([Select Id,Pro_Forma_Version__c
                                            from Acquisition__c
                                            where Id=:ID]);
            
            aqUpdaList.clear();
            
            Map<Id,Acquisition__c> aqMapUpdate=new Map<Id,Acquisition__c>();
             for (Integer i=0;i<filelines.size();i++)
                {
                    String[] inputvalues = new String[]{};
                    inputvalues = filelines[i].split(',');
                    system.debug('#######' + inputvalues[1]);
                    for(Acquisition__c a:aqList){
                    a.Pro_Forma_Version__c=inputvalues[0];
                    a.FMC_Ownership__c=decimal.valueof(inputvalues[1].trim());
                    //Decimal.valueOf(inputvalues[1]);
                    //decimal.valueOf(inputvalues[1]);
                    aqUpdaList.add(a);
                    aqMapUpdate.put(a.Id,a);
                    }
                    //system.debug('#######' + Decimal.valueOf(inputvalues[1]));
                }
            
                //update aqUpdaList;
                update aqMapUpdate.values();
}
Hi,

I am working on a scenario where the file needs to be picked up from a SFTP server and loaded into salesforce.

Can salesforce web service pick up a file from sftp location and load it into salesforce? Whats the sytax for contructing a SFTP request?
Hi, 

I am trying to load attachment to salesforce using bulk api. As mentioned in the docs, i specified the request .txt as below in the root of the zipped folder:
[
  {
    "Name" : "Test.pdf",
    "ParentId" : "001U000000sRM7dIAG",
    "Body" : "#Test.pdf"
  }
  
]

But when the file is being loaded into salesforce, the body is being loaded as string (Test) but not as path. Content of the attachment is not getting loaded.Is there a way to specify the file path in json key-value pair? or does the bullk api for loading binary attachments work only with .csv format or xm format?
Hi All,

Getting the below error when i click on quick action containing a lightning component. 
Action failed: forceChatter:lightningComponent$controller$doInit (undefined is not an object (evaluating 'fn-apply')]

quickActionHandlerHelper.js failed to create component - forceChatter:lightningComponent

Let me know what the issue could be.
Hi,

I have a time dependent workflow action on a Opportunity to send an email alert 30 days before opportunity close date, if the opportunity amount is greater than 90,000. The email notification is being sent even if the close date of the opportunity is this week. Has any one come across this issue?
Hi All,

Getting the below error when i click on quick action containing a lightning component. 
Action failed: forceChatter:lightningComponent$controller$doInit (undefined is not an object (evaluating 'fn-apply')]

quickActionHandlerHelper.js failed to create component - forceChatter:lightningComponent

Let me know what the issue could be.