function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bfeather19bfeather19 

inner variables

 

I dont know how to make the variables from CreateXMLFile(Contact[] updatedContacts, Map<ID, Contact> ContactMap) available in the createxml string below it.  It was orginally done with public lists but now I have to make this process work for bulk and I cant seem to get there.

 

any help???

 

 

public with sharing class CreateContactXML {
 

    private boolean m_isExecuting = false;
    private integer BatchSize = 0;
    public XML_Document_Helper.XML_Sheet xmlDoc{get;set;}
    XML_Document_Helper helper = new XML_Document_Helper();
    public string xmltran;
    public string attachmentid;
    String orgId = UserInfo.getOrganizationId();
  public CreateContactXML(boolean isExecuting, integer size){
       m_isExecuting = isExecuting;
       BatchSize = size;
       }
       
public void CreateXMLFile(Contact[] updatedContacts, Map<ID, Contact> ContactMap){

for( Contact c :updatedContacts){
   
 
        //creating the XML
        string newxml = createXMLDoc();
        
        //attaching the XML to XML_Transaction object
        attachmentid = helper.AttachContactXML(newxml,c.id);
       
        // sending out the XML
        //sendoutXML(attachmentid);
    
}
}

    public string  CreateXmlDoc(){ 

 
        
     List<XML_Document_Helper.XmlAttr> currCoverAttr = new List<XML_Document_Helper.XmlAttr>();
     xmlDoc = new XML_Document_Helper.XML_Sheet();
      
      XML_Document_Helper.XmlAttr xmlAttr= new XML_Document_Helper.XmlAttr();
      xmlAttr.attr = 'OrgID';
      xmlAttr.value = orgid;
      currCoverAttr.add(xmlAttr);
      
      xmlAttr= new XML_Document_Helper.XmlAttr();
      xmlAttr.attr = 'SFObject';
      xmlAttr.value = 'Contact';
      currCoverAttr.add(xmlAttr);