• Sudheera Lakmal
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 7
    Replies
Hello,
I have a batch Apex class that needs to be scheduled for every 15 minutes. I created below script and executed in Developer Console in sandbox environment. But I'm in doubt whether I can use the developer console in production to schedule this batch class as I don't have the Admin rights in Production Org. Can somebody has the experience Please confirm that whether we can use the Developer console in production to schedule the batch jobs? or If I cannot use developer console in production what are the other options available?

System.schedule('ScheduleInsertClaimInventoryManualAssign1','0 0 * * * ?' , new ScheduleInsertClaimInventoryManualAssign());
System.schedule('ScheduleInsertClaimInventoryManualAssign2','0 15 * * * ?' , new ScheduleInsertClaimInventoryManualAssign());
System.schedule('ScheduleInsertClaimInventoryManualAssign3','0 30 * * * ?' , new ScheduleInsertClaimInventoryManualAssign());
System.schedule('ScheduleInsertClaimInventoryManualAssign4','0 45 * * * ?' , new ScheduleInsertClaimInventoryManualAssign());

Thanks...!

Regards,
Sudheera Lakmal 
Hello,

I have a Approval Process in one of custom objects, when Approve the process it will refreshes the current page plus open a new window which loading the home page. Problem is user is redirected to the new window and our business users want to avoid that new window as it is distracting the flow. Reject button is behaving OK as it refreshes the current window only when click Reject button. 
Does anybody has idea how to avoid this new window?

Approve Button
Hello,

I have a Approval Process for one of custm objects, and everytime when Approve the process it refresh the current window plus open a new window. Problem is user will be redirected to the new window that loads the home page. Our business users want to avoid this new window as it distracts the main scenario. Reject button behave OK as it refreshes the current window only. I thoroughly examined the approval process but struggling to find a way to stop the new window.
Does anybody has idea how to avoid this new window?

Approve Button
I have a list button to delete all the records in a particular related list. The Deletion portion of the JacaScript is below.

  User-added image

However, when I click the Delete button I recieve below error.

User-added image

Later I noticed that related list contain around 600 records. Based on the error message It seems that we can send only 200 records for the deletion method at once. Only solution I can think about is to send the IDs with 200 batches to the sforce.connection.deleteIds() method, which is certainly our business users don't want to have.
Does anybody have different approaches to address this issue?
Hello,
I'm a newbie to Salesforce and I tried to install the Force.com IDE by following the steps in the "Force.com IDE Installation" page. (https://developer.salesforce.com/page/Force.com_IDE_Installation)

In the Add Repository window, I added the Name: as "Force.com IDE" and Location: as http://media.developerforce.com/force-ide/eclipse42 as mentioned in the documentation. However after click OK Button, there is a window popping up asking the credentials. I tried with my Salesforce Developer Edition and Sandbox credentials, but still no luck. So, which credentials should I enter here?
Add Repository
Login Required

I tried with the Juno 4.2 and Kepler 4.3, but in both cases it keeps on asking the credentials. I have already installed the JDK 7 also.
Could anybody in this forum help me to solve this problem,

Thanks,

Regards,
Sudheera
Hello,

I have a Approval Process in one of custom objects, when Approve the process it will refreshes the current page plus open a new window which loading the home page. Problem is user is redirected to the new window and our business users want to avoid that new window as it is distracting the flow. Reject button is behaving OK as it refreshes the current window only when click Reject button. 
Does anybody has idea how to avoid this new window?

Approve Button
I have a Visualforce page that prints in pdf format.  I want the barcode, which is generated by a third party site, to display in the pdf when I print it.  How can I do this? 

I have two fields in my Salesforce custom object page - one named Barcode__c for a string and one named Barcode_View__c with a formula as follows (which works fine):
IMAGE("//www.barcodesinc.com/generator/image.php?code="&Barcode__c&"&style=325&type=C128B&width=200&height=50&xres=1&font=3",Barcode__c)

In my Visualforce page, I've tried the following four codes, all of which display either a URL or a broken link, but not the barcode itself.  How do I get the barcode to appear in the pdf?
  
 1) This displays the URL  <apex:outputText value="{!RMAShpipmentHeader.Barcode_View__c}"> </apex:outputText>

 2) This displays a broken link <apex:image value="{!URLFOR('http://www.barcodesinc.com/generator/image.php',null,[code='{!RMAShpipmentHeader.Barcode__c}', style=325,type='C128B', width=200, height=50, xres=1, font=3])}" />   
   
