• Tavant Technologies
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 14
    Replies
Hi,

I have a button in a visualforcepage which is an inline visualforce page embedded in a standard page layout.

On the button click i just want to refresh the visualforce page not the entire standard page.

How can i do it.

Thanks,
I have developed one class which runs on REST webservice and called batch apex for more than 10000 records deletions for the same.
Right now its showing error while fetching query by parameter.
Could you please help on this?  any suggestions?

Apex class:

@RestResource(urlMapping='/PurgeMonitorLog/*')
global with sharing class PurgeMonitorlogRestService {
    @HttpPost
    global static Boolean deleteMonitorLogEntries(String lastExtractedTimeUTC) {
        Boolean isDeleted=false;
        try{
            
            if(lastExtractedTimeUTC == NULL || lastExtractedTimeUTC == ''){
                System.debug('Passed time is Null or empty, Purge process cant proceed: '+lastExtractedTimeUTC);
                return isDeleted;
            }
            
            String[] timeArray=lastExtractedTimeUTC.split('T');
            String transformedTime=timeArray[0]+' '+timeArray[1];
          
            DateTime dtLET_UTC=DateTime.valueOfGmt(transformedTime);
            System.debug('Get all records before time (in UTC):'+dtLET_UTC);
            
            
            String Query;
            Query = 'select id from monitorlog__c where lastmodifieddate < :'+dtLET_UTC;
            
            database.executebatch(new  DeleteMonitorlogBatchClass(Query));
    
   
        }catch (Exception ex){
            System.debug(Logginglevel.ERROR, 'deleteMonitorLogEntries: Exception while deleting MonitorLog Records due to: ' + ex.getMessage());
            MonitorUtility.insertHandledExceptions(ex, null, 'MonitorLog', 'PurgeMonitorlogRestService','PurgeMonitorLog','GSD','Monitoring',System.now());
        }  
        System.debug('returned val:'+isDeleted);
        return isDeleted;
    }
    
}

Batch Apex:

global class DeleteMonitorlogBatchClass implements Database.Batchable{

    global final string Query;
    
    global DeleteMonitorlogBatchClass(String q){
        Query = q;
    }

    global Database.QueryLocator start(Database.BatchableContext BC){
        return Database.getQueryLocator(Query);
    }

    global void execute(Database.BatchableContext BC, List scope){
        List monitorObjList = new List();
        for(monitorlog__c Mon : scope){
            monitorlog__c MonInst = (monitorlog__c)Mon;
            monitorObjList.add(MonInst);
        }
        
        if(!monitorObjList.isEmpty()){
            Database.delete(monitorObjList, false);
            Database.emptyRecycleBin(monitorObjList); 
        }
    }

    global void finish(Database.BatchableContext BC){
                    
    }
}


ERROR :

34.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
01:20:01.027 (27069598)|EXECUTION_STARTED
01:20:01.027 (27099942)|CODE_UNIT_STARTED|[EXTERNAL]|01pq0000000Eg40|DeleteMonitorlogBatchClass
01:20:01.050 (50255196)|METHOD_ENTRY|[1]|01pq0000000Eg40|DeleteMonitorlogBatchClass.DeleteMonitorlogBatchClass()
01:20:01.050 (50270556)|METHOD_EXIT|[1]|DeleteMonitorlogBatchClass
01:20:01.050 (50398704)|SYSTEM_METHOD_ENTRY|[10]|Database.getQueryLocator(String)
01:20:01.050 (50635038)|EXCEPTION_THROWN|[10]|System.QueryException: unexpected token: '2015-06-23'
01:20:01.050 (50709933)|SYSTEM_METHOD_EXIT|[10]|Database.getQueryLocator(String)
01:20:01.050 (50762663)|FATAL_ERROR|System.QueryException: unexpected token: '2015-06-23'

Class.DeleteMonitorlogBatchClass.start: line 10, column 1
When we login into our salesforce edition one cloud image and salesforce.com mentioned in window tabs. How to override that image.
Thanks in Advance.
I have two custom objects [access.log & trans.log] who receive daily updates [New Records] from an external system. After 31 days we don't need them anymore and we would like to delete them. Both objects have a date field on the record 'Log_date__c'.

