• rajesh reddy 3
  • NEWBIE
  • 40 Points
  • Member since 2014

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

I have installed app from app exchange (Inside sales) when am making the call from opportunity, contact and account it is working fine,
When am making call to lead saving the call results record is not saving and it is throwing the error

// Error Message 

The following error(s) occurred while trying to save your call log:
You can't relate a lead to an account or other object.

Any one help me out on this issue advance thanks 

Regards,
Rajesh
I have scenario like 50K Accounts I have to schedule through batch apex need to updated every day 
Once Account is updated in contact new entry will created automatically.

Advance thanks for Help:)

Regards,
Rajesh
public with sharing class Tes_SWAssetController {
    
    public string SWAssertNameLable {get;set;}
    public Account currentAccount;//variable to hold current Account
    public List<Software_Asset__c> lstSWI; //{set;get;}
    public List<Software_Asset__c> lstSWI_All; //{set;get;}
    public PageManager objPageManager {get;set;}
    public boolean displayPagenation {get;set;}
    /*
*   Constructor 
*/
    public Tes_SWAssetController(ApexPages.StandardController controller) {
        currentAccount = (Account) controller.getRecord();
        List<account> lstAcc = [SELECT ID, Party_Number__c, Global_DUNS_Entity_Hub__c, IsCustomerPortal FROM Account WHERE ID =: currentAccount.ID];
        if(lstAcc.size() == 1){
            currentAccount = lstAcc[0];
        }
        //currentAccount = [SELECT ID, Party_Number__c, Global_DUNS_Entity_Hub__c, IsCustomerPortal FROM Account WHERE ID =: currentAccount.ID];
        System.debug('*** currentAccount = ' + currentAccount);
        Map<String, Schema.SobjectField> fields = Software_Asset__c.getSObjectType().getDescribe().fields.getMap();
        SWAssertNameLable = fields.get('Name').getDescribe().getLabel();
        //If Account is CPA query with Party Number
        if(currentAccount.IsCustomerPortal){// IF Account is CPA account
            lstSWI_All = [SELECT s.Id, s.Description_formula__c, s.Name, s.Product_Line__c, s.Account__c, s.Account_City__c, s.Status__c, s.Unit_of_Measure__c, s.Entitled__c, s.Activated__c, s.Available__c FROM Software_Asset__c s WHERE s.Account__r.Global_DUNS_Entity_Hub__c =: currentAccount.Global_DUNS_Entity_Hub__c AND s.Status__c != 'Expir' ORDER BY s.Account__c, s.Account_City__c, s.Product_Line__c, s.Description__c limit 1000 ];
        } else {// IF Account is Non-CPA account
            lstSWI_All = [SELECT s.Id, s.Description_formula__c, s.Name, s.Product_Line__c, s.Account__c, s.Account_City__c, s.Status__c, s.Unit_of_Measure__c, s.Entitled__c, s.Activated__c, s.Available__c FROM Software_Asset__c s WHERE s.Account__r.Party_Number__c =: currentAccount.Party_Number__c AND s.Status__c != 'Expir' ORDER BY s.Account__c, s.Account_City__c, s.Product_Line__c, s.Description__c limit 1000];
        }        
        displayPagenation = (lstSWI_All.size() == 0 ? false : true);
        objPageManager = new PageManager(10); 
        objPageManager.numberOfRows = lstSWI_All.size(); 
    }
    /*
*   Method to query and  return lstSWI list to show in VF page
*   Query defers based on Account type(CPA/NON-CPA)
*/
    public List<Software_Asset__c> getlstSWI(){
        
        List<Software_Asset__c> toReturn = new List<Software_Asset__c>();
        for(integer i=objPageManager.startIndex;i<objPageManager.endIndex&&i<lstSWI_All.size();i++)
        {
            toReturn.add(lstSWI_All.get(i));
        }        
        
        return toReturn;
        
    }
    
}
<apex:page standardControler="Position__c" recordSetVar="Position">
<apex:pageblock title= "Position Record">

<apex:pageBlocktable value="{!Position}"var="pos">

