One of the conveniences that we can get from SAP Business One is to create a custom report or custom form. One way to create a custom form or custom report is to use Crystal Report. But, have you ever been confused when you want to preview a document through Crystal Report but don’t know what the DocKey?
To find the DocKey is indeed quite difficult because we have to do a few steps:
- On the search menu, enter the transaction document that you want to see, (Example: I want to see the transaction of A/R Invoice).
- On the transaction menu, enter the transaction document that you want to preview in Crystal Report, then record the document number.
- Go to the Tools menu > Queries > Query Generator.
- In the Query generator, enter the query.
With the format: SELECT * FROM [Object Type] WHERE DOCNUM = ‘[Document Number that has been recorded]’
To find out the correct object type for the transaction document that you want to create, you can see the list of object types from List of Object Types On SAP BUSINESS ONE
Example:SELECT * FROM OINV WHERE DOCNUM = ‘1’
- Then, the Query Preview will appear, note the document’s Internal Number which will be used as Dockey later.
- Back to the preview menu in Crystal Report, and enter the Internal Number as Dockey in Crystal Report and a preview of the existing document will be formed.
Also read: