• Anu-cnp
  • NEWBIE
  • 0 Points
  • Member since 2011

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

Hello Salesforce community,

 

I am still learning about salesforce so I hope I am posting it to the right board.

 

So, I was trying to update and install an app from AppExchange...  and I got an email notification from Salesforce regards to installation failure.  As I look at the problem, it has to do with "too many DML rows"

 

Here is a screen shot:

http://www.box.net/shared/4s95cmef9x

 

Would anybody able to help and guide me to install this app correctly?

 

Thanks,

 

Anthony Lee

Hi,

 

I want to read xml from a custom object. My code is:

 

 

trigger dmldata on CnPData__c (before insert,after insert) {
    String dataxml;
  for(CnP__CnPData__c cpdata:Trigger.new){
         dataxml=cpdata.CnP__DataXML__c;
  }
  XmlStreamReader reader= new XmlStreamReader(dataxml);
  Contact[] contacts = new Contact[0];
   while(reader.hasNext()) {
        if (reader.getEventType() == XmlTag.START_ELEMENT) {
             System.debug('local nameee'+reader.getLocalName());
             if ('Contact' == reader.getLocalName()) {
                  Contact con= parseContact(reader);
                  contacts.add(con);
                    System.debug('Contacts after parsinggg'+contacts);
              }
        }
         reader.next();
    }
Contact parseContact(XmlStreamReader reader1){
     Contact contact = new Contact();
  
     while(reader1.hasNext()) {
     System.debug('event typpeeee'+reader1.getEventType());
        if (reader1.getEventType() == XmlTag.END_ELEMENT){
           break;
        } 
        else if (reader1.getEventType() == XmlTag.CHARACTERS) {
        System.debug('Contacts getTextttt'+reader1.getText());
           contact.FirstName= reader1.getText();
           contact.LastName= reader1.getText();
         System.debug('Last Nameeeeee'+contact.LastName);
         }
         
        reader1.next();
        
     }
      return contact;
   }
}
My XML is:
<?xml version="1.0" encoding="UTF-8"?>
<Contact>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
</Contact>
I can able to get First name as John. But the loop is not going to 'Doe'.I want to pass that value into last name.
Can any one of you throw some help on this?

 

Hi

 

I've  a custom field in a custom object. I'm posting an xml file through external API. It is posted successfully. Now I want to map that data into Contact Object. I'm facing too many Script statements.

 

My code is:

 

 

trigger dmldata on CnPData__c (before insert,after insert) {
String dataxml;
    for(CnP__CnPData__c cpdata:Trigger.new){
         dataxml=cpdata.CnP__DataXML__c;
    }
    System.debug('hiiiiiiiii'+dataxml);
    XmlStreamReader reader= new XmlStreamReader(dataxml);
    System.debug('reader valueeee'+reader);
    while(reader.hasNext()) {
    System.debug('reader event nameee'+reader.getEventType());
     /*if (reader.getEventType() == XmlTag.START_DOCUMENT) {
     System.debug('local nameee'+reader.getLocalName());
    
}*/
}
 
}
My sample xml in the field is :
<?xml version="1.0" encoding="utf-8"?>
<Contact>
 <FirstName>anu</FirstName>
    <LastName>rrr</LastName>  
 </Contact>
One more, If I debug the reader.getEventType() it is showing the Start_Document. I want this value as START_ELEMENT. how can I get that?
If it START_DOCUMENT how can I proceed with that to read the values.
Thanks a ton in advance.

 

Hi,

 

I've an xml file. I have to read data from XML and display on visualforce page and have to update some objects based on that data.

 

Can any one of you please help on this...

 

 

Thanks

Anu

Hi All,

 

I  have a problem with installing the packages. If the users want to install my package from appexchange, they need to install one more managed package before that.

 

If the users forgot this and tried to install my package and login to the application and follow the installation steps, finally they got the error messages like missing some packages into the system. 

 

I need this type of custom message while login to the user's credentials itself. Can I know how to do this.

 

 

Thanks in Advance.

 

Anuradha.