Monday, April 13, 2015

JDE Project Naming Convention - Made Easy!

Application to create OMW Project ID based on Naming Convention Standards
Author: Zaki Ahmed
Here is the application we developed and use frequently to create OMW Project ID based on Naming Convention Rules that we have defined for our company.

Project ID: AAA_BB_NNNNNNNN
Project Description: X_YYYYYY_DDDDDDDDDDDDDDDD

A = Site
·         This could be a list of different business units for which OMW Project is created for
B = Functional Area
·         This could be a list of functional area such as Accounting, Finance, IT, ESU etc
N = JDE Internal Next Number
X = Project Type
·         Such as I = Issue, P = Project
Y = FRICE/Issue Number on Share Point
·         Support list or tracking number
D = Project Short Description
·         Description of the project

After entering this information, click  button. This will populate Last OMW Project ID and Last OMW Project Description Fields.
Example:
Now, users can go to OMW and see their project ID created for them. 
Now, let’s dive into the details of how it was developed.
1.       Create a custom table – F5598010 – Next Project Number

Field
Description
Comments
SY
Product Code
Hard Code ‘98’
BU21
Load Code 1
Stores Site #
BU22
Load Code 2
Stores Functional Area
NNBR
Next Number
Stores Project Next Number
EV01
Event Point Flag
Stores Project Type
MATH01
Math Numeric 01
Stores FRICE Number
OMWDESC
OMW Project Desc
Stores OMW Project Description
OMWPRJID
OMW Project ID
Stores OMW Project ID
USER,PID, JOBN, UPMJ, UPMT
Audit Fields
Audit Fields
2.       Create a new view – V5598010 – this will include all columns of F5598010
3.       Create a custom application - P5598010 – OMW Project Creation Application

Application Logic:

a.        This application queries against F98220 to fetch the highest number assigned in OMWPJN1 field and then stores this number in F5598010 by inserting a record in F5598010 if no record exists, otherwise, it updates the record that already exists. There will only be 1 line that exist in F5598010.NNBR field. By adding 1 to this number, this application generates new OMW project number.
b.       User fills in site, functional area, project type, FRICE number and project short description and presses OK button.
c.        This application then generates new Project ID and Project Description, updates the record in F5598010 and inserts a record in F98220 and F98221.

EVENT RULES
Form: OMW Project Creation App [W5598010A] -
Event: Post Dialog is Initialized
Event GUID: 2b9609b8-2ad3-450f-ac19-0d09e382b659
00001  FC Program ID [PID] = "P5598010"
00002  GetAuditInfo(B9800100.GetAuditInfo)
            FC User ID [USER] <- szUserName [USER]
            FC Date Updated [UPMJ] <- jdDate [DTE]
            VA frm_TimeLastUpdated_UPMT [UPMT] <- mnTime [TME0]
            FC Work Station ID [JOBN] <- szMachineKey [MKEY]

00003  FC Time Format = [VA frm_TimeLastUpdated_UPMT]
00004  FormatAndEditTime(B1700280.FormatAndEditTime)
            VA frm_TimeLastUpdated_UPMT [UPMT] <> mnNumericTime [UPMT]
            FC Time Format [UL02] <> szFormattedTime [FTIME]
            "1" -> cMode [EV01]

00005  FC Product Code [SY] = "98"
00006  //
00007  // Build Generic Key for Record Reservation
00008  VA frm_GenericKey_GENKEY = [FC Product Code]
00015  //
00016  F5598010.FetchSingle  [Index 1: SY]
            FC Product Code [SY] = TK Product Code [SY]
            FC Next Number [NNBR] <- TK Next Number [NNBR]
00017  If SV File_IO_Status is equal to CO SUCCESS
00018  |    // Add 1 number to project NN if already exists in F5598010
00019  |    FC Next Number = [FC Next Number]+1
00020  |    FC Object Management Project Name [OMWPRJID] = VA frm_SaveLastOMWProjectName [OMWPRJID]
00021  |    FC Description [OMWDESC] = VA frm_SaveLastOMWDesc_DSC1 [DSC1]
00022  Else
00023  |    // If no record exist on F5598010, then fetch the maximum number from
00024  |    // F98220.OMWPJN1 field and insert in F5598010
00025  |    F98220.Select  [Index 1: Project Name]
       |         VA frm_OMWProjectName_OMWPRJID [OMWPRJID] <> TK Object Management Project Name [OMWPRJID]
00026  |    F98220.FetchNext  [Index 1: Project Name]
       |         VA frm_OMWProjectNN_OMWPJN1 [OMWPJN1] <- TK OMW Project Future Use Numeric 1 [OMWPJN1]
