Generating the PeopleCode Template

This chapter provides an overview of how to generate PeopleCode templates and discusses how to:

Click to jump to top of pageClick to jump to parent topicUnderstanding How to Generate a PeopleCode Template

This section shows how to generate a Business Interlink PeopleCode template, using the freight carrier plug-in as an example.

Note. The freight carrier example is for demonstration purposes only and is not delivered.

You will use PeopleCode to run a Business Interlink object, which is an instantiation of a Business Interlink definition. You need to know how to access the PeopleSoft Application Designer to use these instructions.

You can run a Business Interlink object as part of an online process (PeopleCode Event on a record, component, page, and so on) or a batch process (that is, an Application Engine program.) The example shows creating a program in the FieldChange event for a record field, but you could run it from any event or even as part of a message subscription.

Click to jump to top of pageClick to jump to parent topicGenerating a PeopleCode Template in an Event

This section discusses how to generate a Business Interlink PeopleCode template in a PeopleCode event, using the PScustomer plug-in as an example.

To generate a Business Interlink PeopleCode template in a FieldChange event:

  1. Start the PeopleSoft Application Designer.

  2. Select the PeopleSoft object from which you will add a PeopleCode event to instantiate your Business Interlink definition and execute the Business Interlink object created by the instantiation.

  3. Choose the PeopleCode event from which you will instantiate and execute your Business Interlink object.

    Select View, PeopleCode Display or click the PeopleCode Display button to display the PeopleCode events.

    From this page, decide which Record Field you want to enter your Business Interlink object, then select the PeopleCode Event into which you want to instantiate and execute your Business Interlink object by double-clicking on that Record Field's PeopleCode event.

    Once you double-click the event, the PeopleCode editor window for that Record Field's PeopleCode event appears.

    The PeopleCode editor appears after you double-click the FieldChange check box.

    PeopleCode is associated with many components and many events. Usually, the object is a Record Field, and the event is an action that an end-user takes upon a PeopleSoft page that references that object. Such an event could be changing data in a Record Field displayed on the page (Field Change). It could also be saving the information on that page. The PeopleCode is executed when that event occurs.

  4. Insert your Business Interlink definition into the Project tree control on the left side of the Application Designer page.

    There are several ways to do this. One way is to select File, Open. Then from the Open Object dialog box, select Business Interlink from the Object Type drop-down list box, click the Open button to get a list of Business Interlinks in the Objects matching selection criteria list, then double-click on the Business Interlink that you want to use. Then select Insert, Current Object into Project.

    Another way is to select Insert, Objects into Project. Then from the Insert into Project dialog box, select Business Interlink from the Object Type drop-down list box, click the Insert button to get a list of Business Interlinks in the Objects matching selection criteria list, then double-click on the Business Interlink that you want to use.

    If you have already inserted your Business Interlink into a project, you can select File, Open, select Project, click the Open button to list the projects, and select your project that contains this Business Interlink. That project, along with your Business Interlink, will then be displayed in the Project control tree.

  5. Generate your PeopleCode template.

    Generate a PeopleCode template in order to avoid a lot of typing. For example, the template contains calls to the Business Interlink object methods, and includes the names of the inputs and outputs for your Business Interlink object.

    Generate the template by dragging and dropping your Business Interlink name from the Project tree control on the left side into the open PeopleCode editor window on the right side. A PeopleCode template is generated for your Business Interlink within the PeopleCode editor window.

  6. Fill in the PeopleCode template so that this PeopleCode program can run your Business Interlink object.

See Running a Business Interlink Object, PeopleCode and the Component Processor.

Click to jump to top of pageClick to jump to parent topicGenerating a PeopleCode Template in an Application Engine Program

This section discusses how to generate a Business Interlink PeopleCode template in a PeopleCode event, using the PScustomer plug-in as an example.

To generate a Business Interlink PeopleCode template for an Application Engine program:

  1. Start the PeopleSoft Application Designer.

  2. Insert your Business Interlink definition into the Project tree control on the left side of the Application Designer page.

    For example, you can select File, Open to select a Project from the dialog box that contains the Business Interlink that you want to use with the Application Engine Program, then insert the Business Interlink. In the following step, Insert, Objects into Project is used to insert the Business Interlink.

  3. Open or create an Application Engine Program.

    For example, you can select File, New, and then select App Engine Program from the dialog box.

    When you have opened the Application Engine Program, you get a screen similar to the following:

  4. If this Application Engine Program does not have an action, or you want to create a new action for the PeopleCode program, select Insert, Action. In this case, you must highlight a step (Step01) before you can insert an action.

    You will see the new action added.

  5. In the action, select PeopleCode from the drop-down menu.

  6. If you have not done so, save the Application Engine Program. Then right-click on the PeopleCode action, and then select View PeopleCode. An empty PeopleCode editor window appears.

  7. Generate your PeopleCode template.

    Generate a PeopleCode template in order to avoid a lot of typing. For example, the template contains calls to the Business Interlink object methods, and includes the names of the inputs and outputs for your Business Interlink object.

    Generate the template by dragging and dropping your Business Interlink name from the Project tree control on the left side into the open PeopleCode editor window on the right side. A PeopleCode template is generated for your Business Interlink within the PeopleCode editor window.

  8. Fill in the PeopleCode template so that this PeopleCode program can run your Business Interlink object.