• Neelofer
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 0
    Replies
Hi All,

Can any one suggest me to read csv file from FTP site and create a record in salesforce using apex and without using any thirdparty tool.


Thanks you
Hi All,
        Can any one have SOAP api webserice calls examples, For REST api I found salesforce with Facebook, box.com etc..But for SOAP I didn't find any examples, Can you please help me with this one.....
I want to send JWT token in soap api calls, we have to send in http header or body....? I am new to SOAP can any one help me...


List<Account> accs=new List<Account>();
account a1=new account(name='gmail',phone='123');
account a2=new account(name='fb',phone='456');
account a3=new account(name='wtsup',phone='789');
accs.add(a1);
accs.add(a2);
accs.add(a3);

List<Contact> cons=new List<Contact>();
contact c1=new contact(LastName='gmail',phone='9030');
contact c2=new contact(LastName='fb',phone='7586');
contact c3=new contact(LastName='wtsup',phone='6935');
cons.add(c1);
cons.add(c2);
cons.add(c3);

insert accs;
for(account a:accs){
    for(contact c:cons){
        if(a.Name==c.LastName){
            c.AccountId=a.Id;
        }
    }
}
insert cons;

I am getting error Apex cpu Limit Exceeded.....How to resolve this issue plz suggest me....
In OpportunityContactRole there is no externalid field and we can't create custom filed..when I try to parse json data for every opportunity we got two similar contact role records means duplicate records..how can we avoid this...
I am trying to deserialize this response
{"invoiceList":[{"totalPrice":5.5,"statementDate":"2011-10-04T16:58:54.858Z","lineItems":[{"UnitPrice":1.0,"Quantity":5.0,"ProductName":"Pencil"},{"UnitPrice":0.5,"Quantity":1.0,"ProductName":"Eraser"}],"invoiceNumber  ":1},{"totalPrice":11.5,"statementDate":"2011-10-04T16:58:54.858Z","lineItems":[{"UnitPrice":6.0,"Quantity":1.0,"ProductName":"Notebook"},{"UnitPrice":2.5,"Quantity":1.0,"ProductName":"Ruler"},{"UnitPrice":1.5,"Quantity":2.0,"ProductName":"Pen"}],"invoiceNumber  ":2}]}

here I give invoiceNumber with space.

After deserialize this data I got invoiceNumber=null
plz help me this is my code

public class ParsingJsonExample2 {
    public string input                    {set;get;}    
    public string output                {set;get;}
    public void getdata(){
        input='{"invoiceList":[{"totalPrice":5.5,"statementDate":"2011-10-04T16:58:54.858Z","lineItems":[{"UnitPrice":1.0,"Quantity":5.0,"ProductName":"Pencil"},{"UnitPrice":0.5,"Quantity":1.0,"ProductName":"Eraser"}],"invoiceNumber ":1},{"totalPrice":11.5,"statementDate":"2011-10-04T16:58:54.858Z","lineItems":[{"UnitPrice":6.0,"Quantity":1.0,"ProductName":"Notebook"},{"UnitPrice":2.5,"Quantity":1.0,"ProductName":"Ruler"},{"UnitPrice":1.5,"Quantity":2.0,"ProductName":"Pen"}],"invoiceNumber ":2}]}';
        fromJSON json2Apex =fromJSON.parse(input);
        system.debug(json2apex);
    }
}

inner class:
public class fromJSON{
    public cls_invoiceList[] invoiceList;
    public class cls_invoiceList {
        public decimal totalPrice;    
        public Datetime statementDate;    
        public cls_lineItems[] lineItems;
        public Integer invoiceNumber ;    
    }
    class cls_lineItems {
        public decimal UnitPrice;    
        public Decimal Quantity;    
        public String ProductName;    
    }
    public static fromJSON parse(String json){
        return (fromJSON) System.JSON.deserialize(json, fromJSON.class);
    }
   
}

here unn