00027  |    While SV File_IO_Status is equal to CO SUCCESS
00028  |    |    If VA frm_OMWProjectNN_OMWPJN1 [OMWPJN1] is greater than or equal to VA frm_SaveLast_OMWPJN1 [OMWPJN1]
00029  |    |    |    VA frm_SaveLast_OMWPJN1 [OMWPJN1] = VA frm_OMWProjectNN_OMWPJN1 [OMWPJN1]
00030  |    |    End If
00031  |    |    F98220.FetchNext  [Index 1: Project Name]
       |    |         VA frm_OMWProjectNN_OMWPJN1 [OMWPJN1] <- TK OMW Project Future Use Numeric 1 [OMWPJN1]
00032  |    End While
00033  |    F5598010.Insert  [Index 1: SY]
       |         FC Product Code [SY] -> TK Product Code [SY]
       |         FC Site [BU21] -> TK Load Code 1 [BU21]
       |         FC Functional Code [BU22] -> TK Load Code 2 [BU22]
       |         VA frm_SaveLast_OMWPJN1 [OMWPJN1] -> TK Next Number [NNBR]
       |         FC Project Type [EV01] -> TK J.D. EnterpriseOne Event Point 01 [EV01]
       |         FC Description [OMWDESC] -> TK Object Management Project Description [OMWDESC]
       |         FC User ID [USER] -> TK User ID [USER]
       |         FC Program ID [PID] -> TK Program ID [PID]
       |         FC Work Station ID [JOBN] -> TK Work Station ID [JOBN]
       |         FC Date Updated [UPMJ] -> TK Date - Updated [UPMJ]
       |         VA frm_TimeLastUpdated_UPMT [UPMT] -> TK Time - Last Updated [UPMT]
       |         FC Object Management Project Name [OMWPRJID] -> TK Object Management Project Name [OMWPRJID]
00034  |    FC Next Number = [VA frm_SaveLast_OMWPJN1]+1
00035  End If
Form: OMW Project Creation App [W5598010A] -
Event: Add Record to DB - Before
Event GUID: f80395d2-c8df-462e-aa68-8df677a9540a
00001  Suppress Add
Form: OMW Project Creation App [W5598010A] -
Event: Update Record to DB - Before
Event GUID: 1afbeeac-3e68-46c5-a3ea-ee5f4cdc3409
00001  Suppress Update
Form: OMW Project Creation App [W5598010A] -
Event: Form Variables
Event GUID: f2621a4d-5026-4b45-aba7-9479bed4952d
frm_OMWProjectName_OMWPRJID [OMWPRJID]
frm_OMWProjectNN_OMWPJN1 [OMWPJN1]
frm_SaveLast_OMWPJN1 [OMWPJN1]
frm_CreateOMWProject_EV01 [EV01]
frm_OMWProjectStatus_OMWPS [OMWPS]
frm_SaveLastOMWDesc_DSC1 [DSC1]
frm_SaveLastOMWProjectName [OMWPRJID]
frm_NextNumberString_TEXT [TEXT]
frm_FriceNextNumber_TEXT [TEXT]
frm_TimeLastUpdated_UPMT [UPMT]
frm_ProjectType_OMWPCC4 [OMWPCC4]
frm_GenericKey_GENKEY [GENKEY]
frm_szRecordReserveErrMsg_DTAI [DTAI]
frm_NameAlpha_ALPH [ALPH]
frm_ReserveApplicationID_PID [PID]
EVENTS
HC OK/Select -
Event: Button Clicked
Event GUID: c3b5ff5a-5d81-4e0e-94dc-558462604704
----------------------------------------
Event Level Variables
----------------------------------------
evt_OMWProjectType_OMWTYP [OMWTYP]
evt_SourceRelease_SRCRLS [SRCRLS]
evt_OMWProjectSeverity_OMWSV [OMWSV]
evt_ProductCodeReporting_SYR [SYR]
evt_FriceNumber_MATH01 [MATH01]
----------------------------------------
00001  // Build Project ID
00002  FC Object Management Project Name = concat(concat([FC Site],'_'[FC Functional Code]), )
00003  FC Object Management Project Name = concat([FC Object Management Project Name],'_')
00004  ConvertNumericToString(B0000045.ConvertNumericToString)
            FC Next Number [NNBR] -> mnMathNumeric01 [MATH01]
            VA frm_NextNumberString_TEXT [TEXT] <- szVideoConstant30A [VC30A]

