Home » Developer & Programmer » Forms » Disabling a Current record in a multi record block
Disabling a Current record in a multi record block [message #188973] Tue, 22 August 2006 11:06 Go to next message
Praseeja
Messages: 12
Registered: February 2006
Junior Member
Hi,

The following are the two blocks in the form.
1. Account
2. Service
The Account block have following details:
1. Customer Code
2. Premises Code
The Service Block have the following fields:
1. Service Number
2. Enrollment Status (List Item)
3. Cancel Indicator (Check Box)

The following are the issues:
1. When the service is cancelled the record will be having a Enrollment status with 'X' .
I have to disable the record if the service is cancelled.
For example :
Customer Premises Service Num Status Cancel Ind
-------------------------------------------------------------
1111 1234 100 X(Cancel) Y
1111 1234 200 EN(Enroll) N

When the user navigates between records the record with service num should not be updated but when he navigates to service Number 200 the record can be updated.
I have written code in When-New-Record instance
If Status = 'X' then
Set_item_property('Service_Num',update_allowed,property_false);
Set_item_property('Status',update_allowed,property_false);
Set_item_property('Cancel_ind',update_allowed,property_false);
else
Set_item_property('Service_Num',update_allowed,property_true);
Set_item_property('Status',update_allowed,property_true);
Set_item_property('Cancel_ind',update_allowed,property_true);
end if;

This code works fine when i click on text Items but when i click on Cancel Ind check Box it is not working fine.

For instance:
When the cursor is in service number 100 the record is non-updateable and an error"Field is protected against update" is displayed. But when i click on Cancel Ind of Service Number 200 again the same error"Field is protected against update" is displayed. It should be displayed since the Service Number is not with Cancelled Status.

Thanks and Regards,
Praseeja Chandran


Re: Disabling a Current record in a multi record block [message #189340 is a reply to message #188973] Thu, 24 August 2006 03:49 Go to previous messageGo to next message
sameer_am2002
Messages: 129
Registered: September 2002
Senior Member
Set_item_instance_property instead of set_item_property..
in this you disable ..update_allowed property..
Re: Disabling a Current record in a multi record block [message #191585 is a reply to message #188973] Thu, 07 September 2006 03:20 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you solved your problem?

David
Re: Disabling a Current record in a multi record block [message #192096 is a reply to message #191585] Sun, 10 September 2006 22:59 Go to previous message
Praseeja
Messages: 12
Registered: February 2006
Junior Member
In Post Query I have set the Cancel Indicator value.
In Pre Record trigger the following code is written:
If Status = 'X' then
Set_item_property('Service_Num',update_allowed,property_false);
Set_item_property('Status',update_allowed,property_false);
Set_item_property('Cancel_ind',update_allowed,property_false);
else
Set_item_property('Service_Num',update_allowed,property_true);
Set_item_property('Status',update_allowed,property_true);
Set_item_property('Cancel_ind',update_allowed,property_true);
end if;

Regards,
Praseeja
Previous Topic: how to grab image from webcam to form
Next Topic: Problem with Importing a dmp file
Goto Forum:
  


Current Time: Thu Dec 08 16:18:41 CST 2016

Total time taken to generate the page: 0.10888 seconds