<apex:column value= "{!pos_name"/>
<apex:column value="{!pos.max_pay__C"/>
<apex:column style="background_color:{!if(pos.min_Pay__C<=10000,'red',if(pos.min_Pay__C>10000&&pos.min_Pay__C<=20000,'yellow','blue'( Value="{!pos.min_Pay__C"/>
</apex:pageBlock Table>

</apexPageBlock>
</apex:page>


Error:
    Error: Unsupported attribute standardcontroler in <apex:page> in DempPage at line 1 column 68
<apex:page standardControler="Position__c" recordSetVar="Position">
<apex:pageblock title= "Position Record">

<apex:pageBlocktable value="{!Position}"var="pos">

<apex:column value= "{!pos_name"/>
<apex:column value="{!pos.max_pay__C"/>
<apex:column style="background_color:{!if(pos.min_Pay__C<=10000,'red',if(pos.min_Pay__C>10000&&pos.min_Pay__C<=20000,'yellow','blue'( Value="{!pos.min_Pay__C"/>
</apex:pageBlock Table>

</apexPageBlock>
</apex:page>


Am getting Below Error 

Error: Unsupported attribute standardcontroler in <apex:page> in DempPage at line 1 column 68
Hi All,
Am new to Ant tool, can anyone give the Steps ASAP
Am facing issues with Ant can you any one help me out am run in CMD am getting Bult.xml Does not exist. Build Failed,
Advance Thanks 
 
Hi All,
How I can Setup ANT Tool can anyone give the Steps?
Advance Thanks

Regards,
Rajesh
 
HI All ,
Map with in a Map how we can use in Salesforce can any one give the best practices

regards,
rajesh
 
Batch1:
global class ScheduleBatchToResetKBArticleReviewer implements schedulable{
    global void execute(SchedulableContext sc){
        //Custom setting
        KBAutomatedOperations__c cSData = KBAutomatedOperations__c.getValues('Reset KBArticle Reviewer');
        System.debug('cSData----->'+cSData);
        if(cSData != null){
            //Verify whether to run batch job or not .verify whether to skin next run
            if(cSData.Active__c && !cSData.SkipNextRun__c){
                    //initialize batch class
                    BatchToResetKBArticleReviewer executeBacth = new BatchToResetKBArticleReviewer();
                    //Execute batch
                    ID batchID = Database.executeBatch(executeBacth,1);
            }
            
            CronTrigger cronKBResetReviewer = [SELECT Id, CronExpression, PreviousFireTime ,TimesTriggered, NextFireTime,CronJobDetailID,CronJobDetail.Name,State FROM CronTrigger WHERE id =: sc.getTriggerId()];
            cSData.SkipNextRun__c = false;
            cSData.Previous_Run__c = cronKBResetReviewer.PreviousFireTime;
            cSData.Next_Run__c = cronKBResetReviewer.NextFireTime;
            update cSData;      
        }       
    }//End of Method  
}//End of Class

Batch2:

global class BatchToResetKBArticleReviewer implements Database.Batchable<String>{
    global Iterable<String> start(Database.BatchableContext BC)
    {   
        String stringQuery ='Select Id, Current_Reviewer__c from ';
        String whereClause =' where PublishStatus =\'Draft\' and Language = \'en_US\' and Current_Reviewer__c != null and Article_Status__c != \'Published\'';
        
        return new List<String> { stringQuery + 'Break_Fix__Kav'+ whereClause , stringQuery + 'Tutorial__kav'+ whereClause,stringQuery + 'Tech_Alert__kav'+ whereClause,stringQuery + 'FAQ__kav'+ whereClause};
    }

    global void execute(Database.BatchableContext BC,List<String> scope){
    //create  map which have knowledgeArticleId as key and sObject as value. SObject can be of any article type[Break fix , FAQ, Tech Alert]
        Map<Id,SObject> kaIdwithArticletypeSObjectMap = new Map<Id,SObject>();
        //For each article type add key and value to map
        for(String articleTypeQuery : scope){
                kaIdwithArticletypeSObjectMap.putAll(Database.query(articleTypeQuery));
        }
        if(kaIdwithArticletypeSObjectMap.size() > 0){
            for(sobject  sObj : kaIdwithArticletypeSObjectMap.Values()){
                //set current editor with blank value
                sObj.put('Current_Reviewer__c',null);
            }
            try{        
                update kaIdwithArticletypeSObjectMap.values();
            }catch(Exception ex){
                System.debug('### System Exception : '+ex);
                SystemUtils.createApexExceptionLog(ex,'BatchToBlankKBArticleReviewer');
            }                
        }
    }
    
    global void finish(Database.BatchableContext BC){
        System.debug('@@@@@@@@@@@ FINISH METHOD @@@@@@@@@@@@@');
    }
}

For both Batches I written one test class

@isTest
public class TestScheduleBatchToResetKBArticle {

  @isTest static void ScheduleBatchToResetKB_M1(){
        
        KBAutomatedOperations__c kbsetting = new KBAutomatedOperations__c();
        kbsetting.Active__c = true;
        kbsetting.SkipNextRun__c = false;
        kbsetting.name = 'Reset KBArticle Reviewer';
        insert kbsetting;
        
        FAQ__kav testFAQ = new FAQ__kav();
        testFAQ.language = 'en_US';
        testFAQ.urlname = 'testurl1';
        //testFAQ. ValidationStatus = 'Draft';
        testFAQ.title = 'testurl1title';
        testFAQ.Current_Reviewer__c = userInfo.getUserId();
        database.insert(testFAQ);
        
        Test.startTest();
        
        //ScheduleBatchToResetKBArticleReviewer scheduleClass = new ScheduleBatchToResetKBArticleReviewer();
        //String sch = '0 0 0 * * ?';      
        //system.schedule(System.Label.KB_Reset_KBArticle_Reviewer, sch, scheduleClass);
        String CRON_EXP = '0 0 0 1 1 ? 2025';  
        String jobId = System.schedule('testScheduledApex', CRON_EXP, new ScheduleBatchToResetKBArticleReviewer() );
                 
        Test.stopTest();
        
     
        
    }  
 
    
}
 
Hi All,

I have a requirement sorting the table using the JQuery:

Last Name    First Name     Article Number      Total Time in Queue 
  Asha             Anvesh                  1                    95 Days 5Hours
  Basha           Reddy                    2                    96 Days 4 Hours
  Chandu         Ranjan                   3                    97 Days 3 Hours
  Kiran             Zahid                     4                    98 Days 2 Hours

For Example:
Am taking the Total Time in Queue I have to sort this Way can anyone help me on this

1
11
12
13
14

2
21
22
23
24

 
I am fetching a picture from an object and want to store in a apex variable , in which data type we can store that image and how ?
public with sharing class CaseEmailClass
{   Public Contact cc{get;set;} 
    Public list<Contact> cn{get;set;}
    public String Comment { get; set; }
    public String Emailid { get; set; }
    public String ContactNo { get; set; }
    public String Name { get; set; }
    public PageReference submit() 
   {
   cn=[SELECT Id,Email FROM Contact];
   if(cn.Email==EmailId)
   {
    Case c=new Case();
            c.Status='New';
            c.ContactId=cn.id;
            c.Priority='High';
            c.Description=Comment;
            c.Subject='A New Case Has Been Rasied';
           insert c;
           }
  
   List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
      Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
      mail.setToAddresses(new String[] {'mail2gattam@gmail.com'});
       mail.setSubject('A New Case Has Been Raised');
     String table = '';
      String body='';
        /*     table=table+'Name:'+Name+'<br/>'; 
             table=table+'ContactNo:'+ContactNo+'<br/>';
             table=table+'Email Id:'+Emailid+'<br/>';
             table=table+'Comment:'+Comment+'<br/>'; */
          table = table + '<b><table  align="center" width="50%"  border: 1px solid black;>'; 
                  table = table + '<tr>';
                  table = table + '<td width="25%" align="center"><b>Name:&nbsp;&nbsp;</b>'+Name+'</td>'; 
                  table = table + '</tr>';
                  table = table + '<tr>';
                  table = table + '<td width="25%" align="center"><b>ContactNo:&nbsp;&nbsp;&nbsp;</b>'+ContactNo+'</td>'; 
                  table = table + '</tr>';
                  table = table + '<tr>';
                 table = table + '<td width="25%" align="center"><b>Email Id:&nbsp;&nbsp;&nbsp;</b>'+Emailid+'</td>';
                 table = table + '</tr>';
                 table = table + '<tr>';
                  table = table + '<td width="25%" align="center"><b>Comment:&nbsp;&nbsp;&nbsp;&nbsp;</b>'+Comment+'</td>'; 
                   table = table + '</tr>';
              body=table;
        mail.setHTMLbody(body);      
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });   
       // return null;
          Contact con= New Contact();
          con.LastName=Name;
          con.MobilePhone=ContactNo;
          con.Email=EmailId;
        insert con;
            Case c=new Case();
            c.Status='New';
            c.ContactId=con.id;
            c.Priority='High';
            c.Description=Comment;
            c.Subject='A New Case Has Been Rasied';
           insert c;
         return null;
   }
    }
Hi All,

I have a requirement sorting the table using the JQuery:

Last Name    First Name     Article Number      Total Time in Queue 
  Asha             Anvesh                  1                    95 Days 5Hours
  Basha           Reddy                    2                    96 Days 4 Hours
  Chandu         Ranjan                   3                    97 Days 3 Hours
  Kiran             Zahid                     4                    98 Days 2 Hours

For Example:
Am taking the Total Time in Queue I have to sort this Way can anyone help me on this

1
11
12
13
14

2
21
22
23
24