00005  VA frm_NextNumberString_TEXT = lpad([VA frm_NextNumberString_TEXT],'0' ,8 )
00006  FC Object Management Project Name = concat([FC Object Management Project Name],[VA frm_NextNumberString_TEXT])
00007  VA frm_SaveLastOMWProjectName [OMWPRJID] = FC Object Management Project Name [OMWPRJID]
00008  // Build Project Description
00009  FC FRICE Number = lpad([FC FRICE Number],"0",6)
00010  FC Description = concat(concat([FC Project Type],'_'),[FC FRICE Number])
00011  FC Description = concat(concat([FC Description],'_'[FC Short Description]), )
00012  VA frm_SaveLastOMWDesc_DSC1 [DSC1] = FC Description [OMWDESC]
00013  // Update F5598010
00014  ConvertStringToMathNumeric(B0000580.ConvertStringToMathNumeric)
            FC FRICE Number [TEXT] -> szInputString [AA15]
            VA evt_FriceNumber_MATH01 [MATH01] <- mnOutputMathNumeric [MATH01]

00015  F5598010.Update  [Index 1: SY]
            FC Product Code [SY] = TK Product Code [SY]
            FC Site [BU21] -> TK Load Code 1 [BU21]
            FC Functional Code [BU22] -> TK Load Code 2 [BU22]
            FC Next Number [NNBR] -> TK Next Number [NNBR]
            FC Project Type [EV01] -> TK J.D. EnterpriseOne Event Point 01 [EV01]
            VA evt_FriceNumber_MATH01 [MATH01] -> TK Math Numeric 01 [MATH01]
            FC Description [OMWDESC] -> TK Object Management Project Description [OMWDESC]
            FC User ID [USER] -> TK User ID [USER]
            FC Program ID [PID] -> TK Program ID [PID]
            FC Work Station ID [JOBN] -> TK Work Station ID [JOBN]
            FC Date Updated [UPMJ] -> TK Date - Updated [UPMJ]
            VA frm_TimeLastUpdated_UPMT [UPMT] -> TK Time - Last Updated [UPMT]
            FC Object Management Project Name [OMWPRJID] -> TK Object Management Project Name [OMWPRJID]
00016  // Insert record in F98220
00017  VA frm_OMWProjectStatus_OMWPS [OMWPS] = "21"
00018  VA evt_OMWProjectType_OMWTYP [OMWTYP] = "02"
00019  VA evt_SourceRelease_SRCRLS [SRCRLS] = "E900"
00020  VA evt_OMWProjectSeverity_OMWSV [OMWSV] = "11"
00021  VA evt_ProductCodeReporting_SYR [SYR] = "55"
00022  VA frm_ProjectType_OMWPCC4 = [FC Project Type]
00023  //
00024  F98220.Insert  [Index 1: Project Name]
            FC Object Management Project Name [OMWPRJID] -> TK Object Management Project Name [OMWPRJID]
            FC Description [OMWDESC] -> TK Object Management Project Description [OMWDESC]
            VA frm_OMWProjectStatus_OMWPS [OMWPS] -> TK Object Management Project Status [OMWPS]
            VA evt_OMWProjectType_OMWTYP [OMWTYP] -> TK Object Management Project Type [OMWTYP]
            VA evt_SourceRelease_SRCRLS [SRCRLS] -> TK Source Release Number [SRCRLS]
            VA evt_OMWProjectSeverity_OMWSV [OMWSV] -> TK Object Management Project Severity [OMWSV]
            VA evt_ProductCodeReporting_SYR [SYR] -> TK Product Code/Reporting [SYR]
            SL DateToday -> TK OMW Project Creation Date [OMWCD]
            FC Site [BU21] -> TK OMW Category Code 2 [OMWPCC2]
            FC Functional Code [BU22] -> TK OMW Category Code 3 [OMWPCC3]
            VA frm_ProjectType_OMWPCC4 [OMWPCC4] -> TK OMW Category Code 4 [OMWPCC4]
            FC Next Number [NNBR] -> TK OMW Project Future Use Numeric 1 [OMWPJN1]
            FC Program ID [PID] -> TK Program ID [PID]
            FC Work Station ID [JOBN] -> TK Machine Key [MKEY]
            FC User ID [USER] -> TK User ID [USER]
            FC Date Updated [UPMJ] -> TK Date - Updated [UPMJ]
00025  F98221.Insert  [Index 1: Project, User, Role]
            FC Object Management Project Name [OMWPRJID] -> TK Object Management Project Name [OMWPRJID]
            FC User ID [USER] -> TK OMW Project User [OMWUSER]
            VA evt_OMWProjectType_OMWTYP [OMWTYP] -> TK Object Management User Role [OMWUR]
            FC Program ID [PID] -> TK Program ID [PID]
            FC Work Station ID [JOBN] -> TK Machine Key [MKEY]
            FC User ID [USER] -> TK User ID [USER]
            FC Date Updated [UPMJ] -> TK Date - Updated [UPMJ]
            VA frm_TimeLastUpdated_UPMT [UPMT] -> TK Time - Last Updated [UPMT]

About Author:

