Problem with Master / Detail Data Block in Form (to Handle Rights) [message #567750] |
Fri, 05 October 2012 01:19 |
|
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 |
|
Littlefoot
Messages: 21818 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.
|
|
|
|
|
POST-QUERY problem in Master/Detail Block in Form [message #567836 is a reply to message #567750] |
Sat, 06 October 2012 15:00 |
|
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
|
|
|
|