Home » Developer & Programmer » Forms » Problem with Master / Detail Data Block in Form (to Handle Rights) (Oracle Forms 10g)
icon5.gif  Problem with Master / Detail Data Block in Form (to Handle Rights) [message #567750] Fri, 05 October 2012 01:19 Go to next message
arain.jobs@gmail.com
Messages: 4
Registered: October 2012
Location: Pakistan
Junior Member
[MERGED by LF]


Hi!

I made a "Cash Payment Voucher" form with master and detail block, I would like to apply user rights which are in USR_LINES_ALL table and I apply rights on Block Level like:

PRE_RECORD (Trigger) on CPV_HEADER_ALL (Block):

Insert Priviliges

IF InsertAllow=1 THEN

IF :CPV_HEADER_ALL.APP_FLAG=1 THEN

SET_BLOCK_PROPERTY('CPV_HEADER_ALL',INSERT_ALLOWED,PROPERTY_TRUE);
SET_BLOCK_PROPERTY('CPV_LINES_ALL',INSERT_ALLOWED,PROPERTY_FALSE);

ELSE

SET_BLOCK_PROPERTY('CPV_HEADER_ALL',INSERT_ALLOWED,PROPERTY_TRUE);
SET_BLOCK_PROPERTY('CPV_LINES_ALL',INSERT_ALLOWED,PROPERTY_TRUE);

END IF;

ELSE

SET_BLOCK_PROPERTY('CPV_HEADER_ALL',INSERT_ALLOWED,PROPERTY_FALSE);
SET_BLOCK_PROPERTY('CPV_LINES_ALL',INSERT_ALLOWED,PROPERTY_FALSE);

END IF;

Insert Priviliges
Now the problem is this that oracle raise two errors

1st Error: when we open this form then the error is there: FRM-41003: This function cannot be performed here.

2nd Error: If we open this form and click any master or detail entry, kindly note that we just click any field in master/detail and then if we close this for then it ask to save the changes.

1. Where should i handle user right to enable/disable block_property?
2. How to tackle these error?

I will appreciate if any one give me right direction to do!

Regards,
Raheel Ahmed

[Updated on: Sat, 06 October 2012 15:48] by Moderator

Report message to a moderator

Re: Problem with Master / Detail Data Block in Form (to Handle Rights) [message #567771 is a reply to message #567750] Fri, 05 October 2012 04:01 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
PRE-BLOCK might be a better choice than PRE-RECORD you use now

"This function cannot be performed here" usually means that you used a restricted procedure in an inappropriate place (for example, GO_BLOCK in PRE-BLOCK trigger). However, code you posted doesn't suggest that so it may be that some other trigger raised the error. Which one is it? I believe Forms reports that information.

As of the "changes to be saved": Forms think that you entered value into one of its items and warns you that it will be lost if you don't save those changes. Find such items (possibly populated in POST-QUERY trigger) and apply
set_item_property(<item_name>, item_is_valid, property_true);
to them after you set their values. Alternatively, see if
set_record_property(:system.trigger_record, <block_name>, status, query_status);
does any good.
Re: Problem with Master / Detail Data Block in Form (to Handle Rights) [message #567778 is a reply to message #567771] Fri, 05 October 2012 04:31 Go to previous messageGo to next message
arain.jobs@gmail.com
Messages: 4
Registered: October 2012
Location: Pakistan
Junior Member
Sorry I was skip to tell that Poste/Un-Posted Flag is there on Header Block in the Form, if the entry is posted in GL then the record should disable for editing/deleting and I have to disable the block Edit_allowed, Delete_allowed Property to False, that's why I put these code in pre-record, what should I do
Re: Problem with Master / Detail Data Block in Form (to Handle Rights) [message #567790 is a reply to message #567778] Fri, 05 October 2012 05:58 Go to previous messageGo to next message
cookiemonster
Messages: 13925
Registered: September 2008
Location: Rainy Manchester
Senior Member
As Littlefoot said you should find out what code is causing the errors you report, because it isn't the code you posted in the first post.
POST-QUERY problem in Master/Detail Block in Form [message #567836 is a reply to message #567750] Sat, 06 October 2012 15:00 Go to previous messageGo to next message
arain.jobs@gmail.com
Messages: 4
Registered: October 2012
Location: Pakistan
Junior Member
Hi,

I have a Form with Master/Detail Block, there was problem in form that, when we open this form and we go next record / previous record, a dialog box was there and asking that do you want to save changes, although we don't made any changes on form, today i remove post-query trigger from child block and problem is solved, but i need this Post-Query Trigger: the coding is

POST-QUERY TRIGGER (CHILD BLOC[/u]K):[/b]


IF :BPV_LINES_ALL.AC_ID IS NOT NULL THEN

SELECT AC_CODE,AC_DESC INTO :BPV_LINES_ALL.AC_CODE,:BPV_LINES_ALL.AC_DESC
FROM COA_LINES_ALL
WHERE AC_ID=:BPV_LINES_ALL.AC_ID;

END IF;

Can any one tell me why this coding is getting problem, i use this type of queries in Post-Query, although I didn't face this kind of problem!

Regards,
Ahmed
Re: POST-QUERY problem in Master/Detail Block in Form [message #567837 is a reply to message #567836] Sat, 06 October 2012 15:50 Go to previous message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I already told you what to do (yesterday); how come you didn't do anything of that?

By the way, don't open a new topic when it is obvious that the new question is related to a previous one. Therefore, I merged these two topic.
Previous Topic: Forms are Loading/opening Very Slowly in 11g Forms while opening
Next Topic: windows picture and fax viewer
Goto Forum:
  


Current Time: Fri Jul 05 22:13:25 CDT 2024