You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

dynamic veiw record type

1 reply [Last post]
Guest's picture

how the dynamic view record type works in peoplesoft soft?

can we give ":1" variables in sql statement written in sql editor (record type > click to open sql editor)?

Rajendra Prasad's picture
User offline. Last seen 6 years 23 weeks ago. Offline
Joined: 08/08/2011
Posts: 7
Re: dynamic veiw record type

please find below information regarding Dynamic View..
Dynamic Prompting:
Dynamic prompting can be done in mainly 3 ways:
1. Using Set Control Fields.
2. Using DERIVED Record.
3. Using Dynamic Views.
Using Set Control Fields:
Provide the prompt table name in the specific field. Now set the set Control field as the required control field through which you want to control this field.
Let us take a scenario where we have Country and state fields. Based on the Country selected, the corresponding states must be populated. Similar is the case with Business Unit, Project ID and Activity ID. So in the first scenario, specify the corresponding prompt tables for both the fields. Along with the prompt table name, specify the set control field as “Country” in the Record Field Properties of State field.
This will cause us to select only those values that are specific to that country. Similarly, we can do it with the second scenario.
Using DERIVED Record:
Using the same scenario as above, specify the prompt table for Country field as “COUNTRY_TBL” and for the State table, use a field from the delivered derived work record named “DERIVED” which has certain fields naming EDITTABLE, EDITTABLE1….etc. So use any of these fields in the prompt table name of the State field, e.g. %EDITTABLE. Now, write Peoplecode in the RowInit event of the State field. The code required is as follow:
Here, the above code works making an assumption that we have used %EDITTABLE field as the prompt table name of State field.
Note: Make sure to place the used DERIVED record field on the page and make it invisible. This can be done by setting the invisible checkbox in the Page Use properties of the specific field.
Using Dynamic Views:
Use the scenario of Business unit, Project Id, and Activity Id. Such is the scenario that’s marked with a red scribble:

To use Dynamic view for dynamic prompting, let’s have a look of the steps involved in creating a dynamic view:
1. Create a record definition with fields Business unit, Project Id, and Activity Id and save it with a name say “SAN_ACTIVTY_DVW”. In the Record Types tab, select the Record Type as Dynamic View and enter the following SQL query in SQL Editor:
Note: Here SAN_ACTIVTY_TBL is the base table for Activity.
2. Set the record field properties accordingly.
For Business Unit, Project Id, and Activity Id:
Check the key, Search key and list box and required in the use and edit properties of the specific fields respectively.
3. Now, in the prompt table names of the respective fields, normally set the prompt table for Business Unit. Similarly set the corresponding prompt table name for project Id but with “BUSINESS_UNIT” as a set control field for the Project ID field. Now for the Activity ID field, set the dynamic view “SAN_ACTIVTY_DVW” as the prompt table.
4. In the FieldChange event of the “Project_ID” field, write the following code:
&businessUnit = SAN_EMPL_TBL.BUSINESS_UNIT.Value;
&projectId = SAN_EMPL_TBL.PROJECT_ID.Value;
SAN_EMPL_TBL.ACTIVITY_ID.SqlText = "Select BUSINESS_UNIT, PROJECT_ID, ACTIVITY_ID FROM PS_SAN_ACTIVTY_TBL where business_unit like '" | &businessUnit | "' and project_id like '" | &projectId | "'";
1. Here, “SAN_EMPL_TBL” is the main record on the page.
2. “SAN_ACTIVTY_TBL” is the main record for activity page.
3. Make sure that the page I which this Project ID is used must be made interactive so as to fire the code in FieldChange immediately when the Project Id changes. This setting can be done in Page Use Properties of the Field “Project_ID”.