Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, April 23, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - Controls
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Controls | New ThreadView:  Search:  
 Author  Thread: data in datagrid is getting updated with a hard refresh
Dan Delisle
Posts: 38
 
data in datagrid is getting updated with a hard refreshYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Mar 14 4:53 PM

Hello everyone,


I created a datagrid and a simple data entry form (example from Active Forms section of DevLogix III.7) and tailored it to my own use. I then added some labels to the form where the datagrid resides. The idea is that when a user clicks on a node in the grid, the labels will be populated with the values from the grid (see code below). The intention is to not make the user have to scroll in the datagrid. This works really well except for one thing....


when testing, I did a ctrl-F5 and saw that the values within my datagrid changed. What appears to be happening is that the values that are showing up in my label's are getting posted back to the database and updating another record on the grid when a hard refresh occurs.


I dont understand why this is happening. I'm using SLX 7.5.0.1 (LAN).


Thank you in advance


 


<pre>Sub grdMainChangeNode(Sender)
lbCorpDir.Caption = grdMain.GetCurrentField("CORPDIRECTORY")
lbOffsiteName.Caption = grdMain.GetCurrentField("OfficialSiteName")
lbSiteDir.Caption = grdMain.GetCurrentField("SiteDirectory")
lbSiteNum.Caption = grdMain.GetCurrentField("SiteNumber")
lbURL.Caption = grdMain.GetCurrentField("CLMURL")
lbVersion.Caption = grdMain.GetCurrentField("CLMVERSION")
lbSDSAdmin.Caption = grdMain.GetCurrentField("SDSAdmin")
'nodes(0).Values(1)
End Sub

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: data in datagrid is getting updated with a hard refreshYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Mar 14 6:02 PM

There can be several reasons for this - but to avoid all of them, set the RowSelect to True and the PostChanges to false - and, ensure that none of the labels are bound (.Text) to any of the columsn in the db.

[Reply][Quote]
Dan Delisle
Posts: 38
 
Re: data in datagrid is getting updated with a hard refreshYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Mar 14 10:39 AM

Pure genius! Thank you very much Mike.


 


One more question if I may..... For some reason I cannot use my data form to insert a new row into my table if a row (for that accountid) does not already exist. My primarykey is set to auto increment. I have never had any success getting SLX Profiler to work, but using SQL profiler it appears that it never even tries to do an insert. This only happens if a record doesnt already exist in the DB for that account.


Any thoughts on this one?

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: data in datagrid is getting updated with a hard refreshYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Mar 14 3:56 PM

Good news


Basically, for this to work you need a grid, bound correctly and an add/edit form that is linked up as well. So:


1) Add a new form/tab based on Account. Add a grid and make sure the BindID of the grid is set to the primaryID (such as AccountID)


2) Create a new form that is based on the table you wish to add to (say, c_mydata). This is created in architect as a 1:M from account. It will have c_mydata.AccountID added automatically. Save the form.


3) In the Edit View of (1) - select the form created in (2)


4) In the SQL property of the grid - select the secondary table (created in 2). In the Join box - drag in the AccountID from the secondary table (from 2 - c_myData.AccountID)


That's it !

[Reply][Quote]
Dan Delisle
Posts: 38
 
Re: data in datagrid is getting updated with a hard refreshYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Mar 14 9:56 AM

Hi Mike,


I finally figured out what my problem was.....I went through a 3rd time and validated that I did exactly as you suggested and I was still getting the problem. I then used my brain (it doesnt always work ) and really thought about the issue I was having. I checked my JOINS in architect and realized I had the join from my new table to ACCOUNT set as an INNER. I changed it to LEFT and all is good in the world.


Thanks again for all your help. It is much appreciated!


 

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 4/23/2024 8:19:00 PM