Zaki Ahmed has over 13 years of experience with JD Edwards development and implementation. Currently, he is working as a Principal Business Analyst in a manufacturing company in Wisconsin. You may contact the author at zaki.ahmed@gmail.com

Single Index Creation Utility

Single Index Generation Utility
(JD Edwards XE):
Author: Zaki Ahmed
Have you ever had a need to add and generate an index to a file such as F0911 or any other file that contained millions of rows of data with multiple indices? How many hours did you have to wait until the index regeneration process finished? 4? 6? 8? May be more? Well, JD Edwards, by default drops/rebuilds all indices of a file even if you just wanted one index to be generated.  
The solution for this is pretty simple; utilizing business function called “Create Single Index” B9800200. This business function will solve our problem and will potentially save plenty of lost hours. 
Programming Logic:
1.       Add row Exit to P9866/W9866J – Single Index Generation
2.       Create a new form P9866/W9866B as follows:
a.       A new field “Index Identifier field” is added on this form. This will be the numeric value of index that user wants to generate.
b.      A row exit “Find Index ID” is added which users will use to identify the numeric value of the index that they need to generate.
Post Dialogue Initialized ER:
Form: PLXS_Generate Single Index [W9866B] -
Event: Post Dialog is Initialized
Event GUID: e1edaf02-23e1-4912-8c1d-0069d38a5328
00001 
-
GetDataSourceName(B98TAM.GetDataSourceName)

            FC Object Name -> szNameObject [OBNM]
            UNDEFINED <> idApplicationIDOW [APPLID]
            FC Data Source <- szServerDataSource [DATS]

00002 
-
GetDataSourceOwner(B9800202.GetDataSourceOwner)

            FC Data Source -> szDatabasepath [DATP]
            FC Object Owner ID <> szObjectownerid [OOWN]

Form Variables:
Form: PLXS_Generate Single Index [W9866B] -
Event: Form Variables
Event GUID: 10a3a5c4-0b65-41e6-8744-5427c756426f
frm_frm_cDoesTableExistYN [EV01]

Add a row exit – Find Index
HC Find Index ID -
Event: Button Clicked
Event GUID: f3570b02-46e2-4646-b7f4-1397cc5daa10
00001  Call App:P80010 Form:W80010B Version:<Blank>[]
            FC Object Name -> szNameObject [OBNM]
            UNDEFINED <> szTableDescription [DL01]

Add a push button – Generate Index
Event Rules:
FC Generate Index -
Event: Button Clicked
Event GUID: 5043ebe7-e5e3-458b-9b6d-57ccb2579813
----------------------------------------
Event Level Variables
----------------------------------------
evt_Description [DESC]
----------------------------------------
00001  //
00002  // ----------------------------------------------------------------
00003  // Check to see if the table exist, before generating index.
00004  // ----------------------------------------------------------------
00005 
-
DoesTableExist(B98403.DoesTableExist)

            FC Object Name -> szNameObject [OBNM]
            FC Data Source -> szServerDataSource [DATS]
            FC Object Owner ID -> szObjectOwnerID [OOWN]
            frm_frm_cDoesTableExistYN [EV01] <- cExistingObjectYOrN [EXOB]

00006  If frm_frm_cDoesTableExistYN [EV01] is equal to 'N'
00007  |    Call App:
P9866 Form:W9866C Version:<Blank>[]
       
|         UNDEFINED <> cButtonType [EV01]
       
|         UNDEFINED <> cReturn [EV01]
       
|         '9' -> idCaption [APPLID]
       
|         UNDEFINED <> szTextSub [GK]
       
|         'F' -> cIconType [EV01]
00008  |    Stop Processing
00009  Else
00010  |    // Does Index Exist?
00011  |   
-
DropSingleIndex(B9800200.DropSingleIndex)

       
|         FC Object Name -> szTableName [OBNM]
       
|         FC Index Identifier -> idIndexId [INID]
       
|         FC Data Source -> szDatabasePath [DATP]
       
|         FC Object Owner ID -> szObjectOwnerID [OOWN]
       
|         FC Password -> szSignonPassword [PSWD]
       
|         FC Math Numeric <- mnErrorNumber [MATH01]

00012  |   
-
CreateSingleIndex(B9800200.CreateSingleIndex)

       
|         FC Object Name -> szTableName [OBNM]
       
|         FC Index Identifier -> idIndexId [INID]
       
|         FC Data Source -> szDatabasePath [DATP]
       
|         FC Object Owner ID -> szObjectOwnerID [OOWN]
       
|         FC Password -> szSignonPassword [PSWD]
       
|         FC Math Numeric <- mnErrorNumber [MATH01]

00013  |    If SV Error_Status is equal to CO SUCCESS
00014  |    |    Call App:
P9866 Form:W9866C Version:<Blank>[]
       
