Using PeopleCode in Deferred Mode

When designing transactions to run in deferred mode, you:

  • Code field edits in FieldEdit PeopleCode; you do not need to move field edits to SaveEdit PeopleCode.

  • Code field change logic in FieldChange PeopleCode.

  • Set all fields, including those that have FieldEdit or FieldChange PeopleCode, to deferred processing.

  • Do not use gray and hide fields on the same page to achieve a form of progressive disclosure on the page.

    Specifically, do not include Hide or UnHide and Gray or UnGray FieldEdit and FieldChange PeopleCode for definitions on the same page unless the page is triggered by a separate push button. Instead, use either page Activate PeopleCode or FieldChange PeopleCode for definitions that are on another page in the component. The appearance of the page should be static as the user enters values and moves between fields on the page.

    You should hide or reveal definitions or set them to display-only in page Activate PeopleCode before the initial appearance of the page based on setup data, configuration options, or personalization settings. Set fields to display-only in PeopleCode by setting the DisplayOnly property in the Field class to True.

  • Show all fields as a static form and perform cross-validation edits to prevent invalid data combinations from being written to the database.

  • For cross-validation edits, always assume that the controlling field (for example, a radio button, check box, drop down list box, and so on) is correct when editing for invalid combinations.

    Use SaveEdit to code cross-validation edits. If the transaction requires that the edits be performed before the user can select another folder tab, then code the edits in a function that is called from the page Activate PeopleCode for every other visible page in the component. If the transaction is a sequential process, add the cross-validation edits to the Next and Previous buttons that a user uses to navigate through the process. Code cross-validation edits at the record level if the cross-validation edits apply to all components, and at the component level if they apply to only one component.

Publishing Messages in PeopleCode

Use the SavePostChange event, either from record-field or component PeopleCode, to publish messages online. PeopleTools has special logic in SavePostChange PeopleCode that defers publishing until just before the commit for the transaction. This PeopleCode minimizes the time that the system locks single-threaded PeopleSoft Integration Broker tables.