This Document Was Previously Published As Customer Connection Solution 200974879

This Document Was Previously Published As Customer Connection Solution 200974879

E1: BSFN: Debugging Business Functions Using Visual Studio .NET 2003, 2005 and 2008 [ID 639903.1]
Modified 16-NOV-2010Type HOWTOStatus PUBLISHED

In this Document
Goal
Solution
Overview
Caution
Rebuilding Business Functions
Debugging Business Function Called from Application or UBE Running Locally
Debugging Business Function called from application running on local web server of a Standalone Client (Demo Client)
Debugging Business Function called from Table Conversion Running Locally
Common Issues When Debugging a Business Function
References

Applies to:

JD Edwards EnterpriseOne Tools - Version: 8.93 and later[Release: 8.93 and later ]
Information in this document applies to any platform.

This document was previously published as Customer Connection Solution 200974879

Goal

Starting with application release EnterpriseOne 8.11, Visual C++ version 6 is no longer supported. How do I debug a business function (BSFN) using Visual C++ .NET 2003/2005/2008?

Solution

Overview

You can use Microsoft Visual C++ .Net to debug business functions in EnterpriseOne, including C business functions, Named Event Rule (NER) business functions (by debugging the NER generated C code), and Table triggers (by debugging the NER generated C code). You can debug business functions attached to interactive applications or batch applications, but the business functions MUST be executed locally. If launching a UBE, this generally means running it on the local workstation.

Caution

  1. To debug business function, business functions MUST be executed locally. If launching a UBE, this generally means running it on the local workstation.
  2. If you have debug JDE business function using Visual C++ 6 before, with Visual Studio .NET, you do not need to load the BSFN dll
  3. Also if a user has debugged C BSFN before with a previous version of Visual Studio then they may be prompted to convert the existing Activera.spl (project) file to Visual Studio 2008. We recommend to delete the file before trying to debug.

Rebuilding Business Functions

  1. Before debugging a business function, the business function must be rebuilt using busbuild because it cannot be debugged without a .pdb file, and pdb files are not delivered with a package install. For Xe and ERP8, .pdb file is not needed.
  2. Sign on to EnterpriseOne Development Client, go to Object Management Workbench, find the business function that you want to debug and bring it into a project. Check out the business function or do a Get.
  3. Select the Design button. In the design window select the Design Tools tab. Select the Build Business Function icon.
  4. In the BusBuild window, make sure that under the build tool bar the debug info has a check mark by it, and the dropdown box has the appropriate build mode, Optimized in this case. Make sure the client package is built in optimized mode not debug mode and the bsfn to debug is built in optimize mode and not in debug mode. Debug mode is no longer used.
  5. If debug info is not checked, let the build finish, check the debug info option, Close BusBuild, and hit build again.
  6. If the dropdown box has the wrong build mode, to avoid memory violations, let the build finish, select the correct mode in the BusBuild mode window, close BusBuild and hit build again.
  7. Close out of the Oracle J.D. Edwards EnterpriseOne software.

