• SIVASASNKAR
  • NEWBIE
  • 75 Points
  • Member since 2012
  • Mr

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 35
    Questions
  • 39
    Replies
Hi,
Is it possible to create a new detail record everyday of master record using Apex Schedular, as I am new to Apex please suggest me how can i do that?
how to create the new visual page in force.com ide??? getting error while creating new page 
Hi 

We are deactivating the User as he left the company but there are many Reports that he has set as running user. Is there a way to mass change all the Reports to a different running user? I wish to get report's running User in Apex class, please let me know how can I acieve this.

Thanks,
Sivasankar
 
Hi All,

I would like to find out all scheduled reports and it's running user info in org using Apex, could any one suggest me how can I achieve this ?

Thanks,
Sivasankar.
Hi, I wish to query the User Srorage Usage for specific user available on https://<Instatnce>.salesforce.com/setup/user/userstorageusage.jsp?id=UserID

Suggest me, how can I achieve this. 

Thanks,
Siva
Hi All,

I would like to query all SObject recrods owned by specific user, can you please guide me how can we do that?

My requirement:
We would like to deactivate the more Users in our org, hence instead of transfering the records for each user manually, require to implement through apex that all records will transfer from one User  to another on button click. any alternative suggestion would be appriciated..

Thanks
Sivasankar. 
Hi Experts,

I would like to schedule an apex class to run every 2 day ( even days 2,4,6,8... or odd days 1,3,5,7...), can any one help me to write cron expression for this. Please let me know in case if you required any more informaiton. I have alternative solution, but I would expecting direct cron expression for this.

Immidiate answers would be appriciated.

Thank you,
Sivasankar K.

Hi All,

 

Can any one help me,

 

I have a problem with the schedule jobs, i have total 50 jobs. in this I want to delete the firsh 25 jobs which were not scheduled next time. I am using timestamp wile scheduling the job.

Ex:

 

Job 1 cronExpression='0 5 10 5 2013 ';

Job 2 cronExpression='0 10 10 5 2013 ';

Job 3 cronExpression='0 15 10 5 2013 ';

Job 4 cronExpression='0 25 10 5 2013 ';

Job 5 cronExpression='0 30 10 5 2013 ';

....

like up to

job 20

I want to delete from job1 to job 10;

 

 

please suggest me.

HI Everyone,

I wish to display a message to my users like "You are not allowed to edit the Close Date" in opportunity object while updating an opportunity record useing standard UI (not Visualforce page). So I want to open a visualforce page from trigger or normal apex class.

 

Please help me.

 

Thanks & Regards,

Sivasankar

HI Everyone,

I wish to display a message like "You are not allowed to edit the Close Date" in opportunity object while updating an opportunity record useing standard UI (not Visualforce page). So I want to open a visualforce page from trigger or normal apex class.

 

Please help me.

 

Thanks & Regards,

Sivasankar

 

Please help me Urgent

 

1. In delegate approval process, let us assume 3 steps in approval process

 

X, Y and Z are the Delegators for A, B and C

 

                                                                               AssignTo                                    Actual Approver

 

Step 1:

                                                                                   X                                                           X

Step 2:

                                                                                   Y                                                           Y

Step 3:

                                                                                   Z                                                           Z

 

In step 1: X is approved through email now I need to send one email to A with message of Opportunity is approved by X on date.

In Step 2: Y is approved through email now I need to send one email to B  with message of Opportunity is approved by Y on date

 

In Step 3: Z is Rejected through email now I need to send one email to C  with message of Opportunity is Rejected by Z on date

 

I wrote trigger on opportunity for sending email to A or B or C. But my problem is after approving or rejecting the approving record is created in ProcessInstanceStep based on ProcessInstance Id, I wrote code for getting records from Process InstanceStep when trigger is fired on Opportunity on afterUpdate event but the values are not get newly created record it is taking time to create record on ProcessInstanceStep,. I need to stop the trigger to fire after 2 min.. The trigger is Fired Quickly before record is created on ProcessInstanceStep. 

 

 

 

 

   

What is the difference between System define and user define could you please explain elaborate?

Hi, Good morning every one.

 

  I have a problem while creating a variable in visualforce page I got Error like Unable to find controller class in visual force page. Please help me. 

 

