jeannie322
Programmer
I am using Forms 5.
I have a field (FSC) with a LOV attached. There are essentially 2 values in the lov,
0 = no MSDS
1-7000 = various descriptions for the MSDS(material Safety Data Sheets)
if they choose 1-7000 it populates the field (DESCR) with the description of the MSDS they chose and then disables it so they cant put in any garbage.
But if they chose 0 from the LOV in the field (FSC) then it enables the field (DESCR) and they can input whatever they want for the item description.
The problem I have is I am not sure which trigger I need to use to accomplish my goal. I have put a WHEN-VALIDATE-ITEM trigger on the FSC field with the following code
if r_items.fsc = 0
then
set_item_property('pr_items.descr',enabled,property_TRUE);
elseif
r_items.fsc is NULL then
set_item_property('pr_items.descr',enabled,property_TRUE);
else
r_items.descr := r_items.msds_desc;
--populates the descr field with the MSDS description
set_item_property('pr_items.descr',enabled,property_false);
--disables the DESCR field
end if;
I can create a record with no problem. Then when I try and update the record it
will not ENABLE the property on the DESCR field when I choose a 0 value for the FSC field. But I can change it to any value between 1-7000 and it will populate the DESCR field and disable the DESCR as well (that is what I want it to do).
Also, The initial value of the DESCR field is set to YES (TRUE).
Can anyone suggest a trigger to use when updating the record to allow the DESCR field to accept update when I chose a value of 0 for the FSC field. It just gives me the
error FRM-40200: FIELD IS PROTECTED AGAINST UPDATE. -referring to the
DESCR field.
If you need any further info, please let me know..
Thanks in advance!!!!!!!!
I have a field (FSC) with a LOV attached. There are essentially 2 values in the lov,
0 = no MSDS
1-7000 = various descriptions for the MSDS(material Safety Data Sheets)
if they choose 1-7000 it populates the field (DESCR) with the description of the MSDS they chose and then disables it so they cant put in any garbage.
But if they chose 0 from the LOV in the field (FSC) then it enables the field (DESCR) and they can input whatever they want for the item description.
The problem I have is I am not sure which trigger I need to use to accomplish my goal. I have put a WHEN-VALIDATE-ITEM trigger on the FSC field with the following code
if r_items.fsc = 0
then
set_item_property('pr_items.descr',enabled,property_TRUE);
elseif
r_items.fsc is NULL then
set_item_property('pr_items.descr',enabled,property_TRUE);
else
r_items.descr := r_items.msds_desc;
--populates the descr field with the MSDS description
set_item_property('pr_items.descr',enabled,property_false);
--disables the DESCR field
end if;
I can create a record with no problem. Then when I try and update the record it
will not ENABLE the property on the DESCR field when I choose a 0 value for the FSC field. But I can change it to any value between 1-7000 and it will populate the DESCR field and disable the DESCR as well (that is what I want it to do).
Also, The initial value of the DESCR field is set to YES (TRUE).
Can anyone suggest a trigger to use when updating the record to allow the DESCR field to accept update when I chose a value of 0 for the FSC field. It just gives me the
error FRM-40200: FIELD IS PROTECTED AGAINST UPDATE. -referring to the
DESCR field.
If you need any further info, please let me know..
Thanks in advance!!!!!!!!