Issues on wrong date format in oracle forms - oracle

If I give wrong date in one block field it should not allowed to enter other block in oracle forms.
eg:- in date field I'm entering values like MUHUTHUTHU after that I'm moving cursor to next block. first time I'm getting an error mesage FRM-50026 (wrong date format) but the cursor moved to other block.
But I don't want to allow to another block. Thanks to help me out from this issue.

If you specify the format mask property of that item as a valid date format (MM/DD/RRRR for example), Forms should take care of it by itself.
If not, you need to check the date format in the WHEN-VALIDATE-ITEM trigger and if it's not a valid date then raise the FORM_TRIGGER_FAILURE exception:
RAISE FORM_TRIGGER_FAILURE;
That will keep the cursor in that field.

The default functionality if the entered data is not valid according to the format mask is that the focus stays in the item. It is though possible to accidently or not override the default functionality. You can e.g. use On-Error trigger to override the default error handling and of you forget to call RAISE FORM_TRIGGER_FAILURE after your custom error handling then the program flow will continue as no error have happen at all.

Related

Catching user input from popup with validation?

I am trying to put in a variable a value that the user has to introduce from a popup.
I have seen the function POPUP_GET_VALUES can be the adiente, but in the parameters that the function requires I see that there is a table to put the value into a field. As it is a unique value, I would like to put it within a single variable previously defined, in order to also be able to establish limits for the user to enter the value, since it has to be a percentage.
Any ideas?
Thanks!
You can use FM POPUP_TO_GET_ONE_VALUE and specify texts you want. But you should then check the format of input. For POPUP_GET_VALUES you need a table and field to reference, it will check the format for you.

A validation error occurred in dynamics-crm

In my code, I insert from one date field to another date field, then update my entity with the new data and debugging my code. I get this exception:
A validation error occurred. The value of on record of type is outside the valid range.
When I change the same field in CRM UI I get no error. Where should I look for? What is the problem?
Normally this error will look like:
A validation error occurred. The value of 'field_name' on record of type 'entity_name' is outside the valid range.
You have to make sure, if the field is optionset - then the value (ex.10000000) passed in code is within the available range of options in optionset customization (ex: 10000000, 10000001, 10000002)
You said date field, verify if the date fields between the entities are of same type (like date only, date time, timezone specific, etc). Also the retrieval from CRM using SDK will give you UTC whereas the date value assignments in code while create/update will be parsed to UTC.. check that too for possible date range like 31st November 2017.

Oracle Form 12c field showing hash instesad of number

I am working on Oracle forms 12c and facing an issue with few fields showing as hash(####) values instead of number field on data block when saving changes by clicking on SAVE (commit) button.
Also showing below error
(FRM-40735 KEY COMMIT Trigger raised unhandled exception ORA-01483)
it seems that it is due to change of field item from number to HASH (string)
For further information:-
-Fields are database items
-Trying to insert value in database fields by entering value on field.
-Size of fields are more than entered number value.
-on re-querying data block using (f7 & f8) data is showing correctly as number.
-Not able to recreate this issue on different database(working fine on other database)
is it something related to environment issue or minor bug while coding?
If the Returning_Dml_value property on datablock is set to Yes,it sometimes causes junk values to be populated and asks a requery on block. Try setting it to No instead.I faced a similar issue once and it got resolved by setting Returning_Dml_value property to No.
The following blog explains more about this property of Oracle forms:
http://cave-geek.blogspot.co.uk/

Exception handling using Oracle Forms Builder

I am making my first Oracle form in Oracle Forms Builder with the help of web material i.e. tutorials etc. I have written the following code in the WHEN-BUTTON-PRESSED trigger:
INSERT INTO PATIENT VALUES
(:CNIC_NO, :P_NAME, :CITY, :ADDRESS, :GENDER, :BLOOD_GROUP, :DISEASE, :WARD_NO);
COMMIT;
The problem here is that an unhandled exception is raised by the trigger with the following error numbers:
ORA-12899 (Reason is the Null value is inserted in non-Null column)
ORA-1400 (Reason is that the data length is too large than the allowed length)
I need to popup an informative message box for these and a default one for the others.
First of all I would avoid this errors by builtin Oracle forms validation. Set Required property to True on property panel for all items, which are based on not null database columns. Oracle forms then forces user to enter a value.
Next set Datatype and Maximum length properties to set basic data validations.
This should be enough in your case. If your still want to catch an exception, use code like this:
begin
INSERT ...
exception
when others then
message(DBMSERRTEXT);
end;
Anyway - it is not good idea to insert data using when button pressed triggers. It is not transaction safe. Use standard forms block. Oracle forms does all the data validations and manipulations for you.
You have either to guarantee there is a suitable value will be inserted in the specified column that doesn't accept null value the you have to use NVL function inside the insert statement. Well, it's quite a good idea to have a technique too.
handle Oracle Forms errors and informative messages
You have also to construct your table columns size larger enough to store the inserted as the address for example must be larger than 100 varchar2.
You can use The Default Oracle Forms Menu Tool Bar will handle the form's CRUD Operations for you. Instead of writing the insert,update,etc.
But, you have to specify using it by yourself for every form module.

How do I set an SSRS Parameter that doesn't have a value to something else?

I have an SSRs Report with a parameter that gets information from SQL. If it hasn't found anything, at the moment it is just empty. Is there anyway to set it such that if it's empty it will return a different value, say "Please Extend Date Ranges" and disable the parameter?
If you using it to fill it using the SQL and using it for only internal purposes then there is option to make the parameter internal and it will be hidden and it will does not prompt the user.
Make a change to the stored procedure or query that populates the parameter. Include some logic so that if no results are returned by the query you are using now, it adds a row with the default label you want.
But no, you can't disable the parameter dynamically, I don't believe.

Resources