|    |         UNDEFINED <> cButtonType [EV01]
       
|    |         UNDEFINED <> cReturn [EV01]
       
|    |         '6' -> idCaption [APPLID]
       
|    |         UNDEFINED <> szTextSub [GK]
       
|    |         'S' -> cIconType [EV01]
00015  |    Else
00016  |    |    Call App:
P9866 Form:W9866C Version:<Blank>[]
       
|    |         UNDEFINED <> cButtonType [EV01]
       
|    |         UNDEFINED <> cReturn [EV01]
       
|    |         '2' -> idCaption [APPLID]
       
|    |         UNDEFINED <> szTextSub [GK]
       
|    |         'S' -> cIconType [EV01]
00017  |    End If
00018  End If



Tuesday, November 20, 2012

JDE Package Management Made Easy!


JDE Package Management Made Easy!

This article is for CNC Administrators and JDE Developers who have good understanding of Package Management and JDE Tools Set.
Have you ever had to do an UPDATE PACKAGE BUILD where there are tens of different projects with dozens of versions of UBEs? If yes, then I can understand the pain that it causes you to try to pull all the objects that are necessary for that build. You might have thought why Oracle hasn't put in a little extra effort to make this step a little easier for users where users could pull objects by status of project instead of by project name.
Well, the wait is over. After making a small modification to you package management application, you can pull all your objects with one click of a button. It not only will save you a lot of time as a CNC administrator, but also will eliminate human error in missing some objects that would otherwise be necessary to be part of an update package build.
Changes that you need to make to Component Selection (P9601/W9601D) Screen are as follows:

1.       New fields added to Component Selection Screen
a.       Project Status EDIT FIELD (for example DV = 25, PY = 35, QA = 55, PD = 65 etc)
b.      Project Versions RADIO BUTTON             

                                                         i.            If you wish to set it by default, then put following code in Post Dialogue Initialized Event of the form W9601D:
FC JDE Versions = "3"
                                                       ii.            This option (if selected) will pull all versions of a UBE in a given project in a given status.
c.       Get Object PUSH BUTTON
                                                               i.      Click this button to pull all projects with all objects in a given status.


2.       Click [Get Objects] Push Button to pull all objects that are at the status you define at Project Status field.

3.       Select all these line and then click SELECT button to select these objects in your package build.

4.       Click Close button. You will notice that all UBE versions that are in the Project status you selected have been automatically selected for you.

5.       Proceed with remaining steps of Update Package Build
The actual code behind the “Get Objects” Push Button and the “OK” Button is as follows:
Code behind “Get Objects” Button:

Button Clicked Event:[1]

APPL: P9601 - Package Assembly
Form: W9601D - Object Component Selection
FC Get objects -
Event: Button Clicked
Event GUID: ad8fd4ed-850c-406d-a1fe-75cf30412073