Hi every one i want fix the page header as logo size for every page after the header i need to display the table header for every page if the records are excceded. and how to do the page nation in pdf. please help me immidiatly.

Hi I want total information about the big machines+sales force please provide  detail information links OR where can i get the information.

 

Big Machines + Salesforce help me i want total details of Big machines in sales force 

<APEX:TABPANEL>

<APEX:TAB>

<APEX:SELECTLIST>

<APEX:SELECTOPTION ITEMVALUE="A" ITEMLABEL="B">

<APEX:SELECTOPTION ITEMVALUE="G" ITEMLABEL="C">

<APEX:SELECTOPTION ITEMVALUE="F" ITEMLABEL="D">

<APEX:SELECTOPTION ITEMVALUE="D" ITEMLABEL="E">

</APEX:SELECTLIST>

</APEX:TAB>

</APEX:TABPANEL>

 

Hi,

   I WANT DISPLAY THE DYNAMIC RECORDS AND COLUMNS FOR DYNAMIC OBJECTS BUT I GOT  THE DYNAMIC COLUMNS BUT THE RECORDS ARE NOT PRESENT IN THE TABLE.  PLEASE HELP ME

 

 

DYNAMICRECORDS CLASS

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

public with sharing class DynamicRecords {


public List<selectoption> allobjects{ get; set; }
list<String> lstfield=new list<String>();
public String selectedobject { get; set; }
public map<String , String> mapFieldToShow{get;set;}

public DynamicRecords()
{ allobjects= new List<selectoption>();
allobjects.add(new selectoption('','---Select Object---'));
allobjects.add(new selectoption('Account','Accounts'));
allobjects.add(new selectoption('Contact','Contacts'));
allobjects.add(new selectoption('Opportunity','Opportunities'));
allobjects.add(new selectoption('Lead','Leads'));
allobjects.add(new selectoption('Case','Cases'));

}


public List<String> strFields { get; set; }
public String Str {get;set;}
public List<Sobject> Records { get; set; }


public PageReference RecordsAll() {
Str='';
map<String , String> mapFieldToShow=new map<String , String>();
System.debug('========================'+selectedobject );
strFields = new List<String>();
Map<String, Schema.sobjectfield> AllFields = Schema.getGlobalDescribe().get(selectedobject).getDescribe().fields.getMap();
// system.debug('============================='+AllFields.keyset() );


SObjectType objToken = Schema.getGlobalDescribe().get(selectedobject );
DescribeSObjectResult objDef = objToken.getDescribe();
Map<String, SObjectField> fieldmap = objDef.fields.getMap();

for(Schema.sobjectField obj: AllFields.values())
lstfield.add(String.valueOf(obj));

for(Schema.sobjectField F: AllFields.values())
{

SObjectField fieldToken = F;
DescribeFieldResult selectedField = fieldToken.getDescribe();
// lstflabel.add(selectedfield.getLabel());
mapFieldToShow.put(selectedField.getLabel() ,selectedField.getLocalName());

// system.debug('============================='+mapFieldToShow.keyset());

strFields .add(String.valueOf(F));
if(Str=='')
Str=String.valueOf(F);
else
Str= Str+','+String.valueOf(F);
}

//system.debug('===========Fields=================='+strFields );
//system.debug('===========Fields==List================'+lstfield);
system.debug('============================='+Str );

String Squery='select '+Str+' from '+selectedobject ;
system.debug('=================squery======================'+Squery);

Records = new List<Sobject>();
//if(selectedobject == 'Account')
Records =database.query(Squery);
// for(Sobject c: Records)
// system.debug('=================squery======================'+c);

return null;
}

}

 

-------------------

DYNAMIC PAGE

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

<apex:page controller="DynamicRecords">
<apex:form >
<!-- <apex:actionfunction name="pass" action="" rerender="out"/>-->
<apex:selectList size="1" value="{!selectedobject}" >
<apex:selectoptions value="{!allobjects}" ></apex:selectoptions>
<apex:commandButton value="Go" action="{!RecordsAll}"/>
</apex:selectList>
<apex:pageBlock id="out">
<apex:pageblocktable columns="{!strFields.size}" value="{!Records }" var="R" >

<apex:repeat value="{!strFields }" var="F" >