Debugging Business Function Called from Application or UBE Running Locally

  1. Make sure that no EnterpriseOne software (activeConsole, UTB, BusBuild, etc.) is running. The software must be closed to correctly debug using Visual C++ .NET.
  2. Open Microsoft Visual C++ .NET and make sure that all workspaces are closed.
  3. From the file menu, choose Open Project.
  4. Make sure to choose all file types or Executable Files (.exe) so you can choose the correct executable.
  5. Select ACTIVECONSOLE.EXE on path e811\System\bin32
  6. From the File menu choose open to open the .c or .h files for the business function (e811\path code\source\Bxxxxxx.c)
  7. Set your break points in the code (make sure to set your break points after the Main Processing section).
  8. Go to the Debug menu option and click Start.
  9. Save the solution file
  10. If "No Symbolic Information" message box for activConsole.exe appear click OK and continue.
  11. It is a normal feature of visual studio 2003/2005/2008 to disable break point at the start of a debug session and display a warning saying "The breakpoint will not currently be hit. No symbols have been loaded for this document.". Break point will only be activated on demand when the code to debug is loaded in to the runtime memory.
  12. The EnterpriseOne login box will appear.
  13. Sign into the Oracle J.D. Edwards EnterpriseOne software.
  14. Launch the application or submit the UBE (locally) as you normally would (Task, Interactive Versions, Batch Versions, OMW etc). When the application or UBE reaches the business function to Debug, it will display the C code in Visual C++ .NET so that you can step through it.
  15. If you are debugging event rules and "C" business functions, you can use the ER Debugger and Visual C++ debugger together. Follow the steps above until you log into the Oracle J.D. Edwards EnterpriseOne software. At this point follow the steps for the Event Rule Debugger. Program execution stops if "C" code is accessed. You can then use the Visual C++ to continue debugging. This is useful if you are trying to locate a problem and you are not sure whether the problem is in a "C" business function or the application calling the business function.

Debugging Business Function called from application running on local web server of a Standalone Client (Demo Client)

  1. For Demo version, the business function will run in jdenet_n.exe kernel thread.
  2. Click Tools -> EnterpriseOne Menu in Solution Explorer
  3. Go to Window Task Manager, click on Processes tab, right click jdenet_n.exe and select Debug
  4. Verify that it selected Visual C++ .NET for debugging and click ok
  5. "At Attach to Process" dialog box, make sure Native option is checked and click ok
  6. From the File menu choose open to open the .c or .h files for the business function (e811\path code\source\Bxxxxxx.c)
  7. Set your break points in the code (make sure to set your break points after main processing section).
  8. Launch the application from local web server EnterpriseOne Menu, when the application reaches the business function to Debug, it will display the C code in Visual C++ .NET so that you can step through it.

Debugging Business Function called from Table Conversion Running Locally

  1. Debug as if the business function is called from UBE.
  2. However for Tools Release 8.96 and forward, it may not stop at break point, please refer to document 651065.1 for how to debug.

Common Issues When Debugging a Business Function

  1. It is a normal feature of visual studio 2003/2005/2008 to disable break point at the start of a debug session and display a warning saying no symbol is loaded. Break point will only be activated on demand when the code to debug is loaded in to the runtime memory.
  2. If the business function won't stop at break point, check the following:
  3. Bsfn must run locally, make sure there is no OCM that mapped it to run on server.
  4. Make sure there is no UBEThread=0 in the [UBE] section of the jde.ini as this will make the UBE run in separate process instead of same thread as Visual C++ so UBE calling bsfn will not be caught by Visual C++.
  5. For Visual Studio 2005, make sure SP1 is installed and MTR is met.
  6. Make sure the client package is built in optimized mode not debug mode and the bsfn to debug is built in optimize mode and not in debug mode. Debug mode is no longer used.
  7. Prior to debug, please logout of jde, run busbuild.exe and do a build all then use omw to build the bsfn you want to debug.
  8. Please test debug B0100002 that is called from P01012 Find button. You can run P01012 locally on windows client. When you run P01012, the warning "no symbol is loaded" will go away because the dll is loaded in to the runtime memory.
  9. If unable to find jdenet_net.exe in Task Manager, close all and restart EnterpriseOne client. When you end debug in Visual C++ .NET after attaching to jdenet_n.exe, jdenet_n.exe will exit.
  10. If you get dll does not have debug info when you start debug, please logout of JDE, run busbuild.exe in 8.11\system\bin32 and do a build all.

References

NOTE:651065.1 - E1: BSFN: How to Debug a Business Function called by a Table Conversion

Related
Products
  • JD Edwards EnterpriseOne > Tools and Technology > EnterpriseOne Tools > JD Edwards EnterpriseOne Tools
Keywords
C; BUSBUILD; BUSINESS FUNCTION; DEBUGGING; STUDIO; VISUAL STUDIO