Dynamic call-section in Application Engine

Dynamic Call-SectionThe execution of a PeopleSoft Application Engine starts with the Main section and flows down to other sections which are called from the main section.

For calling a section from within one, we use the call section action. To do this, in the call-section action, we specify the name of the App engine and the section we wish to call. If the section is in the same App engine, then, providing the name of the App engine is optional.

How to use Dynamic Call-Section in App engine?

Often, business logic requires us to call different sections based on occurrence of certain conditions in different scenarios and that too from the same call-section. To enable this kind of logic, we will have to make the call-section dynamic. This is how we can do it.

Dynamic Call-Section State Record

To enable dynamic call-section, we need to have a state record that can support it. The state record, in this case, should have two extra fields – AE_APPLID and AE_SECTION. If you intent to make a dynamic call to sections that are in the same App engine as the calling section, then the state record would be good to go with just AE_SECTION.

PeopleCode for Dynamic Call-Section

Once you have the state record in place, it’s time to set the values for the extra fields – AE_APPLID and AE_SECTION. This should be done before the dynamic call section. The simplest way to implement this is to use a if-else as shown below:
if condition then
AE_APPLID = "AE_ABC_TEST";
AE_SECTION = "SEC_STATE";
else
AE_APPLID = "AE_ABC_TEST";
AE_SECTION = "SEC_CITY";
end-if;

Call-Section Action

This is the final step. Insert a Call-section action into the App engine. Check the Dynamic check-box that states that the call-section is dynamic. On finding the dynamic check-box checked, the processor looks for the values of AE_APPLID and AE_SECTION in the state record and calls the section mentioned in AE_SECTION from the app engine that is mentioned in the AE_APPLID.

If the AE_APPLID is blank, the processor calls the section mentioned in AE_SECTION from the current application engine.

Dynamic Call Section

Call Section: Dynamic Check box

Tags: , , ,
Subscribe to Comments RSS Feed in this post
13 Responses
  1. That’s detailed and complete. Thanks for sharing.

    I’m new to PeopleSoft and have a question. Is there any need for the state record to be a database record in this case.

    Thank you
    Deepu

  2. @Deepu – Glad that you found it useful.

    To answer your question, there is NO such requirement that the state record should be a database record in this case.

  3. Hey, thanks for sharing this information, It was helpful to me.

  4. thanks, your information help me much

  5. thanks a lot for the information. Its really useful.

  6. But if my app engine has multiple state records and these two fields – AE_APPLID and AE_SECTION are in a state record, but not in default state record. So can i make a dynamic call in this case also?

  7. Is it possible to either make a dynamic section call or not? I.e. I want to call a section or not call it. In your example, which I’ve tried, I left the section blank and get an error. Should I create a section that does nothing and call it?

    thanks!
    Bruce

    • @Bruce – If there’s only one section involved, why not rewire the design to handle it with a conditional statement rather than going the dynamic call section route?

  8. Thanks for taking time and sharing this info. It really helped me.

  9. It helps me as i am beginner in Peoplesoft technical

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Read previous post:
PeopleSoft Journal Uploader
PeopleSoft Journal Import Error – User-defined type not defined

Close