Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Mainatin - how to do dynamic expressions

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Mainatin - how to do dynamic expressions
 Login/Join
 
Member
posted
I have an error table which holds a column name on another table where an error occurred. I would like to build a compute expression to pull the offending column's value into an edit box for correction. How do you build a dynamic compute substituting a column name into a stack call. Example below:

compute editvalue = 'Form1.EditBoxCorrection.Text = HNPStk(HNPStk.focindex).'||'FormErrorStk(FormErrorStk.focindex).ERROR_COLUMN_NAME';

compute Form1.EditBoxCorrection.Text = ?editvalue;


Thanks
K Mann
wf 7.1.6 win


K Mann
WF 7.1.4 Win
 
Posts: 25 | Location: NY | Registered: October 16, 2003Report This Post
Virtuoso
posted Hide Post
Directly, I don't believe you can.

Indirectly, the approach I've used in the past is to EXEC a table request to return the data, passing the column name as a variable to a TABLE request that returns the column data.

EXEC getColumnData from columnName into columnDataStack;

where columnDataStack has one field, columnInfo, which is then referenced in the compute.

The TABLE would be something like:

TABLE FILE fileName
PRINT &1
ON TABLE PCHOLD
END

You might be able to do something with classes, but I would have to think about that first.

Or you may be able to pass the 2 stacks to another maintain that can then return the value. Again I would have to think about that one.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
This is actually easier than it seems. You don't have to worry about creating dynamic stack values. Just compute the value from one stack to another.

For example, assume that MOVIESTK.TITLE has the offending value. We can create a temporary field to contain and display the error value to correct. You can go:


Compute ErrorStk.EditField/a50;
Compute ErrorStk.EditField = Moviestk.Title;

Once the user makes the correction you have:

Compute Moviestk.title = ErrorStk.EditField;

This assumes single edit fields. If you are using a multi-row stack, just use indices:

Compute ErrorStk.EditField/a50;
Compute ErrorStk.EditField = Moviestk().Title;

Once the user makes the correction you have:

Compute Moviestk().title = ErrorStk.EditField;

I hope this helps.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Virtuoso
posted Hide Post
Don't know if I'm missing something here. If there is one stack holding values:
colstk(1).columnName='COUNTRY';
colstk(2).columnName='CAR';
colstk(3).columnName='MODEL';

and another stack:
datastk(1).COUNTRY='ENGLAND';
datastk(1).CAR='JENSEN';
datastk(1).MODEL='INTERCEPTOR';

I thought the question was how to relate colstk(n) to datastk column n. An error has occurred and colstk.focindex eq 2, columnName eq 'CAR', so there is a need to place datastk(1).CAR into the variable editValue.

e.g.
editValue=datastk(1).colstk(2);
which cannot be done directly.

Or am I having a wrinkly moment.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
On Mainframe, there use to be the command:
WINFORM GET FORM.FOCUS INTO var
and Var would contain the name of the object that currently had focus. This does not seem to be available anymore. However, if you are going to validate when on Change or Blur, you can compute the name of the current field into a variable.

In the Change trigger:
COMPUTE CURFIELD = "Fieldname";
Perform Validate

You would have to compute the name for every object, but it would work.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Member
posted Hide Post
Thanks everyone, looks like there isn't an easy way to do this. I will end up hardcoding the colums with errors, turns out there only is about a dozen that have to be edited. Not elegant but it will work.

Kim


K Mann
WF 7.1.4 Win
 
Posts: 25 | Location: NY | Registered: October 16, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Mainatin - how to do dynamic expressions

Copyright © 1996-2020 Information Builders