3) This displays a broken link  <apex:image value="http://www.barcodesinc.com/generator/image.php?code={!RMAShpipmentHeader.Barcode__c}%26style=325%26‌​type=C128B%26width=200‌​%26height=50%26xres=1%26fo‌​nt=3" />
   
 4) This displays the URL  IMAGE("//www.barcodesinc.com/generator/image.php?code={!RMAShpipmentHeader.Barcode__c}"&"&style=325&type=C128B&width=200&height=50&xres=1&font=3","{!RMAShpipmentHeader.Barcode__c}")

Thanks,
Dawn
Hello,
I have a batch Apex class that needs to be scheduled for every 15 minutes. I created below script and executed in Developer Console in sandbox environment. But I'm in doubt whether I can use the developer console in production to schedule this batch class as I don't have the Admin rights in Production Org. Can somebody has the experience Please confirm that whether we can use the Developer console in production to schedule the batch jobs? or If I cannot use developer console in production what are the other options available?

System.schedule('ScheduleInsertClaimInventoryManualAssign1','0 0 * * * ?' , new ScheduleInsertClaimInventoryManualAssign());
System.schedule('ScheduleInsertClaimInventoryManualAssign2','0 15 * * * ?' , new ScheduleInsertClaimInventoryManualAssign());
System.schedule('ScheduleInsertClaimInventoryManualAssign3','0 30 * * * ?' , new ScheduleInsertClaimInventoryManualAssign());
System.schedule('ScheduleInsertClaimInventoryManualAssign4','0 45 * * * ?' , new ScheduleInsertClaimInventoryManualAssign());

Thanks...!

Regards,
Sudheera Lakmal 
Hi Everyone,

I have a Button(Send__c) and a pick list field(Status__c) with values New, Modified, Submitted and Synced.

1.On click of Button the Status should be set to submitted.
2. Button should be only active if the status is New or Modified else it should be inactive/grayed out.

Can someone pls help me with this requirement?

Thanks!!
I have a list button to delete all the records in a particular related list. The Deletion portion of the JacaScript is below.

  User-added image

However, when I click the Delete button I recieve below error.

User-added image

Later I noticed that related list contain around 600 records. Based on the error message It seems that we can send only 200 records for the deletion method at once. Only solution I can think about is to send the IDs with 200 batches to the sforce.connection.deleteIds() method, which is certainly our business users don't want to have.
Does anybody have different approaches to address this issue?
Hello,
I'm a newbie to Salesforce and I tried to install the Force.com IDE by following the steps in the "Force.com IDE Installation" page. (https://developer.salesforce.com/page/Force.com_IDE_Installation)

In the Add Repository window, I added the Name: as "Force.com IDE" and Location: as http://media.developerforce.com/force-ide/eclipse42 as mentioned in the documentation. However after click OK Button, there is a window popping up asking the credentials. I tried with my Salesforce Developer Edition and Sandbox credentials, but still no luck. So, which credentials should I enter here?
Add Repository
Login Required

I tried with the Juno 4.2 and Kepler 4.3, but in both cases it keeps on asking the credentials. I have already installed the JDK 7 also.
Could anybody in this forum help me to solve this problem,

Thanks,

Regards,
Sudheera
I have developed below code fro cloning but unfortunately because of unique field i am getting error of duplication.

here one text field set to unique.

Apex class: 

public class GSDPartnerCloneWithSkillsController {

    public ApexPages.StandardController controller {get; set;}
    public GSD_Partner__c GSDP {get;set;}
    public ID newRecordId {get;set;}
    public Id OldGSDResourceId {get;set;}
    public Id NewGSDResourceId {get;set;}

    
    public GSDPartnerCloneWithSkillsController(ApexPages.StandardController controller) {

        this.controller = controller;
        GSDP = (GSD_Partner__c)controller.getRecord();

    }
    
