Hi expert, I have a little trouble in one program. We added some persons (Sales Assistant) in the Salesperson/Purchaser table and added extra field Sales Assistant which we added in the Salesperson/Purchaser in the Sales Order form. We need to create a report and calculate how many sales sold by each salesperson and sales assisant. I can create a report separately(one for salesperson, one for sales assistant). My question is how I can put salesperson and sales assisant together in one report.
Check one selection( sales including salesperson and sales assistant) and calcualte the total sales order and amount.
Check another selection(Sales excluding Sales Assistant) and calculate the total and this need to deduct the sales from sales assistant.
The output is like this:
Salesperson XXX
Sales Order 12
Salesperson XXXX
Sales Order 15
Total Sales Order 27
I tried to program like this:
Create two sections: A) one for salesperson with sales Assisatant
One for salesperosn without sales Assistant
In A) Currreport.Showoutput((Salesperson Code='xx' )or (salesperson Code='yy'
In
add something like A, but show different code.
The problem is if we want to retrieve the data for those without sales assistant, they are the same as the sales with assistant including the total sales order.
Expert how can we create one report for all functionality. Thanks!!!
Comments
You can use the document no. of the value entry to find the sales invoice header. Here is a field "Order No.", by which you can find the Order. If you have checked "Only Sales without assistant", code
If the Orders are deleted after invoicing, create the "Sales Assistant" field in the posted documents tabe too using the same field ID ( Sales Invoice , Credit Memo etc.). This is advisable in any case to prevent these field ID's being used for other purposes ( this would result in posting errors or false field values)
If the sales assistant code is copied to the ledger entries, it would enable to define new flowfields and flowfilterfields ( date , location etc.) in the Salesperson table which would calculate all values at once. In this case, Codeunits 22 and 80 have to be modified to copy the field values and at least one additional key with Sumindex for the Sales Amount is needed for the value entries.
Just one more consideration is there needs to be a Key, with the fields in
Field 1, Field 2,Field 3
Each element of the key can create a group and a total
Would give you grouping sections
Report Header
Field 1 group Header
>>Field 2 group Header
>>>>Field 3 group header
>>>>>>>Detail Line
>>>>Field 3 group Footer
>>Field 2 group Footer
Field 1 group Footer
Report footer
Use the wizard to create a grouped report and study the sections PreDataItem code
Looking again at your original post, if I am right you have two fields on the sales header, Sales Person and Sales Assistant, if so you can just add a Key to the Sales Header for your Sales Assistant, and in your report create two dataItems
one grouped by Sales Person where Sales Person <> '', and the other grouped by Sales Assistant where the Sales Assistant <> ''
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com