Wednesday, May 29, 2013

How do dynamically populate a valcode values for dropdown menu in Web UI or Webadvisor


First, add DYNAMIC.VALCODE.ID to the form. 

Second, put this in FIELD.ACCEPT of DYNAMIC.VALCODE.ID

* Note: Populate XL.INTERNAL.CODE, XL.DESCRIPTION with the codes and descriptions of the dropdown values first
X.WEB.VALCODE.NUMBER = "PHAM.TEST.CODE"  ß (Notice this has to be the same name as $CR.PHAM.TEST.CODE below)
X.WEB.VALCODE.KEY = ""
CALL S.STORE.DYNAMIC.VALCODES(X.WEB.VALCODE.NUMBER, XL.INTERNAL.CODE, XL.DESCRIPTION,"","",X.WEB.VALCODE.KEY,"","")
INPUT.DATA = X.WEB.VALCODE.KEY


Third, put this in the validation field of the dropdown field.

$CR.PHAM.TEST.CODE;DYNAMIC.VALCODE;DYNAMIC.VALCODES.ID;DYNAMIC.VALCODES.CODES;DYNAMIC.VALCODES.DESCS;DYNAMIC.VALCODES.FLD3;DYNAMIC.VALCODES.FLD4



This subroutine could be useful to modify existing valtable:
S.GET.VALCODE.RECORD

Tuesday, May 21, 2013

Commonly used keyboard shortcuts for Desktop UI2.3


( alternative keystroke combinations separated by | ) 


Move to the next field Tab
Move to the previous field Shift+Tab
Move forward one row Down Arrow
Move back one row Up Arrow
Move forward one screen Page Up
Move backward one screen Page Down
Move to the beginning of the current field Home
Move to the end of the current field End
Move to the first row of a window Ctrl+Home
Move to the last row of a window Ctrl+End

Field insert Ctrl+I | Insert | F3
Field delete Ctrl+D | Alt+F, F | Alt+E, D | F4
Open the File menu Alt+F
Cancel Alt+F, C | Shift+F8

Save (Update) Alt+F, S | F10
Close (Finish) Alt+F, L | F9
Detail Alt+F, D | F2
Direct Access Alt+F, A | F8
Record Delete Alt+F, R | Shift+F10
Exit Alt+F, X | Shift+F9
Open the Edit menu Alt+E
Open the Apps menu Alt+A
Open the Help menu Alt+H
Field Help Alt+H, F | F1
Process Help Alt+H, P | Shift+F1
Keyboard Shortcut Help Alt+H, U | Shift+F2

Pull down the Favorites menu Alt+V
Pull down the Options menu Alt+O 

Thursday, May 16, 2013

How to test computed column in MS SQL Server Management Studio


To test computed column, I would fire up SQL server management studio, in Object Exploere, drill down to your dev/test/prod database, then to Programmability, then Functions, then Scalar-valued Functions. Mine is:

Colleague18_test_db/Programmability/Functions/Scalar-valued Functions/

For example, to test out computed column C70_PER_TODAYS_DATE, which takes a PERSON.ID as an argument, here is the query I would use:

SELECT [colleague18_test_db].[dbo].[C70_PER_TODAYS_DATE] ('myIDNumber')

If you don't see your computed column in Scalar-valued Functions, I recommend recompiling/reinstalling the computed column again.

Tuesday, May 14, 2013

Envision string manupulation

String manipulation using square brackets [ ] takes two arguments.

X.STRING[x, y] where x is the starting position of the character, and y is the number of characters we want starting from x. If x is not provided, the position will be set to the end of the string, and counts backward.

X.STRING = '123456789'
X.STR1 = X.STRING[1,2]       -      X.STR1 = '12'
X.STR2 = X.STRING[1]          -      X.STR2 = '9'
X.STR3 = X.STRING[2]          -      X.STR3 = '8'
X.STRING[1,1] = 'FOO'          -      X.STRING = 'F23456789'
X.STR4 = X.STRING[1,2]       -      X.STR4 = 'F2'
X.STRING[1,2] = 'BAR'          -       X.STRING = 'BA3456789'

Thursday, May 9, 2013

Submit the form when a drop down menu item is selected in Webadvisor


In field output of a VAR variable, enter the following:

OUTPUT.DATA := '<script type="text/javascript">'
OUTPUT.DATA := "document.getElementById('VAR1').onchange = submit;"
OUTPUT.DATA := 'function submit() {document.datatelform.submit();}'
OUTPUT.DATA := '</script>'

In this case, VAR1 field contains the drop down menu. This code needs to be parsed after VAR1. For instance, if you insert the above code in VAR2 output field, VAR2 needs to be below VAR1 in UI Form Field Sequence.



Note that this has only been tested with standalone webadvisor. I am not sure if this will work with webadvisor webpart inside colleague portal. If it does, the document and field name may need to change accordingly.

Tuesday, May 7, 2013

Delete record from a table



V.DYNAMIC.VALCODES.ID = A.DYNAMIC.VALCDS.ID
FOR_THIS DYNAMIC.VALCODES.ID DELETING
END_THIS DYNAMIC.VALCODES.ID

We need to have one element from the table in the demand element window for this to work.