Hi, I create a report on the sales order and I want to count how many orders based on the sales number. If the sales number data type is text, how to calculate the total number? Thanks in advance!
FOR I := 1 TO STRLEN("No.") DO BEGIN
IF EVALUATE(TempInt,FORMAT("No."[I])) THEN
TempStr += FORMAT("No."[I]);
END;
evaluate(TempInt,TempStr);
message('You've created ' + TempStr + ' Sales order Number');
You can use TempInt as integer and do what you want with it.
Ahmed Rashed Amini
Independent Consultant/Developer
Thank you, kriki! It coun the total sales order, but it didn't work it out on the sales order of the separate salesperson. Would you provide me the detailed info. Thank you very much Kriki!
1) CurrReport.CREATETOTALS(intCounter) in OnPreDataitem
2) intCounter := 1 in OnAfterGetRecord (yes, just assign, not increase)
3) Everywhere you print intCounter you will have correct grand total (in Footer) and totals (in groupfooter)
If you are using the Sales Invoice Header table (112) then you need to set the following properties
1) DataItemTableView Salesperson Code (create a key if it doesn't exist)
2) GroupTotalFields Salesperson Code
then do as Kine said
1) CurrReport.CREATETOTALS(intCounter) in OnPreDataitem
2) intCounter := 1 in OnAfterGetRecord (yes, just assign, not increase)
3) Everywhere you print intCounter you will have correct grand total (in Footer) and totals (in groupfooter)
Ensure that in your sections you have GroupHeader and GroupFooter defined and this code on each OnPreSection
Hi expert. Is there any way to count just the debit record in the customer account, since debit and credit are considered one entry if we count the record. The Fact is Debit and Credit are not equal all the time and we just want to count how many DEBITS one customer has and how to do it? Thanks in advance!
Hi expert. Is there any way to count just the debit record in the customer account, since debit and credit are considered one entry if we count the record. The Fact is Debit and Credit are not equal all the time and we just want to count how many DEBITS one customer has and how to do it? Thanks in advance!
Do you mean customer entries? The invoices have another Document type than the credit memo's.
Comments
You can use TempInt as integer and do what you want with it.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Sales Order No.
SO110
SO112
SO113
___________
Total 3 Orders
'Total ' + format("Sales header".Count) + ' Orders'
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
A:
S110
S112
_____
2 Orders
B:
S113
_____
1 Orders
C:
S220
S230
S440
S250
____
4 Orders
Thanks in advance!
"OnPreDataItem":
"OnAfterGetRecord":
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
2) intCounter := 1 in OnAfterGetRecord (yes, just assign, not increase)
3) Everywhere you print intCounter you will have correct grand total (in Footer) and totals (in groupfooter)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
FOR I := 1 TO STRLEN("salesperson code") DO BEGIN
IF EVALUATE(TempInt,FORMAT("salesperson code")) THEN
strSales += FORMAT("Salesperosn Code.");
END;
Any probelms here? Thanks!
1) DataItemTableView Salesperson Code (create a key if it doesn't exist)
2) GroupTotalFields Salesperson Code
then do as Kine said
Ensure that in your sections you have GroupHeader and GroupFooter defined and this code on each OnPreSection
CurrReport.SHOWOUTPUT :=
(CurrReport.TOTALSCAUSEDBY = "Sales Invoice Header".FIELDNO("SalesPerson Code"));
This should do the trick.
\:D/
This forum rules!
http://www.BiloBeauty.com
http://www.autismspeaks.org
RIS Plus, LLC
Do you mean customer entries? The invoices have another Document type than the credit memo's.
Maybe you can use this to count the records.