<apex:column width="50px" style="font-size:15; font-color:" headerValue="{!F}" value="{!R[mapFieldToShow[F]]}" >

</apex:column>

</apex:repeat>

</apex:pageblocktable>

</apex:pageBlock>

</apex:form>
</apex:page>

I WANT DEVELOP THE CALCULATOR IN VISUAL FORCE PAGE

HI ,

      I'm trying to override an image with another when mouseover and mouseout please suggest me.

 

 

 

Thanks and Regards

SIVASANKAR

 

I want Access Staticresources directly in Javascript . please help me

When I run the following code i got error like 

 

"controllercls2 Compile Error: Illegal assignment from LIST<Account> to LIST<Account> at line 9 column5" 

 

And

 

When i insert out side of constructor " lst=[select id,name,phone from Account]; "

I got Error lik this

 

 

"Error: controllercls2 Compile Error: unexpected token: '=' at line 11 column 3 "

 

 

<apex:page controller="controllercls2" id="page">
<apex:form id="form">

<apex:outputlabel >Enter Text to search</apex:outputlabel>
<apex:inputtext />
<apex:commandButton value="Search" />
<apex:pageblock id="pb">
<apex:pageblocktable value="{!lst}" var="c">
<apex:column value="{!c.name}"/>
<apex:column value="{!c.phone}"/>
</apex:pageblocktable>


</apex:pageblock>
</apex:form>
</apex:page>

 

------------------------------------------

 

public with sharing class controllercls2 {

public List<Account> lst { get; set; }


public controllercls2()
{

lst=[select id,name,phone from Account];
}


}

 

>>

>>

 I WANT TO DISPLAY MY OWNER FIELD ON VISUAL FORCE FIELD.

 

Example:

 

I HAVE UNIVERSITIES__C CUSTOME OBJECT OWNER IS SIVASANKAR ADMIN

 

 

I'm unable to display my woner field on the visual force page

 

<apex:inputField value=" {!Universities__c.owner} "/>

 

OR

 

<apex:outputField value="{!Universities__C.Owner}"/>

I had a requirement need to call apex class from workflow rules. If there is any possibilities please suggest
Hi All,

How to implement validation or trigger for name and date  field in salesforce

please share me idea or suggestion or sample code...

Thank you,
Hi, I wish to query the User Srorage Usage for specific user available on https://<Instatnce>.salesforce.com/setup/user/userstorageusage.jsp?id=UserID

Suggest me, how can I achieve this. 

Thanks,
Siva
Hi I am new in salesforce. I am trying to learn about triggers and update mu student fees in my custom project. My code is not giving any errors but also it is not update the Student_Payment__c. Can someone help me about this situation my code is like that.. 


trigger StudentFeeCalculation on Student_Record__c (before insert, after insert, after update, before update) {
    
    Decimal ScholarFee = 0;
    Fees__c newFees = new Fees__c();
    Student_Record__c Std = new Student_Record__c();
    
    //Calculating the sport scholarship of students
    
            if(Std.Scholarship__c == 'Sport Scholarship')
         {           
             // For computer engineering students
             if ( Std.Department__c == 'Computer Engineering')
             {       
                     List<Fees__c> SFee = new List<Fees__c>(); 
                    SFee =  [SELECT Fees__c.Department_Fees__c FROM Fees__c WHERE Fees__c.Name = 'Computer Engineering Fees'];
                     List<Student_Record__c> StdPayment = new List<Student_Record__c>();
                    StdPayment = [SELECT Student_Record__c.Student_Payment__c FROM Student_Record__c];
                
                 //Update fees for every student    
                 for(Student_Record__c stdPay: StdPayment)
                 {
                             ScholarFee = Integer.valueOf(SFee);
                             ScholarFee = ScholarFee * (25/100);                              
                             update StdPayment;
                 }         
               }   
             }     
           }
Hi all, 
I wrote an batch apex class, 
Till now i wrote 15 Test classes in my experience so that i am not able to create a test class to the bellow class in proper way, can any body explain me with the test class,  it gets healpfull to me to my practice,,,, Thanks in advance,, 

