beekerc2

GEL Scripting and populating object attributes

Discussion created by beekerc2 on Oct 12, 2010
Latest reply on Oct 12, 2010 by Dave
Here's the situation.   I have two attributes that are entered in the GUI, both numeric.   These numbers are used against a simple X/Y matrix and resolves one of a fixed set (of 5) values (words).   I've already tried to derive a smiple mathematical algorithm to generate the values and have struck out.   In addition, I need to associate each resolved value with it's numeric ranking (1-5) for sorting purposes for reporting and portlets.   The latter part would seem easy, use a lookup attribute to display the value and store the numeric lookup code.   here's the problem - there is no attribute that let's you do calculations to derive the stored number, but display a correpsonding   value.   And even if there was, I'm still not able to derive a simple formula to determine the number.  My proposed solution is to create a lookup that has the list of values, with lookup codes 1-5.   create an attribute associated to this lookup and make it read-only so it' can't be changed via the GUI.   use a GEL script based process (triggered by a change in either of the two component attributes or save/submit being clicked on the view page) that calculates the number, then stores it in the lookup attribute.Here's what I need to know1) can GEL directly read the value(s) of the current instance's attributes?   if so, how?2) can GEL driectly update the value(s) of the   current instance's attributes? if so, how?3) is there a CASE statement/function construct in GEL?4) If not, I'll have to update the ODF_CA_PROJECT table directly with the values.   I know how to invoke SQL statements from GEL, but what I don't know is how to grab the project code or (system) ID of the current project that I'm wokring in so I can define the SQL WHERE clause to make sure i'm updating the right record.5) what's the best way to invoke/trigger this GEL script?    Am I overlooking anything else?  Thanks in advance for the helpBeekerC

Outcomes