• ashok 45
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 4
    Replies
I have a requirement to get the normalized data when we send date, amount etc ... Can you please help me out how can we implement in salesforce. Thanks 
Hi All,
    Not able to call future method in test class. while inserting test data into the test class. test class is not calling the future method. find the below code

Public class SampleClass{
     Public static void UpdatingRecordFields(ID AccountID){

             //logic
            //logic
         
               CallFutureMethod(AccountID) 
     }

     @future
     Public Static void CallFutureMethod(ID AccountID){
               //Calling Approval Process
               Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
                         req1.setObjectId(AccountID);
                         req1.setProcessDefinitionNameOrId('Manager_Approval_Process_API');
                Approval.ProcessResult result = Approval.process(req1); //(Here approval process meeting the crtiria but it showing this error)     FATAL_ERROR|System.DmlException: Process failed. First exception on row 0; first error: NO_APPLICABLE_PROCESS, No applicable approval process was found.: []
     }
}
Hi All,
        Can anyone help me in this. 

      There is a use case where I need to dynamically select users and submit the record for approval to all the users. And this needs to be an unanimous approval not serial. Is this possible using flow? 

       
Hi All,

   Here , I have a scenario like whenever Child__c object Status__c='Closed', i want to send email to 
   Parent__c owner and Parent__c owners manager.
   the email template looks like below

 
  
   To : Parent__c owner email(email id of owner)
   cc : Parent__c owner manager email(email id of manager of owner)
   Subj: child {!child.name} closed
   body: ---text--- and some merge fields

   My sol : (can you point if am wrong)
   
          ->(1). I going through process builder
          ->(2). calling flow(through flow am calling apex class. In apex class i want to refer 
                 Parent__c owner email id and Parent__c owner manager email id in Email template).

             Let me know, is there any better solution rather than this? if it is good solution

     Could you please tell me how to get the Parent__c owner email id and Parent__c owner manager
     Email id in FLOWS(I am New to FLOWS). i want to refer these fields in templete whicih i written in apex class.
Hi All,

   I want to get test coverage code for date and time methods.
   Methods looks like

   public String dateCalulate(Date dtDate)
   {
    ////////////////////
   }

   public String timeCalulate(String strTime)
   {
         String strTime1='00:00:00';
            if(strTime == '12:00 AM')   strTime1='00:00:00';
            else if(strTime == '11:30 PM')  strTime1='23:30:00';
            else if(strTime == '11:45 PM')  strTime1='23:45:00';
             
             return strTime1;
   }
Hi All,
 I am getting error Web service callout failed: WebService returned a SOAP Fault: No security header detected (from client) faultcode=env:Client faultactor=  while passing service auth header in method.
 
 Can anyone help me to solve this issue.

 This is the GeneratedWsdlClass. Here I am facing the problewm with ServiceAuthHeader
 
 Web service callout failed: WebService returned a SOAP Fault: No security header detected (from client) faultcode=env:Client faultactor=
 
Public class GeneratedWsdlClass
{
 public class ServiceAuthHeader 
 {
        public String Password;
        public String Username;
        private String[] Password_type_info = new String[]{'Password','urn:Contracts:MessageContacts',null,'0','1','true'};
        private String[] Username_type_info = new String[]{'Username','urn:Contracts:MessageContacts',null,'0','1','true'};
        private String[] apex_schema_type_info = new String[]{'urn:Contracts:MessageContacts','true','false'};
        private String[] field_order_type_info = new String[]{'Password','Username'};
 }
}

 I have written this snippet in my apex class and excuted am getting error as Web service callout failed: WebService returned a SOAP Fault: No security header detected (from client) faultcode=env:Client faultactor=

        
        GeneratedWsdlClass.ServiceAuthHeader sah=new GeneratedWsdlClass.ServiceAuthHeader();
        sah.username='gsgf98hg';
        sah.password='htg854hgf';
        
        
