I have migrated Oracle Forms 10g to 12c and unusual issues occurring in 12c. Here is one of the issues feedback from users.
I have a form that have certain required fields. When users leave the item blank, error message "Field are required" display on form status bar. It is usual that users cannot go to next field until put something in the required item.
In 10g, users could tab backward leaving required field blank without error, but not in 12c anymore.
I came out a method which something like that (cannot say it is solution at all):
Step1. Initial Required to "Yes" in the item property platelet.
Step2. Create key-prev-item to the required items and put the following code:
If get_item_property(:system.cursor_name, required) = ‘true’ then
Set_item_property(:system.cursor_name, required, property_false);
End if;
Step3. Create key-next-item to the required items and reset the required property to true.
It looks silly and unreliable since the more codes you create, the more bugs will coming out.
Is there any build-in function in Oracle Form 12c handle such case?
Many many thanks
I think it is better to use the DEFER_REQUIRED_ENFORCEMENT at that moment.
We do this like that, we set it to true if we navigate out of the item and false after the navigation.
Usage Notes from oracle formsbuilder help to explain difference between option Yes and 4.5:
This property applies only when item-level validation is in effect. By default, when an item has Required set to true, Oracle Forms will not allow navigation out of the item until a valid value is entered. This behavior will be in effect if you set Defer Required Enforcement to No. (An exception is made when the item instance does not allow end-user update; in this unusual case, a Defer Required Enforcement setting of No is ignored and item-level validation does not take place.)
If you set Defer Required Enforcement to Yes (PROPERTY_TRUE for runtime) or to 4.5 (PROPERTY_4_5 for runtime), you allow the end user to move freely among the items in the record, even if they are null, postponing enforcement of the Required attribute until validation occurs at the record level.
When Defer Required Enforcement is set to Yes, null-valued Required items are not validated when navigated out of. That is, the WHEN-VALIDATE-ITEM trigger (if any) does not fire, and the item's Item Is Valid property is unchanged. If the item value is still null when record-level validation occurs later, Oracle Forms will issue an error.
When Defer Required Enforcement is set to 4.5, null-valued Required items are not validated when navigated out of, and the item's Item Is Valid property is unchanged. However, the WHEN-VALIDATE-ITEM trigger (if any) does fire. If it fails (raises Form_Trigger_Failure), the item is considered to have failed validation and Oracle Forms will issue an error. If the trigger ends normally, processing continues normally. If the item value is still null when record-level validation occurs later, Oracle Forms will issue an error at that time.
Setting a value of 4.5 for Defer Required Enforcement allows you to code logic in a WHEN-VALIDATE-ITEM trigger that will be executed immediately whenever the end-user changes the item's value (even to null) and then navigates out. Such logic might, for example, update the values of other items. (The name "4.5" for this setting reflects the fact that in Release 4.5, and subsequent releases running in 4.5 mode, the WHEN-VALIDATE-ITEM trigger always fired during item-level validation.)
Migration note: If your Forms application used "4.5" as the Runtime Compatibility Mode property setting, the Oracle Forms Migration Assistant will automatically set the Defer Required Enforcement property to "4.5" because the Runtime Compatibility Mode property is obsolete in Oracle Forms.
Related
Can I add an unique custom field inside a work item.
So when a new work item is added, a validation error occurs if a previously added work item already contain a that value.
I've tried inside the "Rule" section of work item customization, but without success
There is no built-in rule to enforce uniqueness. The only field that is guaranteed to be unique is the work item ID.
It is possible to create a custom control that uses the REST API to query whether the contents of a field are unique and have it enforce that uniqueness. But that has a few caveats. The rule will only be enforced in the UI, other experiences (like bulk changes, excel etc) won't triggr this validation. Direct manipulation through he REST API won't either. And I would expect concurrency problems when you venture in this direction.
I'm experiencing a very weird issue with "data has been changed" errors.
I use ms access as a frontend and postgresql as backend. The backend used to be in ms access and there were no issues, then it was moved to sql server and there were no issues there either. The problem started when I moved to postgresql.
I have a table called Orders and a table called Job. Each order has multiple jobs, I have 2 forms, one parent form for the Order and one Subform for the Jobs (continuous form). I put the subform in a separate tab, first tab contains general order information and the second tab has the Job information. Job is connected Orders using a foreign key called OrderID, Id of Orders is equal to OrderID in Job.
Here is my problem:
I enter some information in the first tab, customer name, dates etc, then move to the second tab, do nothing in the second tab, go back to the first one and change a date. I get "The data has been changed" error
I'm confused as to why this is happening. Now why I call this weird?
First, if I put the subform on the first tab, I can change all fields of Orders just fine. IT's only if I put it on the second tab and, add some info, change tab, then go back and change an already existing value that I get the error
Second, if I make the subform on the second tab Unbound (so no ID - OrderID) connection, I get the SAME error
Third, the "usual" id for "The data has been changed" error is Runtime Error 440. But what I get is Runtime Error: "-2147352567 (80020009)". Searching online for this error didn't help because it can mean a lot of different things, including "The value you entered isn't valid for this field" like here:
Access Run time error - '-2147352567 (80020009)': subform
or many different results for code 80020009 but none for "the data has been changed"
MS access 2016, postgresql 12.4.1
I'm guessing you are using ODBC to connect Access to Postgresql. If so do you have timestamp fields in the data you working with? I have seen the above as the Postgres timestamp can have a higher precision then Access. This means when you go to UPDATE Access uses a truncated version of the timestamp and can't find the record and you get the error. For this and other possible causes see:
https://odbc.postgresql.org/faq.html#6.4
Microsoft Applications
Details
I have an activity diagram for Login section designed in Eclipse Papyrus. Now I have to write OCL constraints for the following conditions:
a username must be string and < 8 characters
a password must be numeric+special chars and > 10 characters
a user can attempt maximum up to 5 times otherwise the system will lock the login
My Effort
I already done this in class diagram like this but don't know how to apply constraints in activity diagram. I have read a lot of articles, watched videos and research papers and checked questions like this, this, this and this but none of them provide a proper answer.
Sample of my activity diagram image
This doesn't seem to have much to do with Activity Diagrams. Your new wording is clear, 5 attempts on one form or one attempt on each of five forms is bad, so User_Account::failedAttempts (rather than login::attempts) is a sensible model feature.
The Constraint is most eaaily defined as an upperbound of 5 on User_Account::failedAttempts. Note that a Constraint defines what is valid not how to react to invalidity. You could more use an invariant to upperbound against a maximumAttempts() computed value. You could inadvisedly use pre/ postconditions on operations or just knit your control operations.
You could sensibly have a User_Account::isLocked() operation whose body is failedAttempts >= maximumAttempts().
The Activity provides the Control for the Model. Presumably it has a lifeline associated with creation/destruction of a login. Presumably it makes use of a DataBase::checkPassword(userName, password) operation that return the User_Account and increments User_Account::failedAttempts as a side-effect. The enforcement of the maximum is therefore in User_Account::checkPassword.
(NB you should not do two stage access for User_Account lookup then password validation to ensure that hackers cannot distinguish, possibly just by response time, whether a failure is due to a bad username or bad password.)
You need to clearly identify what is in the Model; what persists for the duration of your system, perhaps being restored from backup following a system restart. Therefore User_Account must have username and password and failedAttempts properties to define the persistent state.
Conversely what is part of the View/Control can be lost and recreated when another user interaction is initiated. The login form therefore also has username and password properties to represent what is entered on the form and which will be correlated with the Model DataBase by perhaps DataBase::getUserAccount and UserAccount::checkPassword.
I would not pollute the persistent DataBase model with transient login content. If you require recreation of in-progress login attempts across a server failure, I would have a separate ViewDataBase of transient viewed state. If nothing else you would recover the server failure by reactivating the persistent DataBase before reactivating the transient activities.
I have a form with a ViewModel and several (maybe prefilled) fields. One of the fields, a checkbox, is only accessable by the admin and not present for normal users. I create my fields with #Html.TextboxFor(...).
When a normal user submits the form all data will be passed correctly, but the value for the admin-field in the Model has the default value (false). If the value was true before the action, the value will be changed,but the user shouldn't be able to do this.
How can I submit the value from the given ViewModel, which the Controller sends to the View for prefilling, if there is no Checkbox?
Note:
I don't want to create two forms for normal users and admins.
A hidden field for the checkbox value also can be changed by the user.
Without code, it's difficult to say exactly where your problem lies, but in general, if you're handling the post data properly, you won't have any issues.
You mention a view model, but if you are in fact using a view model, it's unclear why you're having problems. If you don't want the boolean reset by the post data, then simply don't map that property over to your entity class. If you're using some sort of automatic mapping that does this, then you should set that property to be ignored, so that it's not included.
Additionally, you should make sure you're starting with the existing entity, pulled fresh from the database, which would in this case have the boolean set to true. Then, when you map over the values from your view model (excluding this boolean property), it will remain true. If you're creating some new instance based on the view model, there's no way to know it was initially true.
I have a very long order form that enables saving drafts. If saved as draft, only order name is required but when actually placing an order a more thorough validation is required. I implemented this by using different validation groups. When editing the order I display two buttons: "Save draft" and "Place order". Each of them performs validation using a different validation group.
But now I would like to make a button on the list of orders which enables to change order status from 'draft' to 'placed' directly. To do so, validation must be performed without displaying edit form and submitting it. I would just like to validate the entity that is already in the database. I can use the validator service and everything is simple as long as the data is valid. But in case data isn't valid, I would like to redirect user to the edit form with fields with missing data highlighted. The idea seems to load data from database into the form and run validation as if that data were sent using a browser but execution of this doesn't seem to be trivial because Symfony2 triggers validation on form only when binding the request.
I was going through the Symfony source code and found s class called Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener. It seems to attach itself on the FormEvents::POST_SUBMIT event. Is there a way to trigger this event manually from the controller without request binding? Or are there any alternative approaches to my problem?
Just to point out the correct answer already given by Matjaž Drolc in the comments:
If you want to validate a form without getting the data from the request, you have to call the form->submit() function, because Symfony does not validate the fields if they are not marked as submitted, which is done by this function.
Call the function like this
$form->submit(array(), false);
With an empty array as the submitted data and not clearing the missing fields.