The class is: 
------------------------
global class batchAccountUpdate implements database.batchable<sObject>{
    
    global database.querylocator start(database.batchablecontext bc){
        string sql = 'select id,name from account';
        return database.getquerylocator(sql);
    }
    
    global void execute(database.batchablecontext bc, list<account> scope){
        list<account> lst = new list<account>();
        for(account a:scope){
            a.name = a.name+'updateddd';
        }
        update scope;
    }
    
    global void finish(database.batchablecontext bc){}
}
Hello All,
My requirment is to create a report on account, contact and activities. for daily report i need conatact name on the report.
is this posible to create a custom report on 3 diffrent objects in salesforce?


Thanks
bheem
I have a requirement where one of the user should not be alloowed to insert more than 100K opportunies however i am getting error when i am trying to accomplish the task with below code.

Error - Invalid Data.
Review all error messages below to correct your data.
Apex trigger OpportunityTrigger caused an unexpected exception, contact your administrator: OpportunityTrigger: execution of BeforeInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, OpportunityTrigger: maximum trigger depth exceeded Opportunity trigger event BeforeInsert for [new] Opportunity trigger event BeforeInsert for [new] Opportunity trigger event BeforeInsert for [new] Opportunity trigger event BeforeInsert for [new] Opportunity trigger event BeforeInsert for [new] O: []: Class.OpportunityTriggerHelperClass.isbeforeinsert: line 29, column 1
 
public class OpportunityTriggerHelperClass {
    
      Public Static Void isbeforeinsert(List<opportunity> OppList)
    {
     User CurrentUs =[Select name,username From User Where Username=:'kiranmarketing16-cltra@gmail.com']; 
String StruserName = CurrentUs.Username;
        List<Opportunity> InvalidOppList = New List<Opportunity>();
        List<Opportunity> validOppList = New List<Opportunity>();
        for(Opportunity Opp : OppList)
           {
              If(null!=StruserName && StruserName.equals('kiranmarketing16-cltra@gmail.com'))
              {
                               If(Opp.Amount > 1000)
                  {
                     InvalidOppList.add(new opportunity(Name=Opp.Name,CloseDate=Opp.CloseDate,
                                StageName=Opp.StageName, Amount=Opp.Amount) );
                      System.debug(InvalidoppList);
                      System.debug('This is true');
       Opp.Amount.addError('You have no previlages to add this opportunity because amount is greated that 100K');
                      }   
       validOppList.add(new opportunity(Name=Opp.Name,CloseDate=Opp.CloseDate,
                                        StageName=Opp.StageName, Amount=Opp.Amount));
            }
                  
             }  
               
      Insert ValidOpplist;

    }
  
}

 
Hi All,

I would like to query all SObject recrods owned by specific user, can you please guide me how can we do that?

My requirement:
We would like to deactivate the more Users in our org, hence instead of transfering the records for each user manually, require to implement through apex that all records will transfer from one User  to another on button click. any alternative suggestion would be appriciated..

Thanks
Sivasankar. 
Hello,

How can i achieve Module operand in Visualforce.

NUMBER % 2 == 0  //even
NUMBER % 2 == 1 //odd
Hi Experts,

I would like to schedule an apex class to run every 2 day ( even days 2,4,6,8... or odd days 1,3,5,7...), can any one help me to write cron expression for this. Please let me know in case if you required any more informaiton. I have alternative solution, but I would expecting direct cron expression for this.

Immidiate answers would be appriciated.

Thank you,
Sivasankar K.
Hi,
Is it possible to create a new detail record everyday of master record using Apex Schedular, as I am new to Apex please suggest me how can i do that?
how to create the new visual page in force.com ide??? getting error while creating new page 
Hi all,
i am not getting to write the test class for the following code can any one help me?