VA frm_PLXS_GetObjectButtonClick = "Y"
FC Modification Comment = "1"
Press Button(HC F&ind)
If FC Project Status is greater than <Blank>
     F98220.Select  [Index: Status, Type, Severity]
          FC Project Status = TK Object Management Project Status
     F98220.FetchNext  [Index: Status, Type, Severity]
          frm_PLXS_OMWPrjName_OMWPRJID [OMWPRJID] <- TK Object Management Project Name
     While SV File_IO_Status is equal to CO SUCCESS
          // Find all objects in this project
          F98222.Select  [Index: Project, Object, Rel, ObjType]
               frm_PLXS_OMWPrjName_OMWPRJID [OMWPRJID] = TK Object Management Project Name
          F98222.FetchNext  [Index: Project, Object, Rel, ObjType]
               frm_PLXS_NameObject_OBNM [OBNM] <- TK Object Management Object Name
               frm_PLXS_OMWObjectType_OMWOT [OMWOT] <- TK Object Management Object Type
          While SV File_IO_Status is equal to CO SUCCESS
               GB OMW ProjectName = " "
               GB ObjectName = " "
               GB Description = " "
               GB Description = " "
               GB Description = " "
               GB Selected = " "
               GB ObjectType = " "
               GB SystemCode = " "
               GB ReportingSystem = " "
               //  
               // Check Object Type
               If frm_PLXS_OMWObjectType_OMWOT [OMWOT] is equal to ('APPL','BL','BSFN','BSVW','DSTR','GT','TBLE','UBE','UBEVER')
                    If frm_PLXS_OMWObjectType_OMWOT [OMWOT] is equal to 'UBEVER'
                         FindCharPositionInString(B7500150.FindCharPositionInString)
                              frm_PLXS_NameObject_OBNM [OBNM] -> szString [BDS4]
                              '|' -> cCharToFind [EV01]
                              <Zero> -> mnStartingPosition [MATH80]
                              frm_PLXS_PipePosition_LNID [LNID] <- mnPositionFound [MATH80]
                         VA frm_PLXS_NameObject_OBNM = substr([VA frm_PLXS_NameObject_OBNM],0, [VA frm_PLXS_PipePosition_LNID])
                    End If
                    // Always add the object if no a UBE VER. 
                    // If UBE VER only, add the corresponding
                    // UBE name if it hasn't been added yet
                    //  
                    If frm_PLXS_OMWObjectType_OMWOT [OMWOT] is equal to 'UBEVER'
                    And frm_PLXS_NameObject_OBNM [OBNM] is not equal to frm_LastUBEAdded_OBNM [OBNM]
                    Or frm_PLXS_OMWObjectType_OMWOT [OMWOT] is not equal to 'UBEVER'
                         GB ObjectName = VA frm_PLXS_NameObject_OBNM
                         GB OMW ProjectName = VA frm_PLXS_OMWPrjName_OMWPRJID
                         //  
                         // Get data for other columns
                         F9860.FetchSingle  [Index: Object Name]
                              frm_PLXS_NameObject_OBNM [OBNM] = TK Object Name
                              GB Description <- TK Description
                              GB System  Code <- TK Product Code
                              GB Reporting  System <- TK Product Code/Reporting
                              GB Object  Type <- TK Object Type
                         VA frm_PLXS_PkgItemType_PKGITMTY = "O"
                         F9631.FetchSingle  [Index: Pckage Name, Path Code A+]
                              frm_PLXS_PkgItemType_PKGITMTY [PKGITMTY] = TK Type - Package Item Type
                              frm_PLXS_NameObject_OBNM [OBNM] = TK Object Name
                              FC Package Name = TK Pakcage Name
                              FC Path Code = TK Code - Path
                         If SV File_IO_Status is equal to CO SUCCESS
                              GB Selected = "1"
                         Else
                              GB Selected = "0"
                         End If
                         //  
                         Insert Grid Buffer Row(FC Grid,  <After Last Row>,  <Yes>,  <Yes>,  <No>,  <Yes>,  <No>)
                         // If this object has been added to the package already, then display the Check
                         // Mark
                         If GB Selected is equal to '1'
                              Get Max Grid Rows(FC Grid, VA frm_PLXS_MaxGridRows_MATH01)
                              Set Grid Row Bitmap(FC Grid, VA frm_PLXS_MaxGridRows_MATH01,  <Check Mark>)
                         End If
                    End If
               Else
                    // It's not an object that is placed in a package, ignore it
               End If
               //  
               If frm_PLXS_OMWObjectType_OMWOT [OMWOT] is equal to ('UBE','UBEVER')
                    VA frm_LastUBEAdded_OBNM = VA frm_PLXS_NameObject_OBNM
               End If
               //  
               F98222.FetchNext  [Index: Project, Object, Rel, ObjType]
                    frm_PLXS_NameObject_OBNM [OBNM] <- TK Object Management Object Name
                    frm_PLXS_OMWObjectType_OMWOT [OMWOT] <- TK Object Management Object Type
          End While
          //  
          F98220.FetchNext  [Index: Status, Type, Severity]
               frm_PLXS_OMWPrjName_OMWPRJID [OMWPRJID] <- TK Object Management Project Name
     End While
End If

Post Button Clicked Event:

APPL: P9601 - Package Assembly
Form: W9601D - Object Component Selection
FC Get objects -
Event: Post Button Clicked
Event GUID: 345b267d-2947-4a87-962d-698bf39e43ee
VA frm_PLXS_GetObjectButtonClick = "N"
Code behind OK Button:

Button Clicked Event:

APPL: P9601 - Package Assembly
Form: W9601D - Object Component Selection
HC OK/Select -
Event: Button Clicked
Repeat For Grid
Event GUID: 5b832698-ec22-11d1-9094-0000f67c789e
// 
VA frm_ItemType = "O"
// 
// Check to see if this item exists for the package yet.  If not add it.
// 
If GC Selected is equal to '1'
     F9631.Delete  [Index: Pckage Name, Path Code A+]
          frm_ItemType [PKGITMTY] = TK Type - Package Item Type
          GC Object Name = TK Object Name
          FI szPackageName = TK Pakcage Name
          FI szCodePath = TK Code - Path
     Set Grid Row Bitmap(FC Grid, <Currently Selected Row>,  <Blank/Clear>)
     GC Selected = "0"
