Shaibaz Antule Posted July 12, 2018 Share Posted July 12, 2018 Hi, I have created an input box for showing only entered no. of days data into the report. The report holds data only for last 14 days from the current date. But, currently when user is entering a value more than 14 in the input box, it is still showing the data in the report. I want to give a validation on this input box. If user enters value >14 or =DateAdd('day',-${NumberOfDays},DateTimeNow()) Also, attached is the snapshot for the input box created. Please help if this is possible. Thank you! Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted July 12, 2018 Share Posted July 12, 2018 You can attach a IronPython script to the document Property "NumberOfDays" which validates the input value and executed when ever the document property changes. You can add a script to the property as follows, Goto Edit - Document Properties - properties tab- select the document property- on the right select script - select the radio button "execute the script selected below" and add the below script import clr import System clr.AddReference("System.Windows.Forms") from System.Windows.Forms import MessageBox days=Document.Properties["NumberOfDays"] if days14: Document.Properties["NumberOfDays"]=0 ; MessageBox.Show("Enter a valid value between 0 and 14") Link to comment Share on other sites More sharing options...
Shaibaz Antule Posted July 13, 2018 Author Share Posted July 13, 2018 Thanks so much Shandilya for the help :) The above code is working perfectly fine as per my current requirement. Thanks a ton again ! Link to comment Share on other sites More sharing options...
Amol Gargote Posted December 2, 2019 Share Posted December 2, 2019 I am getting this error when I save it as library item and open weblink. Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application. How to avoid this error Thanks Amol Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted December 2, 2019 Share Posted December 2, 2019 The issue could be because of the message box in the WebPlayer. You can remove the following code MessageBox.Show("Enter a valid value between 0 and 14") Link to comment Share on other sites More sharing options...
Amol Gargote Posted December 3, 2019 Share Posted December 3, 2019 Thanks Shandilya, Can't we show message to user in web player I am using Chrome browser. Thanks, Amol Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now