Hi All,
     
 Iam new to soap integration. I have generated this class from WSDL file, I have to pass the Currentdate,BD,BDtype,restrictions into this class but i am confusing to find out method?
  can you help me in this?
  
  public class generatdclass
  {
   public class CandAllows {
        public String CurrentDate;
        public String BD
        public String BDType;
        public wwwsampleendpointcom.ArrayOfAllows Allows;
        private String[] CurrentDate_type_info = new String[]{'CurrentDate','http://www.Samplendpoint.com/se/',null,'0','1','true'};
        private String[] BD_type_info = new String[]{'BD','http://www.Samplendpoint.com/se/',null,'0','1','true'};
        private String[] BDType_type_info = new String[]{'BDType','http://www.Samplendpoint.com/se/',null,'0','1','true'};
        private String[] Allows_type_info = new String[]{'Allows','http://www.Samplendpoint.com/se/null,'0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://www.Samplendpoint.com/se/','true','false'};
        private String[] field_order_type_info = new String[]{'CurrentDate','BD','BDType','Allows'};
    }
  }




Hi All,
    This is my sample XML data. I want to convert(Serialize) XML into JSON. Iam doing like this If am wrong please let me know.
   
    
    
 String xml= ' <?xml version="1.0" encoding="utf-16"?>
 
 <GETmethod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Extend />
  <Successful>true</Successful>
  <CustAllowed>
    <CustomerAllow>
      <SampleData />
      <CurrentDate>10/14/2015</currentDate>
      <DocID>296</DocID>
      <DType>BP</CIDType>
    </CustAllow>
  </CustAllowed>
 </GetMethod>';
 
 
 String JSONString = JSON.serialize(xml);
 
    I want to post it into future method, like below. will it take as JSON format or String format?
    
 ==> CalloutMethod(JSONString)
 
  @future(callout=true)
  public static void CalloutMethod(JSONString)
  {
   //Code 
  }
Hi All,


  How can store 6 records in map1?

Can you help me in this, wether i am correct or not. if am wrong please tell me possible way to store 6 records in map?

Here  i want to pass map1 into another method


Map<String,String> map1=Map<String,String>();


list<Custom_Object__c> clist=[select id,name,phone__c,fax__c,country__c from Custom_object__c]; 
System.debug('size is'+clist.size()); // SIZE is 6

for(integer i=0;i<clist.size();i++)
{
 string sname=clist[i].name;
 string sphone=clist[i].phone__c;
 string sfax=clist[i].fax__c;
 string scountry=clist[i].country__c;
 
 map1.put('Name',sname);
 map1.put('Phone',sphone);
 map1.put('Fax',sfax);
 map1.put('Country',scountry);
}

System.debug('size map31 is' +map1.size()); //want to get 6 here, and want map1 can store 6 records


mapvalues(map<string,string> map1);


============

here is the method

public static void mapvalues(map<string,string> map1);
{
 //here i want to insert that 6 records into cust object web_logs__c

//  1. name phone fax country
//  2. name phone fax country
//  3. name phone fax country
//  4. name phone fax country
//  5. name phone fax country
//  6. name phone fax country
}
Hi All,


this is my sample response. here i want to capture <Allows> start tag to </Allows> end tag into record . In my InsertrecordMethod
am able to pass but it is inserting null values like this
 
    XMLNode[ELEMENT,Allows,null,null,null,[XMLNode[ELEMENT,ALLOW,null,null,null,[XMLNode[ELEMENT,ExtensionData,null,null,null,null,null,], ....... 

    here I dont want to allow null values. how can we avoid null values?? Can any one help me in this.

 /* String xml= ' <?xml version="1.0" encoding="utf-16"?>
<GETmethod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Extend />
  <Successful>true</Successful>
  
  
 <CustAllowed>
    <CustomerAllow>
      <SampleData />
      <CurrentDate>10/14/2015</currentDate>
      <DocID>296</DocID>
      <DType>BP</DType>
      
      <Allows>
        
        <ALLOW>
          <BID />
          <RDG/>
          <sampleDesc>exist1</sampleDesc>
          <sampleID>123456</sampleID>
          <DocID>111</DocPID>          
          <State />
        </ALLOW>
        
        <ALLOW>
          <BID />
          <RDG/>
          <sampleDesc>exist1</sampleDesc>
          <sampleID>123456</sampleID>
          <DocID>222</DocID>          
          <State />
        </ALLOW>
      
      </Allows>
    </CustAllow>
  </CustAllowed>
</GetMethod>'; */

 
 String xml= '<?xml version="1.0" encoding="utf-8"?> <GetMethod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Extend /> <Successful>true</Successful> <CustAllowed> <CustomerAllow> <SampleData /> <CurrentDate>10/14/2015</CurrentDate> <DocID>296</DocID> <DType>BP</DType> <Allows> <ALLOW> <BID /> <sampleDesc>exist1</sampleDesc> <sampleID>123456</sampleID> <DocID>111</DocID> <State /> </ALLOW> <ALLOW> <BID /> <sampleDesc>exist1</sampleDesc> <sampleID>123456</sampleID> <DocID>222</DocID> <State /> </ALLOW> <ALLOW> <BID /> <sampleDesc>exist1</sampleDesc> <sampleID>123454</sampleID> <DocID>333</DocID> <State /> </ALLOW> </Allows> </CustomerAllow> </CustAllowed> </GetMethod>';
  
       Dom.Document doc = new Dom.Document();
       doc.load(xml);
        //Retrieve the root element for this document.
        Dom.XMLNode root = doc.getRootElement();
        
        String strSuccessful= root.getChildElement('Successful', null).getText();
        
        Dom.XMLNode ycharge=root.getChildElement('CustAllowed',null).getChildElement('CustomerAllow',null);
        String strActivityDatey = ycharge.getChildElement('CurrentDate', null).getText();
        String strCIDy = ycharge.getChildElement('DocID',null).getText();
        String strCIDTypey = ycharge.getChildElement('DType',null).getText();
    
        Dom.XMLNode ycharge1=ycharge.getChildElement('Allows',null);
        
        // Here I am passing ycharge1 into InsertrecordMethod
        
        InsertrecordMethod(ycharge1);
        
        
        
        
        //Here is the my method
         
         Public static void InsertrecordMethod(Dom.XMLNode ycharge1)
         {
          
          WebLog__c w=new WebLog__c();
          w.name='response1';
          w.ResponseXML=String.valueof(ycharge1);
          Insert w; // Here am able to insert response into my custom object but problem is it is inserting null values. i dont want to insert null values in tags
         }
         
         
Hi,

  Can anyone help me in this. want to get the XML response from future callout and read it from other method. please look into sample code of mine.





   @future(callout=true)
public static void calloutsample(string name,String phone)
{
 http h=new http();
 tring endPointURL='https://www.endpoint.com';
 Http req = new Http();
 HttpRequest Req=new HttpRequest();
 Req.setHeader('Content-Length', '0');
 Req.setEndpoint(endPointURL);
 Req.setMethod('POST');
 Req.setHeader('Content-Type',text/XML)            // Is this correct, i am sending xml data to external system
 Req.setbody(XMLString);
 httpresponse res=h.send(Req);
 xmlStreamReader reader=res.getxmlStreamReader();
 readresponse(reader);                             //Is this correct. this is the method to read the xml response 
 
}

public void readresponse(reader)
{
 //want to read the xml response here, based on the response want to perform some actions.
}
here, i want to read DocID for each Allow node, i have written sample DOM to read the xml.
Is there any method to caluculate the size for nodes(here am having 3 Allow nodes,based on this want to read
each DocID, based on that want to perform some operation)

Can anyone help me in this.



 String xml= ' <?xml version="1.0" encoding="utf-16"?>
<GETmethod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Extend />
  <Successful>true</Successful>
  
  
 <CustAllowed>
    <CustomerAllow>
      <SampleData />
      <CurrentDate>10/14/2015</currentDate>
      <DocID>296</CID>
      <DType>BP</CIDType>
      
      <Allows>
        
        <ALLOW>
          <BID />
          <sampleDesc>exist1</sampleDesc>
          <sampleID>123456</sampleID>
          <DocID>111</DocPID>          
          <State />
        </ALLOW>
        
        <ALLOW>
          <BID />
          <sampleDesc>exist1</sampleDesc>
          <sampleID>123456</sampleID>
          <DocID>222</DocPID>          
          <State />
        </ALLOW>

        <ALLOW>
          <BID />
          <sampleDesc>exist1</sampleDesc>
          <sampleID>123454</sampleID>
          <DocID>333</DocPID>          
          <State />
        </ALLOW>
      
      </Allows>
    </CustAllow>
  </CustAllowed>
</GetMethod>';
  



       Dom.Document doc = new Dom.Document();
       doc.load(xml);
        //Retrieve the root element for this document.
        Dom.XMLNode root = doc.getRootElement();
        
        String strSuccessful= root.getChildElement('Successful', null).getText();
        
        Dom.XMLNode ycharge=root.getChildElement('CustAllowed',null).getChildElement('CustomerAllow',null);
        String strActivityDatey = ycharge.getChildElement('CurrentDate', null).getText();
        String strCIDy = ycharge.getChildElement('DocID',null).getText();
        String strCIDTypey = ycharge.getChildElement('DType',null).getText();
    
        Dom.XMLNode ycharge1=ycharge.getChildElement('Allows',null);
        
        for(Dom.XMLNode child: ycharge1.getChildElements())
        {
        
         Can anyone help here to read the each DocID in Allow nodes,here 3 nodes given in xml string
         i want to write for loop to read the DocID,. can anyone help me in this
          for(integer i=0;i<child.getAttributeCount();i++)
          {
           system.debug('DocID is +++++++ ' +child.gettext());
          }
        }
Hi,
  AM getting this error. can you please help me in this.

caused by: System.AsyncException: Rate Limiting Exception : AsyncApexExecutions Limit exceeded.
Hi ,
    I got confused while reading a XML response using DOM. Can you please help me in this. here am posting my response.




<?xml version="1.0" encoding="utf-8"?>
<Global xmlns:xsi="http://www.heelo.com" xmlns:xsd="http://www.yahoo.com">
  <Successful>false</Successful>
  <restrictone>
    <restrictFilter>
      <errormessage>error</errormessage>
      <code>2002</code>
      <candidate>Ashok</candidate>
      <topFilters>
        <SubFilter>
          <Subtype>WWE</Subtype>
        </SubFilter>
      </topFilters>
    </restrictFilter>
  </restrictone>
</Global>
Hi,
   I got a response this, here i want to read the data from the response.
can you please help me in this, can you give sample code for this.
How can we read the data from xml?

<?xml version="1.0" encoding="utf-16"?>
<Getmessage xms:xi="http://www.hello.com" xms:xd="http://www.hello.com">
<errorcode>2002</errorcode>
<errormessage>got error</errormessage>
</GetMessage>
Hi All,
    Not able to call future method in test class. while inserting test data into the test class. test class is not calling the future method. find the below code

Public class SampleClass{
     Public static void UpdatingRecordFields(ID AccountID){

             //logic
            //logic
         
               CallFutureMethod(AccountID) 
     }

     @future
     Public Static void CallFutureMethod(ID AccountID){
               //Calling Approval Process
               Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
                         req1.setObjectId(AccountID);
                         req1.setProcessDefinitionNameOrId('Manager_Approval_Process_API');
                Approval.ProcessResult result = Approval.process(req1); //(Here approval process meeting the crtiria but it showing this error)     FATAL_ERROR|System.DmlException: Process failed. First exception on row 0; first error: NO_APPLICABLE_PROCESS, No applicable approval process was found.: []
     }
}
Hi All,

   I want to get test coverage code for date and time methods.
   Methods looks like

   public String dateCalulate(Date dtDate)
   {
    ////////////////////
   }

   public String timeCalulate(String strTime)
   {
         String strTime1='00:00:00';
            if(strTime == '12:00 AM')   strTime1='00:00:00';
            else if(strTime == '11:30 PM')  strTime1='23:30:00';
            else if(strTime == '11:45 PM')  strTime1='23:45:00';
             
             return strTime1;
   }
Hi All,
     
 Iam new to soap integration. I have generated this class from WSDL file, I have to pass the Currentdate,BD,BDtype,restrictions into this class but i am confusing to find out method?
  can you help me in this?
  
  public class generatdclass
  {
   public class CandAllows {
        public String CurrentDate;
        public String BD
        public String BDType;
        public wwwsampleendpointcom.ArrayOfAllows Allows;
        private String[] CurrentDate_type_info = new String[]{'CurrentDate','http://www.Samplendpoint.com/se/',null,'0','1','true'};
        private String[] BD_type_info = new String[]{'BD','http://www.Samplendpoint.com/se/',null,'0','1','true'};
        private String[] BDType_type_info = new String[]{'BDType','http://www.Samplendpoint.com/se/',null,'0','1','true'};
        private String[] Allows_type_info = new String[]{'Allows','http://www.Samplendpoint.com/se/null,'0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://www.Samplendpoint.com/se/','true','false'};
        private String[] field_order_type_info = new String[]{'CurrentDate','BD','BDType','Allows'};
    }
  }
Hi,

  Can anyone help me in this. want to get the XML response from future callout and read it from other method. please look into sample code of mine.





   @future(callout=true)
public static void calloutsample(string name,String phone)
{
 http h=new http();
 tring endPointURL='https://www.endpoint.com';
 Http req = new Http();
 HttpRequest Req=new HttpRequest();
 Req.setHeader('Content-Length', '0');
 Req.setEndpoint(endPointURL);
 Req.setMethod('POST');
 Req.setHeader('Content-Type',text/XML)            // Is this correct, i am sending xml data to external system
 Req.setbody(XMLString);
 httpresponse res=h.send(Req);
 xmlStreamReader reader=res.getxmlStreamReader();
 readresponse(reader);                             //Is this correct. this is the method to read the xml response 
 
}

public void readresponse(reader)
{
 //want to read the xml response here, based on the response want to perform some actions.
}