Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, February 23, 2025 
 
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 - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Dynamically created datagrid does not show correct date
SLX_Novice
Posts: 246
 
Dynamically created datagrid does not show correct dateYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Feb 12 9:06 AM
fiogf49gjkf0d

Hi all.


We have SLX LAN v7.2.1.


I created a grid dynamically and one of the fields is "Last Purchase Date". In the table the "Last Purchase Date" is 01/20/2012, but what appears on the datagrid is 01/19/2012.


Any idea why this is happening and how I can fix this?


 


Below is the code used for the column



             Set col = .Add(0)


             col.FieldName = "LASTPURCHASEDATE"


             col.Caption = "Last Purchase Date"


             col.Readonly = True


             col.FormatType = ftDateTime


             col.FormatString = "ddddd"


             col.Width = 100


             col.Alignment = 2


             col.HeaderAlignment = 2


[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Dynamically created datagrid does not show correct dateYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Feb 12 9:31 AM
fiogf49gjkf0d

Unless you defined the field correctly, SLX will assume that your Date is GMT and will convert it to Local Time Zone.


So, if your Store Date is '2012-02-14 00:00:00.000', the SLX Provider will convert it to local time (e.g. EST 2012-01-13 19:00:00.000').


 


There is also a detail on SLX storing a 5 second past midnight Time Stamp onto a date to signify that it is a Timeless Date, and in that case the Provider will also not convert the date:


e.g. '2012-02-14 00:00:05.000'  will not be converted to Local Time.

[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Dynamically created datagrid does not show correct dateYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Feb 12 9:34 AM
fiogf49gjkf0d

Thanks for the reply Raul.


The Last Purchase Date field is taken from our ERP software, so I don't know how I would define it "correctly". Could you elaborate?


The date is stored in a SQL table in the following format (MM/DD/YYYY).

[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Dynamically created datagrid does not show correct dateYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Feb 12 10:19 AM
fiogf49gjkf0d

Well, if that is the case, you may need to convert the date manually to GMT before reading it into SLX.


You may try adding the 5 seconds Time Stamp I mentioned to see if SLX will honor it and not convert it.


Otherwise you will have to figure out the GMT Bias (which is based on the Date value and the user's location) to apply the Conversion.


 


There may be other ways to bypass it (such as not using the SLX Provider to read the data)....

[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Dynamically created datagrid does not show correct dateYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Feb 12 10:20 AM
fiogf49gjkf0d

Just to clarify, the Date/Time Conversion is done at the SLX Provider level, not at the SLX Client or Grid or Column level.

[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Dynamically created datagrid does not show correct dateYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Feb 12 10:53 AM
fiogf49gjkf0d

I don't know how to convert the date manually to GMT so is there a way to tell SalesLogix to ignore this date field, in other words, don't convert it just read it as it is in the table?

[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Dynamically created datagrid does not show correct dateYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Feb 12 11:07 AM
fiogf49gjkf0d

I figured out something that seems to have worked:


 


UPDATE sysdba.sectabledefs SET datetimetype = 'D' WHERE fieldname = 'LASTPURCHASEDATE'

[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 © 2025 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): 2/23/2025 12:28:02 PM