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     [SOLVED] Retaining previous value in Read/Write Grid.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Retaining previous value in Read/Write Grid.
 Login/Join
 
Guru
posted
Hi,
I have a Read/Write Grid in which I want to retain previous values of columns before any update made on it. On Update, I want to use those values to update the records with new values based on the previous value stored. How can i retain the previous values of columns in maintain function? Please advice.

Thanks,
Anil

This message has been edited. Last edited by: Kerry,


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Guru
posted Hide Post
Hi,
I am using below piece of code to store previous values and updated values.

Case UpdateMandate

Compute tm/i10=1;

repeat EntMandateStk.Foccount

compute LateCicLev1/A5V = EntMandateStk(tm).CIC_LEVEL_1_AND_2;
compute LateCicLev3/A1 = EntMandateStk(tm).CIC_LEVEL_3;
compute LateCicLev4/A1 = EntMandateStk(tm).CIC_LEVEL_4;
compute LateManPct/D10.2 = EntMandateStk(tm).MANDATE_PERCENTAGE;

type "name1 <<LateCicLev1";
type "name2 <<LateCicLev3";
type "name3 <<LateCicLev4";
type "name4 <<LateManPct";


ReloadMandate( );

compute PrevEntity/A5V = EntMandateStk(tm).ENTITY_ID;
compute PrevCicLev1/A5V = EntMandateStk(tm).CIC_LEVEL_1_AND_2;
compute PrevCicLev3/A1 = EntMandateStk(tm).CIC_LEVEL_3;
compute PrevCicLev4/A1 = EntMandateStk(tm).CIC_LEVEL_4;

type "name5 <<PrevEntity";
type "name6 <<PrevCicLev1";
type "name7 <<PrevCicLev3";
type "name8 <<PrevCicLev4";

Compute rup/i8;

Compute SQLUPDMAN/A1000 = "UPDATE FRD_REPORTING.ENTITY_MANDATE_VIEW MANUPD SET CIC_LEVEL_1_AND_2 = '"|LateCicLev1|"', CIC_LEVEL_3 = '"|LateCicLev3|"', CIC_LEVEL_4 = '"|LateCicLev4|"',MANDATE_PERCENTAGE = "|LateManPct|", LAST_UPD_DATE = sysdate ,LAST_UPD_USER = '"|userIds|"'  WHERE ENTITY_ID = '"|PrevEntity|"' and  EFF_DATE = to_date('"|MandateEffDt|"','dd/mm/yyyy') and  CIC_LEVEL_1_AND_2 = '"|PrevCicLev1|"' and  CIC_LEVEL_3 = '"|PrevCicLev3|"' and  CIC_LEVEL_4 = '"|PrevCicLev4|"'";

rup=sys_mgr.engine("SQLORA","SET DEFAULT_CONNECTION FILFRDD1.world");

rup=sys_mgr.engine("SQLORA",SQLUPDMAN);
 
rup=sys_mgr.engine("SQLORA","commit");

-*type "name <<SQLUPDMAN";

compute tm=tm+1;

Endrepeat


ReloadMandate( );

EndCase


Here, On Clicking UPDATE button, this function is called. Now the stack, EntMandateStk currently contains the updated values which user want to have in Grid.So, Iam fetching these values in variables. Now for previous values, I reload the stack from DB table by using ReloadMandate( ) function. Again, Iam fetching previous values in variables. Now, I have previous and updated values with me . Then, I am using these values to fire UPDATE statement on DB to update the records.
The problem is that, For first record, I am getting previous and updated values as expected. But from second record onwards, previous and updated values are same.i.e both the variables contains previous values of columns. Due to this, Iam able to update only first record.Rest of them are not getting updated. Can any one please tell me where my code is misbehaving? Please help as this is very urgent and let me know if any further input is needed.

Thanks,
Anil


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Virtuoso
posted Hide Post
Anil

You need to be looking at 2 stacks, not one. You are overriding the updated stack with old values.

Is this a persistent Maintain application?

If so, Infer a new stack, same as EntMandateStk & COPY original stack into this. Then use this copy for the previous values. Then you don't run the first ReloadMandate in this part of the process.

If not persistent, run a new case version of ReloadMandate before the Repeat, to get the previous values into a new stack, again use for previous values.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Guru
posted Hide Post
Thanks a lot. I got your point. Smiler

Warm Regards,
Anil


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report 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     [SOLVED] Retaining previous value in Read/Write Grid.

Copyright © 1996-2020 Information Builders