I know that you can make a job that deletes these records on a daily basis.

My question;

- How do I write a code that deletes the right records? (Log_date__c older than 31 days)
- How/where do I put in SFDC? (Apex Class or Trigger! - Both!)

Are there any who can help me progress. In which case it will be my first code in SFDC.
How to write the test class for the trigger to automate salesforce to salesforce connection via apex-

here's the trigger
 
trigger OrgCaseSync on Case (after insert, after update) {

PartnerNetworkConnection conn = [select Id, ConnectionStatus, ConnectionName from PartnerNetworkConnection  where ConnectionStatus = 'Accepted'];
        List<PartnerNetworkRecordConnection> recordConnectionToInsert  = new List<PartnerNetworkRecordConnection>  ();
        for (Case cc : Trigger.new){
            PartnerNetworkRecordConnection newrecord = new PartnerNetworkRecordConnection();

            newrecord.ConnectionId = conn.Id;
            newrecord.LocalRecordId = cc.id;  
            newrecord.SendClosedTasks = false;
            newrecord.SendOpenTasks = false;
            newrecord.SendEmails = false;
            recordConnectionToInsert.add(newrecord);
        }
        if (recordConnectionToInsert.size() > 0){
            System.debug('>>> Sharing ' + recordConnectionToInsert.size() + ' records');
            insert recordConnectionToInsert;
        }

 
hi
i have grid in a custom vf page with pagination. i need to print all data of all pages on button click in page. how could it be done ?
System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
Currenlty we have an app deployed in the production org. we want to install same app in the same org as a managed package. can we do that while keeping existing data
  • May 21, 2015
  • Like
  • 0
I'm trying to calculate a value on a visual force page based on an onChange event on a field but the input type id='answer' is not showing on the page. 
Any ideas on what I'm missing ?


<script>
function checkNumbers(ele, classname) {
    var value = document.getElementsByClassName(classname);
    
    var val1 = parseInt(document.getElementById("value1").value);
    var val2 = parseInt(document.getElementById("value2").value);
    var tot = val1 + val2;
    var ansD = document.getElementById("answer");
    ansD.value = val1 + val2;
    document.getElementById(“answer”).innerHTML=tot;

    if (tot < 100) {
    value.ansD.value = " Percent Radius of operations not equal to 100." 
    } else {
    value.ansD.value = " Percent Radius of operations equal to 100."  
    }
    }
</script>


<apex:inputField value="{!Comm_Auto_Audit_Sample_Policy__c.Percent_Long_Haul__c}"  style="color:blue;" id="value1" onchange="checkNumbers(this, 'sel1')" rendered="{!CONTAINS(Comm_Auto_Audit_Sample_Policy__c.Radius_of_Operations__c,'Long-Haul') && (RadiusOfOperations)}"  >
    <apex:actionSupport event="onchange" reRender="longhaul" />
    </apex:inputField>


<!-- <apex:outputPanel id="longhaul"> -->
<apex:inputField value="{!Comm_Auto_Audit_Sample_Policy__c.Percent_Long_HaulX__c}" id="longhaul" style="color:green;" rendered="{!CONTAINS(Comm_Auto_Audit_Sample_Policy__c.Radius_of_Operations__c,'Long-Haul') && (RadiusOfOperations)}"  />
<!-- </apex:outputPanel>  --> 


Answer = <input type="text" id="answer" name="answer" value=""/>
Hello,

I need help, my Email to Case id is not populating for some reason.

I have created a new routing address with case origin as "Email SPH", but for some reason the in the created case, the Email to Case ID field is blank.

See Attached.User-added image
I have two custom objects [access.log & trans.log] who receive daily updates [New Records] from an external system. After 31 days we don't need them anymore and we would like to delete them. Both objects have a date field on the record 'Log_date__c'.

I know that you can make a job that deletes these records on a daily basis.

My question;

- How do I write a code that deletes the right records? (Log_date__c older than 31 days)
- How/where do I put in SFDC? (Apex Class or Trigger! - Both!)

Are there any who can help me progress. In which case it will be my first code in SFDC.