Hello. I did search the forum for this subject, but did not find anything relating specifically to my question.
We have the Calendar Views granule and have built some custom calendar views to help with managing Jobs - specifically showing total job qty ordered per day per month. clicking the day on this form (which i believe we got from Cost Control) opens another form that shows the Jobs that make up that qty. This form is called against a MARK(TRUE) recordset because i have had to go backwards from the job specific router to the job for the view to show certain types of work that needs to be done.
This all works fine.
Now, I have a user request that at the bottom of this list form, there should be a field showing the Job Remaining Qty (what still needs to be produced on this list). When i attempt to call code to loop through the records shown in the list and sum the job remaining qty, it does not seem to be working with the same MARKed recordset. When i put code in the OnAfterGetRecord or OnAfterGetCurrRecord triggers to sum this value, I find that it keeps adding to the variable as I scroll through the list.
Any tips for how to accomplish this? Maybe I just need a push toward the right trigger to call this from.
bottom line, i have a form opening that contains a tablebox. This tablebox includes prefiltered (Marked) records from the job table. how can I sum the job remaining qty for all records in the list?
Thanks!
kind of fell into this...
0
Answers
This function you can put in the SourceExpression of your total-field like this "CalculateTotals(rec)".
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
this is essentially what i was doing before, but more elegant in that you are calling the function from the control (and i was trying to call it from triggers). unfortunately, it still does not seem to work. it appears that the qty is not just those in the data set shown on the form.
here is what i am doing:
there is the Calendar View form, and i have added a view for Bagging Job Qty by End Date. There is C/AL that looks at Job Specific Router table for a Step Resource No. = Bagging. It adds the Job qty Ordered and shows this on the Calendar view so that production can see how many total pieces need to be bagged on that day.
When you double click on a given day, it enters C/AL that sets the same filters on the Job table, and loops through records, MARKing those Jobs that meet some other criteria (not all my filterable data exists at the job specific router table level, i have to look at the Job itself as well). i then call a form by RUNMODAL, passing the marked record set.
This pops my form which shows the jobs that need production for that day. i want to have a totals field at the bottom of the form that displays total remaining outstanding qtys.
When i use the function like you have demonstrated, it does not seem to copy the marks - since i am copying filters and not copying marks... i will play around with this some more and see what i can do. any other advice is greatly appreciated.
EDIT:
okay, i tried to use COPY instead of COPYFILTERS since the former is supposed to bring the marks along with it.
My function therefore looks like this:
the messages are there for testing. i am getting the 'did not find' message!
any idea why it does not work if i use the LRec variable?
EDIT:
This is what i did to get it to work:
then my control calls the function using recJob. It works, but i worry that is not ideal.
SO my example should be: Basically, I do the same thing as in your last example that works with the difference that I use a local variable, leaving the original record-position untouched. With your code, the form will select the latest record to show.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
when i do it the way i posted, it finds the records and totals as desired. I'm sure there is an explanation, but it seems to work so i guess i am satisfied.
The important thing is that it works.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!