    public PageReference cloneWithItems() {

         Savepoint sp = Database.setSavepoint();
         GSD_Partner__c newGSDP;

         try {
         
             GSDP = (GSD_Partner__c) GSDDataUtility.getObject('GSD_Partner__c', GSDP.id);
             
             newGSDP = GSDP.clone(false);
             insert newGSDP;

            
             newRecordId = newGSDP.id;
           
           
             GSD_Resource__c OldGSDResource = [select id from  GSD_Resource__c where Partner__c = :GSDP.id limit 1];
             OldGSDResourceId = OldGSDResource.id;
             system.debug('OldGSDResourceId :'+OldGSDResourceId );
             
             GSD_Resource__c NewGSDResource = [select id from  GSD_Resource__c where Partner__c = :newRecordId  limit 1];
             NewGSDResourceId = NewGSDResource.id;
             system.debug('NewGSDResourceId :'+NewGSDResourceId);
             
             CLoneGSDResourceLang();
             CLoneGSDResourceNon();
             CLoneGSDResourcePPS();
             CLoneGSDResourcePMaster();
             CLoneGSDResourceServices();
             CLoneGSDResourceTech();

         } catch (Exception e){
            Database.rollback(sp);
            ApexPages.addMessages(e);
            return null;
         }

        return new PageReference('/'+newGSDP.id+'/e?retURL=%2F'+newGSDP.id);
    }
    
    public void CLoneGSDResourceLang(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [select id,Skill_Name__c,Skill_Category__c,Standard__c,Stand_By__c,Non_Product_Skill_Level__c,Web_App_Resp_Created_Dt__c,Web_App_Resp_Modified_Dt__c,Responsibility_Skill_Level__c,Web_App_Employee_Id__c,Web_App_ID__c,Web_App_Skill_Id__c from GSD_Resource_Skills_mapping__c where Skill_Category__c = :Label.GSDResourceLang and Resource_ID__c = :OldGSDResourceId];  
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourceNon(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [select id,Skill_Name__c,Skill_Category__c,Standard__c,Stand_By__c,Non_Product_Skill_Level__c,Web_App_Resp_Created_Dt__c,Web_App_Resp_Modified_Dt__c,Responsibility_Skill_Level__c,Web_App_Employee_Id__c,Web_App_ID__c,Web_App_Skill_Id__c from GSD_Resource_Skills_mapping__c where Skill_Category__c = :Label.GSDResourceNon and Resource_ID__c = :OldGSDResourceId];  
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourcePPS(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [select id,Skill_Name__c,Skill_Category__c,Standard__c,Stand_By__c,Non_Product_Skill_Level__c,Web_App_Resp_Created_Dt__c,Web_App_Resp_Modified_Dt__c,Responsibility_Skill_Level__c,Web_App_Employee_Id__c,Web_App_ID__c,Web_App_Skill_Id__c from GSD_Resource_Skills_mapping__c where Skill_Category__c = :Label.GSDResourcePPS and Resource_ID__c = :OldGSDResourceId];  
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourcePMaster(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [SELECT Id, Name, Skill_Name__r.Name, Responsibility_Skill_Level__c, Skill_Name__r.Product_Description__c, Skill_Name__r.Portfolio__c FROM GSD_Resource_Skills_mapping__c WHERE Resource_ID__c = :OldGSDResourceId AND Skill_Category__c =: Label.GSDResourcePMaster ];
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourceServices(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [SELECT Id, Name, Skill_Name__r.Name, Responsibility_Skill_Level__c, Skill_Name__r.Product_Description__c, Skill_Name__r.Portfolio__c, Skill_Name__r.Support_Activity__c,Standard__c, Stand_By__c FROM GSD_Resource_Skills_mapping__c WHERE Resource_ID__c = :OldGSDResourceId AND Skill_Category__c ='Services' ];
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourceTech(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [SELECT Id, Name, Responsibility_Skill_Level__c, Skill_Name__r.Name, Skill_Name__r.Technologies_Name__c FROM GSD_Resource_Skills_mapping__c WHERE Resource_ID__c =:OldGSDResourceId  AND Skill_Category__c =: Label.GSDResourceTech ];
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
}

apex class:

public class GSDDataUtility {
    public static sObject getObject(string objName, string id) {
 
        String fieldnames = '';
        sObject obj;
        try {
            Map < String, Schema.SObjectType > m = Schema.getGlobalDescribe();
            Schema.SObjectType s = m.get(objName);
            Schema.DescribeSObjectResult r = s.getDescribe();
 
        
            Map < String, Schema.SObjectField > fields = r.fields.getMap();
            for (string field: fields.keySet()) {
                if (fieldnames == '') {
                    fieldnames = field;
                } else {
                    fieldnames += ',' + field;
                }
            }
 
            
            String sql = 'SELECT ' + fieldnames + ' FROM ' + objName + ' WHERE Id=\'' + id + '\'';
            System.debug(sql);
            obj = database.query(sql);
 
        } catch (Exception e) {
            System.debug('get Fields Error' + e.getMessage());
            ApexPages.addMessages(e);
            return null;
        }
        return obj;
    }
}