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     [CLOSED] Updating columns in Read/Write Grid.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Updating columns in Read/Write Grid.
 Login/Join
 
Guru
posted
Hi,
I have a Read/Write Grid to directly update the datasource.There is a column in datasource, USERID which is not displayed in Grid.I want to capture the userid who has logged in to the application and update the USERID column only for the rows which user has updated.Rest of the rows will not be affected.I know userid can be captured using
  Declare userId / A7 = IWC.getAppCGIValue("IBIC_user");


But I don’t know how to update the rows with this value only for the rows which are updated.Can anyone please suggest some way to handle this?

Thanks in advance.

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
Master
posted Hide Post
Ok
Let's assume that your stack is named stk1 and that your first grid column is NAME. Also, is this is non-persistent application? If now, then UserID can be retrieved from a variable on the form. This is the code:

Declare userId / A7 = IWC.getAppCGIValue("IBIC_user");
Compute i/i3=1;
Repeat stk1.foccount
if stk1(i).name = '' then goto exitrepeat
Compute stk(1).userid = Userid
Compute i=i+1;
Endrepeat
For all include / update ...

So, check each row of the grid. If there IS data, add the value for UserId into the stack. Do it for all rows, and then include / update your data.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Guru
posted Hide Post
Hi,
I tried the way u suggested to update USERID column but the value in datasource is not getting updated at all.Below is the function I am using:


 
Case UpdProdMap

Compute i/i6=1;
Repeat EvestProdMapDispStk.foccount
if EvestProdMapDispStk(i).fund_id = '' then goto exitrepeat
Compute EvestProdMapDispStk(i).userid/A20 = userId;
type EvestProdMapDispStk(i).userid;
Compute i=i+1;
Endrepeat

 
For all update evest_product_map.EVEST_PRODUCT_MAP.FUND_NAME evest_product_map.EVEST_PRODUCT_MAP.INVEST evest_product_map.EVEST_PRODUCT_MAP.BASE evest_product_map.EVEST_PRODUCT_MAP.REPevest_product_map.EVEST_PRODUCT_MAP.MANAGER evest_product_map.EVEST_PRODUCT_MAP.USERID evest_product_map.EVEST_PRODUCT_MAP.LAST_MOD_DATE from EvestProdMapDispStk ;
commit;


EndCase
 


I have a doubt, here we are checking first column which is FUND_ID in the grid whether it is blank or not and then computing the userid and this value will be updated in stack.As there is no FUND_ID as blank in our stack it will update all the rows in the stack with userId value which is not the objective here.How it is supposed to update only those rows which are updated.I am not understanding that.Please help.

Thanks.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Master
posted Hide Post
The first question, is where is the value for UserId coming from? If it is coming from outside of the application, then use the code that you had:
Declare userId / A7 = IWC.getAppCGIValue("IBIC_user");
That is fine. I thought that value was being entered on the screen. Once you have that value, then you can use:
Compute EvestProdMapDispStk(i).userid/A20 = userId;
and it should find the value.

Next, if you only want to update the rows that have been changed, the best thing to do is to create an update flag. If any of the columns in a row are changed, place a Y in an update column. Then do a stack copy from the main stack into an Update stack where the flag = y. If you need help with this code, please e-mail me at:
Mark_Derwin@ibi.com and I will send it to you.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 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     [CLOSED] Updating columns in Read/Write Grid.

Copyright © 1996-2020 Information Builders