Anywhere - Field validation - maximo-anywhere

Working on Work Execution app (v 7.5.2). In MAM, Field having datatype as INTEGER (4) but when I enter values "1234567890123456789' in Anywhere, it doesn't throw error instantly but after saving, It throws "Database error number -4461 has occurred when operating on WORKLOG : WorkLog ID=1234. Report the error to the owner of the deployment."
Either User should warn immediately after entered or Need to restrict the MaxLength to enter in TEXTBOX. How to do ?

You can put some validate javascript code on the dataChange event for this field to validate that less than 4 characters were input. You can also open a PMR as this seems like a limitation that we would address in a future release.

Related

Clarity ClrFormsNextModule *clrIfError Reactive Forms

Using Clarity for a work project and I'm unsure if the new clr-control-error messages work with reactive forms. The example they provide on using multiple error messages is with template forms, but the setup should essentially be the same.
Here is my code:
<clr-input-container>
<label>Password</label>
<input clrInput type="password" formControlName="password">
<clr-control-helper>8+ Character Password</clr-control-helper>
<clr-control-error *clrIfError="'required'">Please Enter Password</clr-control-error>
<clr-control-error *clrIfError="'minLength'">Password must be 8+ Characters</clr-control-error>
</clr-input-container>
newCompanyForm = new FormGroup({
email: new FormControl("", [Validators.required]),
password: new FormControl("", [Validators.required, Validators.minLength(8)]),
I'm using #clr/angular v0.12.4, angular 6.0.2, and rxjs 6.1.0. I can see the form is still invalid once I begin to type into the input field, but the error message never switches from "Please Enter Password" to "Password must be 8+ Characters". Once the password reaches 8 characters the field is no longer invalid so I'm pretty sure the Validator is working, just the error message is not showing.
It looks like maxLength and minLength are transformed into maxlength and minlength internally on the errors object. This should fix it below, though I will investigate this and double check it works in both reactive and template-driven forms.
<clr-control-error *clrIfError="'minlength'">
the Inputs Documentation says
Note: the validation only displays an error after the user has left
focus on an input. This is for better UX where the user doesn't see an
error while they are still typing.
This means by design you'll never see error messages while you're typing

How to simulate onblur event with Robot Framework

I am automating login scenario of an application.
The execution steps are as below:
Select the Country
Enter the Username
Enter the Password
Click on Login Button.
Actually after entered the username, application validates the country and username in database exists or not.
When tried to automate through robot framework, this validation is not called and so unable to login (actually login button is clicked through script, but no error message or no response user is in same page).
When i verified exact scenario it calling the validation, comes to know that
validation is called on onblur of the usename element onblur="getlocation()".
I tried to simulate this by give tabout from username field through script as
Press Key ${element path} \\9 but it is not working always out of 10 run only 3 or 4 times it working.
Is there any way we can do 'blur` action on the element in robot framework
In the Selenium2Library for robot, there is a special keyword for that:
Simulate <element> <event>
In my keyword definition it looks like this:
I Enter The New Password
[Arguments] ${text}
Input Text ${INPUT_ELEMENT_PASSWORD} ${text}
Simulate ${INPUT_ELEMENT_PASSWORD} blur
http://robotframework.org/Selenium2Library/Selenium2Library.html#Simulate
I hope that helps, it took us a while to figure out what was missing in the test.
Just to save few minutes of googling.
Simulate
is deprecated. Use
Simulate Event
instead

Email from lookup field throwing error

We recently updated our CRM 2013 update to SP1. Afterwards the lookup field on the email form taking care of the from field, throws an error when clicked on.
When running diagnostics tool and reading with trace log viewer i see following error.
'<', hexadecimal value 0x3C, is an invalid attribute character. Line 7, position 58.
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
RequestUrl: http://mypage.com/company/AppWebServices/LookupService.asmx
I can see that different users have created emails and used the from field after i updated to SP1. So does anyone have an idea what might cause this?
Update: If i click on the field itself and delete the user the lookup works without problem. It is only if there is allready a user in the field and i try to lookup that an error is shown.

How to get resourceName for Tridion LocalizableMessage when creating new PublisherException?

I need to stop publishing of a page when a certain condition exists, for example if the page name contains 'one' using the Event System. Also, the other pages should continue to publish.
I am thinking to use a PublisherException instead of a generic exception.
The problem is the I do not know the resourceName of the LocalizableMessage. Any ideas?
if (item.Title.ToString().Contains("one"))
{
Localization.LocalizableMessage errResource = new Localization.LocalizableMessage("error");
throw new PublisherException(errResource, new Exception("Can't get there from here!"));
}
The Event System can stop Publishing, there is no middle ground there though, when you throw an exception, it stops the entire transaction.
Like Puntero mentions, if you want to remove an item from a Publish Transaction, that is where a Custom Resolver comes in. From here you cannot communicate back to the Publish Transaction, but you have access to the Tridion Logger (eventlog):
Tridion.Logging.Logger.Write("your message string", "MyResolver", LoggingCategory.General, TraceEventType.Information);
With regards to your LocalizableMessage in the Event System, you should be able to do the following:
throw new PublisherException(new LocalizableMessage(Properties.Resources.ResourceManager, "PagePublishErrorMessage"));
Where the resourceName is pointing to the name of a String resource you have in your Project.
I agree with #Puntero that if you want other page in a publish action to go through, you should use a Resolver rather than an Event Handler.
I tried to raise a warning to alert users of one item not being resolved, but failed. But there may be some good tips/ideas for you here: Raising a “warning” status during SDL Tridion 2011 publishing
In the end, the only way I could get anything to work was to set "Allow X failures", and then do a check in a template, and raise the error there. That will count as a Render failure, and allow the publisher to move on to the next item in the publish transaction.
As for the message? What message would you like to display?

Event log messages get overrriden by another event log

I create event logs for asp.net projects error logging. I do it by adding a key in regedit, and then a sub-key.
Sometimes, I create a new key and sub-key, and instead of getting a new, empty event log, I see in the event viewer that it's showing me the logs from a different project. I'm not able to find a pattern as to when this happens.
Has anyone encountered such a problem? Am I doing something wrong?
You probably want to use the EventLog.CreateEventSource API to do this - it should take care of any details for you.
A quick read thru the docs seems to show that the 1st 8 characters are checked for uniqueness...perhaps that's where your issue is?
Edit: From Reflector, the API does this...
Check for invalid characters ("non printable" based on Unicode category, \, *, ?)
Checks that the created reg key will be <= 254 characters
Checks if the source is already registered
Checks that the log name isn't reserved (AppEvent, SecEvent, SysEvent)
Checks for another log with the same beginning 8 chars
Checks that the log name doesn't exist as a source
Creates the log subkey
Initializes the log subkey with default values (MaxSize = 524288, AutoBackupLogFiles = 9. Retention = 604800, File = %SystemRoot%\System32\config\logName.Substring(0, 8) + ".evt")
If OS is not > Windows NT 5.x (Vista or higher), creates a multi string value on the logkey with logName and source name. Or, if value exists, appends source name to the existing array.
Creates a subkey for source
Initializes the source subkey with default values (EventMessageFile, ParameterMessageFile, CategoryMessageFile, CategoryCount)
It seems that the problem was that we had already created an event log with that name, and even though we deleted it, it didn't help. The solution was to create an event log with a different name.

Resources