global class Wct_OfferPendingforAnalyst implements Database.Batchable<sObject>,Schedulable{

    global void execute(SchedulableContext SC) {
        Wct_OfferApproval_ConsolidatedEmail batch = new Wct_OfferApproval_ConsolidatedEmail();
        ID batchprocessid = Database.executeBatch(batch,100); 
    }
    
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        String query = 'SELECT Id,Name,Owner.Email,WCT_Candidate_Email__c,WCT_RMS_ID__c,WCT_Full_Name__c,WCT_status__c,WCT_AgentState_Time__c FROM WCT_Offer__c where WCT_status__c IN (\'Offer to Be Extended\', \'Draft in Progress\', \'Returned for Revisions\') and owner.email IN (\'kvalakonda@deloitte.com\',\'rpiramanayagam@deloitte.com\') and WCT_AgentState_Time__c != null '; //owner.email != null'
        return Database.getQueryLocator(query);
    }

    global void execute(Database.BatchableContext BC, List<WCT_Offer__c> listofferRecords)
    {
        set<string> setRecEmails = new set<string>();
        map<string,string> RecTeamEmails = new map<string,string>();
        Map<String, List<WCT_Offer__c>> recOffers = new Map<String, List<WCT_Offer__c>>(); 
        Decimal seconds;
        Decimal hrs;
        
        for(WCT_Offer__c offerRecord : listofferRecords) {
             seconds = BusinessHours.diff(Label.WCT_Default_Business_Hours_ID, offerRecord.WCT_AgentState_Time__c, System.now())/ 1000;
             hrs = seconds / 3600;
             if(hrs > 4) {
                setRecEmails.add(offerRecord.Owner.Email);
                List<WCT_Offer__c> offerList = recOffers.get(offerRecord.Owner.Email);
                if(offerList == null) {
                    offerList = new List<WCT_Offer__c>();
                } 
                offerList.add(offerRecord);
                recOffers.put(offerRecord.Owner.Email,offerList);
            }
        }
        
        String strEmailTop ='';
        String strEmailBody ='';
        String strEmailBottom ='';
        
        strEmailTop  += '<!DOCTYPE html>';
        strEmailTop  += '<html> <head> <style>';
        strEmailTop  += 'table,th,td';
        strEmailTop  += '{ border: 1px solid black; border-collapse:collapse; }, th,td';
        strEmailTop  += ' { padding:5px; }';
        strEmailTop  += '</style> </head> <body> <br> Dear Recruiter,<br> <br>';
        strEmailTop  += 'Offer Letter(s) are pending for more than 4 Hours.<br> <br> <br> <table> <thead>';
        strEmailTop  += ' <tr> <th>Offer Name</th> <th>Candidate Name</th> <th>RMS ID</th> <th>Candidate Email</th> <th>Status</th> <th>Offer letter link</th>';
        strEmailTop  += '</tr> </thead> <tbody>';
        
        strEmailBottom += '</tbody> </table> <br> Thank you,<br> Deloitte Recruting.<br> </body> </html>';
        
        for(string strRecEmail: recOffers.keyset()) {
            strEmailBody ='';
            for(WCT_Offer__c offerRecord : recOffers.get(strRecEmail)) {
            
                    strEmailBody += '<tr> <td>'+offerRecord.Name+'</td> <td>'+offerRecord.WCT_full_Name__c+'</td><td>'+offerRecord.WCT_RMS_ID__c+'</td><td>'+offerRecord.WCT_Candidate_Email__c+'</td>';
                    strEmailBody += '<td>'+offerRecord.WCT_status__c+'</td><td><a href='+Label.BaseURL+'/'+offerRecord.id+'>URL</a></td></tr>';
            }
            
            list<string> ToEmailAddress = new list<string>();
            
            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            ToEmailAddress.add(strRecEmail);
            mail.settoAddresses(ToEmailAddress);
            mail.setSubject('Immediate Action: Offer Letter(s) are pending');
            mail.setHTMLBody(strEmailTop+strEmailBody+strEmailBottom);
            mail.setSaveAsActivity(false);
            if(ToEmailAddress != null){
                Messaging.sendEmail(new Messaging.SingleEmailMessage [] {mail});
            }
        }
    }

    global void finish(Database.BatchableContext BC){
      
    }
}
Hi all,

I need to insert a values into record type field from Apex code. I saw the data type  as (Record Type). How should i insert Into Record Type filed.
Hi Friends,

Here is my issue. Please advise me or help me.
I am having a field called Id_Generator__c which is autonumber field under object named custom_account__c. Now I have to write a trigger that will take this autonumber field and encrypt that field and then it has to send that encrypted value to the document I am sending out for signature(esignature) and then after signature the trigger has to get the key and decrypt that and have to store that value. Please let me know if you guys have any idea.

Thanks,