Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, June 29, 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!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Setting current date as default date in the datetimepicklist
Ramkumar Veluchamy
Posts: 8
 
Setting current date as default date in the datetimepicklistYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Feb 11 7:46 AM
fiogf49gjkf0d

Hi,


I have a requirement to default the date as current date in new mode and get the date from DB in edit mode. So i used the following code but it doesnt work.



var bg = new TypedWebEntityBindingGenerator<ICMAWSNBD>(BindingSource);





if (this.EntityContext.EntityID.ToString().ToUpper() == "INSERT")
{
this.dteDateRequested.DateTimeValue = DateTime.Now;
this.dteDateRequested.Text = DateTime.Now.ToString();
bg.AddBinding(e => e.DateRequested, dteDateRequested, dte => dte.DateTimeValue);
}








Please help me to resolve this. Thanks in advance.




[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Setting current date as default date in the datetimepicklistYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Feb 11 9:43 AM
fiogf49gjkf0d

What is that code? Strange looking to me.


Set the date on the Entity not the form if in Insert mode. Otherwise dont set it all. So if contact (onload of insert contact):


_entity.DateRequested = System.DateTime.Now;


If the field is bound, as it should be, it will always get the data from the DB - you would not need to do that in code...

[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): 6/29/2025 4:52:19 AM