• kj Smith
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
I have a object called Incident__c and a custom field called Notes__c (Long Text Area).

Whenever a New Note is added to a Incident__c record, I want to populate Notes__c field with Note body.

If there are several Notes added to the Incident__c record, Notes__c field should be appended with each Note bodies.

Once a Note body is updates Note__c field should also be updated accordingly.

I'm currently struggling to make progress on this as i'm new to this scenario! How can I do this ?
I am displaying a vf report for each of object records created for the Report__c object(vf button on each report to generate the report), and I need to display a incrementing counter in front of each object record name in each report generated. Following is my controller and the vf page, currently my counter does not increment depending on the new reports created, any help on this is appreciated! or is there any other good way of doing this ?

Apex Controller-------------------
public with sharing class PDFGeneratorController { public Report__c report {get; set;}
public Id reportId; Integer counter = 0;

public PDFGeneratorController(ApexPages.StandardController controller) {
reportId = controller.getRecord().Id;
report = [SELECT Id, Name, Actions__c, C_Status__c, Status_Reason__c, Status__c, Status_Indicator__c, Reason__c, Notes__c, for_Next_Week__c, Project__r.Name, Summary__c, S_Status__c, S_Reason__c, Week_Ending__c, Counter__c FROM Report__c WHERE Id =: reportId LIMIT 1];

//Counter__c is a number field created on the object(don't know if this logic is right)
if(report.Counter__c != null)
counter = integer.valueOf(report.Counter__c);
}

public void incrementCounter() {
counter++;
report = [Select id, Name from Report__c ]; report.Counter__c = counter;
update report;
}

public Integer getCount() {
return counter;
  }
}

VF Page--------- Counter should be displayed in the header with the report name as follows
<apex:sectionHeader title ="Weekly Report :{!Report__c.Name} {!count}"/>


 
I have a object called Incident__c and a custom field called Notes__c (Long Text Area).

Whenever a New Note is added to a Incident__c record, I want to populate Notes__c field with Note body.

If there are several Notes added to the Incident__c record, Notes__c field should be appended with each Note bodies.

Once a Note body is updates Note__c field should also be updated accordingly.

I'm currently struggling to make progress on this as i'm new to this scenario! How can I do this ?