Else
     F9631.FetchSingle  [Index: Pckage Name, Path Code A+]
          frm_ItemType [PKGITMTY] = TK Type - Package Item Type
          GC Object Name = TK Object Name
          FI szPackageName = TK Pakcage Name
          FI szCodePath = TK Code - Path
     If SV File_IO_Status is not equal to CO SUCCESS
          GetAuditInfo(B9800100.GetAuditInfo)
               frm_UserID [USER] <- szUserName [USER]
               frm_DateUpdated [UPMJ] <- jdDate [DTE]
               frm_TimeUpdated [TDAY] <- mnTime [TME0]
               frm_JOBN [JOBN] <- szWorkstation_UserId [JOBN]
          VA frm_Program = "P9601"
          F9631.Insert  [Index: Pckage Name, Path Code A+]
               frm_ItemType [PKGITMTY] -> TK Type - Package Item Type
               GC Object Name -> TK Object Name
               FI szPackageName -> TK Pakcage Name
               FI szCodePath -> TK Code - Path
               frm_Program [PID] -> TK Program ID
               frm_JOBN [JOBN] -> TK Work Station ID
               frm_DateUpdated [UPMJ] -> TK Date - Updated
               frm_TimeUpdated [TDAY] -> TK Time - Last Updated
               frm_UserID [USER] -> TK User ID
     End If
     Set Grid Row Bitmap(FC Grid,  <Currently Selected Row>,  <Check Mark>)
     GC Selected = "1"
     // 
     If GC Object  Type is equal to 'UBE'
     And FC Select Versions is equal to <Blank>
          Call App:P9601 Form:W9601T Version:<Blank>
[]
               GC Object Name -> szNameObject [OBNM]
               FI szPackageName -> szPackageName [PKGNAME]
               FI szCodePath -> szCodePath [PATHCD]
     Else
          If GC Object  Type is equal to 'UBE'
               // 
               VA frm_NoMoreRecords = " "
               // 
               If FC All Versions is equal to ('1','2')
                    // 
                    VA frm_VersionsListCategoryCode2 = "1"
                    F983051.Select  [Index: primary]
                         GC Object Name = TK Program ID
                         frm_VersionsListCategoryCode2 [VCC2] <> TK Category Code - OW Version List 2
                    // 
                    While frm_NoMoreRecords [EV01] is equal to <Blank>
                         F983051.FetchNext  [Index: primary]
                              frm_Version [VERS] <- TK Version History
                         If SV File_IO_Status is equal to CO SUCCESS
                              If FC JDE Versions is equal to '1'
                                   VA frm_FourBig = substr([VA frm_Version],0,4 )
                              End If
                              If FC All Versions is equal to ('1')
                              And frm_FourBig [VERS] is equal to ('XJDE','ZJDE')
                              Or FC All Versions is equal to '2'
                                   GetAuditInfo(B9800100.GetAuditInfo)
                                        frm_UserID [USER] <- szUserName [USER]
                                        frm_DateUpdated [UPMJ] <- jdDate [DTE]
                                        frm_TimeUpdated [TDAY] <- mnTime [TME0]
                                        frm_JOBN [JOBN] <- szWorkstation_UserId [JOBN]
                                   VA frm_Program = "P9601"
                                   F9631.Insert  [Index: Pckage Name, Path Code A+]
                                        frm_ItemType [PKGITMTY] -> TK Type - Package Item Type
                                        GC Object Name -> TK Object Name
                                        FI szPackageName -> TK Pakcage Name
                                        FI szCodePath -> TK Code - Path
                                        frm_Version [VERS] -> TK Version History
                                        frm_Program [PID] -> TK Program ID
                                        frm_JOBN [JOBN] -> TK Work Station ID
                                        frm_DateUpdated [UPMJ] -> TK Date - Updated
                                        frm_TimeUpdated [TDAY] -> TK Time - Last Updated
                                        frm_UserID [USER] -> TK User ID
                              End If
                         Else
                              VA frm_NoMoreRecords = "1"
                         End If
                    End While
                    // 
                    // ****************************************************************
                    // Begin Additional Custom Logic to pull versions of UBE by Status
                    // ****************************************************************
                    // 
               Else
                    If FC All Versions is equal to '3'
                         VA frm_VersionsListCategoryCode2 = "1"
                         F983051.Select  [Index: primary]
                              GC Object Name = TK Program ID
                              frm_VersionsListCategoryCode2 [VCC2] <> TK Category Code - OW Version List 2
                         While frm_NoMoreRecords [EV01] is equal to <Blank>
                              F983051.FetchNext  [Index: primary]
                                   frm_Version [VERS] <- TK Version History
                              If SV File_IO_Status is equal to CO SUCCESS
                                   VA frm_PLX_OMWObjectName_OMWOBJID = concat(concat([GC ObjectName],"|"),[VA frm_Version])
                                   VA frm_PLXS_OMWObjectType_OMWOT = "UBEVER"
                                   F98222.Select  [Index: Project, Object, Rel, ObjType]
                                        GC OMW Project  Name = TK Object Management Project Name
                                        frm_PLX_OMWObjectName_OMWOBJID [OMWOBJID] = TK Object Management Object Name
                                        frm_PLXS_OMWObjectType_OMWOT [OMWOT] = TK Object Management Object Type
                                   F98222.FetchNext  [Index: Project, Object, Rel, ObjType]
                                        frm_PLXS_FetchTest_USER [USER] <- TK Object Management Project Name
                                        frm_PLXS_FetchTest_USER [USER] <- TK User ID
                                   If SV File_IO_Status is equal to CO SUCCESS
                                        GetAuditInfo(B9800100.GetAuditInfo)
                                             frm_UserID [USER] <- szUserName [USER]
                                             frm_DateUpdated [UPMJ] <- jdDate [DTE]
                                             frm_TimeUpdated [TDAY] <- mnTime [TME0]
                                             frm_JOBN [JOBN] <- szWorkstation_UserId [JOBN]
                                        VA frm_Program = "P9601"
                                        F9631.Insert  [Index: Pckage Name, Path Code A+]
                                             frm_ItemType [PKGITMTY] -> TK Type - Package Item Type
                                             GC Object Name -> TK Object Name
                                             FI szPackageName -> TK Pakcage Name
                                             FI szCodePath -> TK Code - Path
                                             frm_Version [VERS] -> TK Version History
                                             frm_Program [PID] -> TK Program ID
                                             frm_JOBN [JOBN] -> TK Work Station ID
                                             frm_DateUpdated [UPMJ] -> TK Date - Updated
                                             frm_TimeUpdated [TDAY] -> TK Time - Last Updated
                                             frm_UserID [USER] -> TK User ID
                                   End If
                              Else
                                   VA frm_NoMoreRecords = "1"
                              End If
                         End While
                         // 
                    End If
                    // 
                    // ****************************************************************
                    // End Additional Custom Logic to pull versions of UBE by status
                    // ****************************************************************
                    // 
               End If
               // 
          End If
     End If
     If GC Object  Type is equal to 'APPL'
     And FC Select Versions is equal to <Blank>
          F983051.FetchSingle  [Index: primary]
               GC Object Name = TK Program ID
          If SV File_IO_Status is equal to CO SUCCESS
               Call App:P9601 Form:W9601T Version:<Blank>
