For audting purposes, i need to create a report that will show me how many times a particular cost center was used in since the beginning of last year(2011) in G/L Entry.
G/L Entry - OnPreDateItem
ReferenceDate := 010111D;
G/L Entry - OnAfterGetRecord
"G/L Entry".SETFILTER("Posting Date", '%1..%2',ReferenceDate,TODAY);
G/L Entry, Body - OnPreSection
IF "G/L Entry".FINDSET THEN REPEAT
// IF
//CurrReport.SHOWOUTPUT(FALSE);
UNTIL "G/L Entry".next =0;
How can i filter on it so it only shows a particular cost center code once, rather than every time it shows up in the G/L Entry.
Answers
What do you need? First you say you need to count how many times a cost center is used, then you ask how to show unique cost centers.
Again, you need to think about this analytically. Instead of looping through the G/L Entry table, loop through the cost centers and filter the G/L Entry for each one. Count as you go along.
You need some figuring out skills, don't you have a senior that can help you?
RIS Plus, LLC
There are thousands of lines in G/L Entry table, so some of the them have the exact same cost center code.
Rather then displaying the same cost center code over and over again. I just want to display how many times a particular Cost Center Code was used/assigned.
I am just not sure how I can filter this to display that Cost Center once in the report and right beside that, it should display how many times it appeared.
You're working on a report, so you have to figure out a way to do this in a different way. My suggestion is to loop through the Cost Center table, and filter the G/L Entry for each record, and only show the ones that have details to show.
Look I'm not trying to make things difficult for you, but you are asking the forum to do the work for you. You've been told to study the DEV training materials many times, and still you are asking questions that are covered in those training courses. You need the help of a senior person to show you these basic skills, this forum is simply not the right place to build those skills.
RIS Plus, LLC
I have read the introduction book numerous times. But, I feel that you get good at something with practice/experience. Some of the Users here have years of experience and I have like 3-4 months of experience. Its not like I am lazy or anything, I am still in the learning phase . I will try not to ask too many questions.
Did you do the exercises? If you weren't able to do the exercises, did you get help from a senior?
RIS Plus, LLC
Good first step, but as a final solution that's not good at all.
Don't use FINDSET, use ISEMPTY. You don't need to actually loop through the G/L Entry records, all you need to know is whether records exist, like this: You could also add a G/L Entry dataitem, link it through the cost center code, and turn on the cost center dataitem's PrintOnlyIfDetail property, and you wouldn't need to add any programming at all.
RIS Plus, LLC
I have never used...isempty ( i will read about it...and then give it a shot).