Throw error on parameter validation fail in Reporting Servies 2008 - validation

I'm trying to validate user input on a text parameter using a VB function. I created a hidden text parameter whose default value is the expression =CODE.CheckParameter1(Parameters!Parameter1.Value).
This is the specified function:
Function CheckParameter1(Parameter1 as String) as Integer
If (Not IsNumeric(Parameter1)) Then
MsgBox("Please enter in a numeric value for Parameter 1", 16, "Validation Error")
Err.Raise(6,"Please enter in a numeric value for Parameter 1")
End If
End Function
What I want is for the report to throw an error message if the input is non-numeric. It catches the error properly, but it doesn't show my custom error message nor does it pop up an MsgBox.
How can I achieve this?

You won't be able to perform parameter validation like this in a straight Reporting Services solution. You can set the parameter to be an integer or a float and use the parameter checking that SSRS provides. Otherwise, you'll need to wrap the SSRS reports in a page (or app) of your own which gathers the parameters.
Msgbox is not supported in SSRS: it is a web application, running through a browser, and it can't popup a message.
An alternative is that you could have a conditionally displayed text box on the report itself that informed the user that some of the parameters were incorrect. This would still require the user to click the "View Report" button before getting the error.

Related

Send e-mail from an action

We are using Dynamics CRM 2016 on-premise.
I want to create an action which sends e-mails among other things.
The action has two input parameters of type "string".
I am able to use the parameters when I create an entity or in conditions in branches.
However, I am not able to use these parameters when I choose the "Send e-mail" task or if I try to create a new entity record of type e-mail.
The expression designer shows "Search for: Arguments" but the list of arguments is empty.
Any ideas why that is the case?
Edit: Image one shows the action with 2 string argumengs. Image 2 shows that I can use the argument as topic of a letter. Image 3 shows that the argument list is empty when I try to do the same for an e-mail.
I recreated the action, changed the computer, used a different user account.
Action
Letter
E-Mail

Pass parameter from dialog to custom worklow activity CRM 2016

I have a simple custom workflow activity with the following parameter:
[Input("String")]
public InArgument<string> String { get; set; }
In the execute method I only have a throw InvalidPluginExecutionException to show me the value of Sring:
throw new InvalidPluginExecutionException(String.Get(executionContext));
Then I created a dialog in crm 2016 with a page that asks for a text value and then I invoke the custom workflow activity with the value the user entered in the dialog.
But when executing after entering the text parameter the dialog gives an error when passing the value to the custom workflow activity:
Can somebody tell me what's wrong, the workflow activity parameter is just a string and the input in the dialog is also a string. If I take the parameter from the workflow and stop passing the argument from the dialog it runs as expected. I have also tried other types of InArguments ex.: int.

IBM Integration Toolkit Issue for Validation

I am working on IBM Integration toolkit. I wanted to understand the exact validation feature of a particular input node via an example. Can anyone help?
Validation on inputs node you can see them in validation tab, you can choose how to validate (content, conent and value or none if you like to implement your own vaildation and what to do if this validate is failure (Exception , Exception List , user trace, log local error),
validation done automatically depends on the message parser : [BLOB, XMLNSC, XMLNS, SOAP, MRM, ..etc ], and message structurewhich is defined in your message set.
for example :
If you create a message set with message definition file and this message definition has got and element and this element is required and integer, and you set this message set to your input node, validation feature runs automatically if you put for example string value or you left it empty validation exception occurs.

Codeigniter Form Validation - Is there a way to define multiple different %s when setting error messages?

Based on the documentation, %s will be replaced by field name when setting error messages.
If you include %s in your error string, it will be replaced with the
"human" name you used for your field when you set your rules.
Is there a way to have multiple %s in the string and define them differently?
This is the line in the form validation library that creates the error message:
// Build the error message
$message = sprintf($line, $this->_translate_fieldname($row['label']), $param);
$line: The error message template, for example "The % field is invalid"
$this->_translate_fieldname($row['label']): The field's label
$param: The parameter passed the the validation function, if any, max_length[5] would pass "5"
So that's the extent of what the form validation class does for you. If you need more flexibility you'll have to prepare the error message yourself <-- might be useful beforehand with the extra variables already populated.
It might be interesting to extend the form validation class via core/MY_form_validation.php and work this functionality in. Unfortunately this line is contained in the main function _execute which is very big and messy, and from looking at it now, you'd need to overload some other functions as well. I started to write an example but it actually looks like a chore. You might be better off using:
$this->form_validation->set_message('rule_name', 'Your custom message here');
More on setting error messages: http://ellislab.com/codeigniter/user_guide/libraries/form_validation.html#settingerrors

rememberMe occurs randomly without fiddler

ASP.net MVC 3 out of the box forms authentication
when certain users on certain browsers try and authenticate they get the following error
Server Error in '/MVC' Application.
--------------------------------------------------------------------------------
The parameters dictionary contains a null entry for parameter 'rememberMe' of
non-nullable type 'System.Boolean' for method 'System.Web.Mvc.ActionResult
LogOn(System.String,
System.String, Boolean, System.String)' in 'RipsMVC.Controllers.AccountController'. An
optional parameter must be a reference type, a nullable type, or be declared as an
optional parameter.
Parameter name: parameters
the problem is its not all the time but whenever i turn on fiddler2 it automatically works so i have no clue what the root cause is .
I don't think it related to fiddler, maybe you need to make rememberMe with [DefaultValue(false)] or make it a bool?.
Anyway, you can setup a breakpoint and check the request body (using Request.Forms) to see the difference with/without fiddler.
Is remember me a checkbox on the form? HTML says that checkbox values are only submitted if they are checked. So if it is unchecked, you need to send a hidden field with a false value. Using MVC #Html.CheckBox should do this automatically. However, if your HTML just renders out a single checkbox, then it might not be submitted to get a false value on the server.

Resources