Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9184437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:03:03+00:00 2026-06-17T19:03:03+00:00

I try to set a Date field on my form from inside a Silverlight

  • 0

I try to set a Date field on my form from inside a Silverlight Web Resource but the form field remains empty:

var xrm = (ScriptObject)HtmlPage.Window.GetProperty("Xrm");
var page = (ScriptObject)xrm.GetProperty("Page");
var startdate = (ScriptObject)page.Invoke("getAttribute", "scheduledstart");
startdate.Invoke("setValue", DateTime.Now.ToUniversalTime().ToString("MM/dd/yyyy"));

While the above code works fine for other field types (string, int, OptionSet, etc.) there seems to be an error in the way I try to set the date value.


Side note: I don’t use dynamic because it seems not to work when deployed in an MS CRM online environment (but works on-premise).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:03:04+00:00Added an answer on June 17, 2026 at 7:03 pm

    You’re formatting the date to a string, so it’s trying to pass a string into a Javascript Date field. Just pass it as a DateTime. The ScriptObject class is designed to convert properly from .Net to Javascript. reference here

    startdate.Invoke("setValue", DateTime.Now);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to set friendship to method from class GameSimulator on Player class. for
I have set up each document with a date field. (keyword) Values stored in
I am writing a program to try and derive value from a timeseries set
I have a field of type date in MySQL. When I try to insert
How to insert a NULL or empty value in a mysql date type field
I am trying to set a date field to null in a MS SQL
When I try to update a custom activity, the scheduledend date field is being
Second EDIT: Looks like my issue might be where the date is set from
try to set host in dsn of pdo like this: <?php /* Connect to
I try to set a timeout on an element, fired with a jQuery plugin.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.