Monday, September 20, 2010

Logical Constants versus Literal Values

Always use logical constants where they are available. It makes your code easier to read and easier to upgrade. Literal values are prone to upgrade problems as Siebel applications could change the behavior behind a literal value.

Example:

bc.NewRecord(1);

Most likely, future developers reading this script will have to look up what means. Also, if Siebel Systems were to change what this literal value does in theNe wRecord method in the C++ class, this code may not behave as expected. Using the logical constant alleviates both of these issues. The above line of code is better implemented as:

bc.NewRecord(NewAfter)

Type                                       Logical Constant                                  Value

Cursor Mode:                               ForwarBackward                                        0(Default)

Cursor Mode:                               ForwardOnly                                              1

ViewMode:                                   SalesRep View                                           0(Default)

ViewMode:                                   Manager View                                            1

ViewMode:                                   Personal View                                            2

ViewMode:                                   AllView                                                       3

ViewMode:                                   Organization View                                     5

ViewMode:                                   Contact View                                             6

ViewMode:                                   Group View                                                7

ViewMode:                                   Catalog View                                             8

ViewMode:                                   SubOrganization View                               9

NewRecordLocation:                    NewBefore                                                 0(Default)

NewRecordLocation:                    NewAfter                                                    1

NewRecordLocation:                    NewBeforeCopy                                         2

NewRecordLocation:                    NewAfterCopy                                            3

No comments :

Post a Comment