• Louisa Pidcock 11
  • NEWBIE
  • 30 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 11
    Replies
Hi Guys 

I am deploying a project at the moment and am completely flommuxed as to why my VF pop up alert ( is triggred by workflow that populates a text area, then the VF pop up displays the contents of that field)

It works perfectly in the sandbox but not in prod... I have ensured i have access to the VF page on my profile and the workflow is behnaving as expected and I have not amended the VF code since deploymet from sandbox - anyone got any ideas?? 

here is my VF Page:

<apex:page standardController="Counterparty__c">
  <script type="text/javascript">

           window.onload=function(){

                 var alertMessage = "{!Counterparty__c.Alert_Message__c}";

                    if( alertMessage != null && alertMessage !='')

                      alert( alertMessage );

}
</script>
</apex:page>
...just trying to understand if its even possible at this stage as I am super new to coding.... any thoughts greatly welcomed 
Hi Guys 

I am very very new to coding of any kind so please forgive me/ thank you in advance.

Custom Object:  Buyer_Conact__c

I have a workflow rule that updates the due date if it falls on a weekend day. As 'Day__c'  is derived via DATE() function in a formula thisrule only kicks in if the record it edited, which falls short of what is required. 

I have added a checkbox called Weekend_Date_Handler__c which I would like to check after insert (as this will trigger the workflow) 


I am attempting to refactor a piece of code I sucessfully created (you guys then helped me with the test class) for a different purpose and am not getting very far at all. My what I want is for the code to look at any buyer_contact__c records that have Weekend_Date_Handler__c= False and update them to Weekend_Date_Handler__c = True 

Here is what I have written so far. Any guidance here is massively appreciated !


trigger weekendUpdate on Buyer_Contact__c (after insert, after update) {
    
    List<Id> lstId = new List<Id>();    
    
    for(Buyer_Contact__c buyerConTwo: Trigger.new){
        
        List<Buyer_Contact__c> buyerConTwoList = [SELECT Id,Weekend_Date_Handler__c,  FROM Buyer_Contact__c WHERE Weekend_Date_Handler__c = FALSE] ;
        
        buyerConTwo.Weekend_Date_Handler__c= TRUE
        
        update buyerConTwoList;
    }
}



 
Hi Guys 

I have just started to try and learn how to code and have sucessfully managed  my get the trigger to work  as expected.   However I am really struggling with  the test class.. I just cant seem to get my head around it. 
Logic - We have a custom object called Buyer_Contact__c. on which there is a checkbox field called 'Inacte KPI' which is populate dunder certain conditions. I would like to delete any records that have this box cheks after update.  

Below is the working  trigger :

trigger InactiveKPIdelete on Buyer_Contact__c (after update) {

 List<Id> lstId = new List<Id>();    
    
    for(Buyer_Contact__c buyerCon: Trigger.old){
        
        List<Buyer_Contact__c> buyerConList = [SELECT Id FROM Buyer_Contact__c WHERE Inactive_KPI__c = TRUE] ;
        
        delete buyerConList;
    }
}


Here is my attempt at a test class (try not to laugh) 

@isTest 
private class InactivekpiTest {
    static testMethod void InactiveKPIdelete() {
      Buyer_Contact__c bcon = new Buyer_Contact__c (Inactive_kpi__c = true) ;
 
 
       // Insert buyer contact
       insert bcon;
 
   
    }
}



Can anyone guide me please as my trigger is at 0% coverage lol 

Many thanks in advance for any help you can give me ! 
Hi Guys 

I am deploying a project at the moment and am completely flommuxed as to why my VF pop up alert ( is triggred by workflow that populates a text area, then the VF pop up displays the contents of that field)

It works perfectly in the sandbox but not in prod... I have ensured i have access to the VF page on my profile and the workflow is behnaving as expected and I have not amended the VF code since deploymet from sandbox - anyone got any ideas?? 

here is my VF Page:

<apex:page standardController="Counterparty__c">
  <script type="text/javascript">

           window.onload=function(){

                 var alertMessage = "{!Counterparty__c.Alert_Message__c}";

                    if( alertMessage != null && alertMessage !='')

                      alert( alertMessage );

}
</script>
</apex:page>
...just trying to understand if its even possible at this stage as I am super new to coding.... any thoughts greatly welcomed 
Hi Guys 

I am very very new to coding of any kind so please forgive me/ thank you in advance.

Custom Object:  Buyer_Conact__c

I have a workflow rule that updates the due date if it falls on a weekend day. As 'Day__c'  is derived via DATE() function in a formula thisrule only kicks in if the record it edited, which falls short of what is required. 

I have added a checkbox called Weekend_Date_Handler__c which I would like to check after insert (as this will trigger the workflow) 


I am attempting to refactor a piece of code I sucessfully created (you guys then helped me with the test class) for a different purpose and am not getting very far at all. My what I want is for the code to look at any buyer_contact__c records that have Weekend_Date_Handler__c= False and update them to Weekend_Date_Handler__c = True 

Here is what I have written so far. Any guidance here is massively appreciated !


trigger weekendUpdate on Buyer_Contact__c (after insert, after update) {
    
    List<Id> lstId = new List<Id>();    
    
    for(Buyer_Contact__c buyerConTwo: Trigger.new){
        
        List<Buyer_Contact__c> buyerConTwoList = [SELECT Id,Weekend_Date_Handler__c,  FROM Buyer_Contact__c WHERE Weekend_Date_Handler__c = FALSE] ;
        
        buyerConTwo.Weekend_Date_Handler__c= TRUE
        
        update buyerConTwoList;
    }
}



 
Hi Guys 

I have just started to try and learn how to code and have sucessfully managed  my get the trigger to work  as expected.   However I am really struggling with  the test class.. I just cant seem to get my head around it. 
Logic - We have a custom object called Buyer_Contact__c. on which there is a checkbox field called 'Inacte KPI' which is populate dunder certain conditions. I would like to delete any records that have this box cheks after update.  

Below is the working  trigger :

trigger InactiveKPIdelete on Buyer_Contact__c (after update) {

 List<Id> lstId = new List<Id>();    
    
    for(Buyer_Contact__c buyerCon: Trigger.old){
        
        List<Buyer_Contact__c> buyerConList = [SELECT Id FROM Buyer_Contact__c WHERE Inactive_KPI__c = TRUE] ;
        
        delete buyerConList;
    }
}


Here is my attempt at a test class (try not to laugh) 

@isTest 
private class InactivekpiTest {
    static testMethod void InactiveKPIdelete() {
      Buyer_Contact__c bcon = new Buyer_Contact__c (Inactive_kpi__c = true) ;
 
 
       // Insert buyer contact
       insert bcon;
 
   
    }
}



Can anyone guide me please as my trigger is at 0% coverage lol 

Many thanks in advance for any help you can give me !