[]
                    GC Object Name -> szNameObject [OBNM]
                    FI szPackageName -> szPackageName [PKGNAME]
                    FI szCodePath -> szCodePath [PATHCD]
          End If
     Else
          If GC Object  Type is equal to 'APPL'
               // 
               VA frm_NoMoreRecords = " "
               // 
               If FC All Versions is equal to ('1','2')
                    // 
                    F983051.Select  [Index: primary]
                         GC Object Name = TK Program ID
                    // 
                    While frm_NoMoreRecords [EV01] is equal to <Blank>
                         F983051.FetchNext  [Index: primary]
                              frm_Version [VERS] <- TK Version History
                         If SV File_IO_Status is equal to CO SUCCESS
                              If FC JDE Versions is equal to ('1','2')
                                   VA frm_FourBig = substr([VA frm_Version],0,4 )
                              End If
                              If FC All Versions is equal to ('1','2')
                              And frm_FourBig [VERS] is equal to ('XJDE','ZJDE')
                              Or FC All Versions is equal to '2'
                                   GetAuditInfo(B9800100.GetAuditInfo)
                                        frm_UserID [USER] <- szUserName [USER]
                                        frm_DateUpdated [UPMJ] <- jdDate [DTE]
                                        frm_TimeUpdated [TDAY] <- mnTime [TME0]
                                        frm_JOBN [JOBN] <- szWorkstation_UserId [JOBN]
                                   VA frm_Program = "P9601"
                                   F9631.Insert  [Index: Pckage Name, Path Code A+]
                                        frm_ItemType [PKGITMTY] -> TK Type - Package Item Type
                                        GC Object Name -> TK Object Name
                                        FI szPackageName -> TK Pakcage Name
                                        FI szCodePath -> TK Code - Path
                                        frm_Version [VERS] -> TK Version History
                                        frm_Program [PID] -> TK Program ID
                                        frm_JOBN [JOBN] -> TK Work Station ID
                                        frm_DateUpdated [UPMJ] -> TK Date - Updated
                                        frm_TimeUpdated [TDAY] -> TK Time - Last Updated
                                        frm_UserID [USER] -> TK User ID
                              End If
                         Else
                              VA frm_NoMoreRecords = "1"
                         End If
                    End While
                    // 
               End If
               // 
          End If
     End If
End If




[1] Source: Scott Beebe – a better way to assemble package published on Quest Q& A - 2009