-
1. Re: set_block_property on 6I
Andreas Weiden Oct 9, 2013 6:12 PM (in response to NZK)First, why do you issue the same statement 3 times?
Second, the code does not make sense in the mentioned triggers, as they fire for each record, but the code sets properties for the whole block.
So the question is, what is your desired behavior? Should the user be able to insert new records? should the user be able to update existing records?
-
2. Re: set_block_property on 6I
NZK Oct 10, 2013 5:32 AM (in response to Andreas Weiden)Dear Andreas
Sorry that was a mistake in the code it should be INSERT_ALLOWED,DELETE_ALLOWED & UPDATE_ALLOWED.
What is my requirement is when the GRN is posted, user cannot update, delete or insert to the GRN.
Hope you understood my question
NZK
-
3. Re: set_block_property on 6I
Andreas Weiden Oct 10, 2013 6:02 PM (in response to NZK)How many records do you show in your block? Is the block you want ro disable a different block or it is the same block where your GRN_POSTED is in?
-
4. Re: set_block_property on 6I
NZK Oct 12, 2013 5:18 AM (in response to Andreas Weiden)Dear Andreas
There are two separate blocks. 1 is Master Block where there is only one row. The other one is Lines block where, there can be one or many rows. Once the GRN status is POSTED then I want to restrict INSERT/UPDATE OR DELETE on both blocks. User can navigate from MASTER to LINES block and vice-versa. I want to disable both blocks once the GRN is posted.
NZK
-
5. Re: set_block_property on 6I
Sekhar1224 Oct 12, 2013 10:11 AM (in response to NZK)1 person found this helpfulBetter try in post_insert trigger.
-
6. Re: set_block_property on 6I
Priyasagi Oct 12, 2013 11:32 AM (in response to NZK)1 person found this helpfulDear Mr.NZK,
To restrict modifications based on an item value(pst_yn), you have to write item level trigger for all fields except posted indicator (ex.) pst_yn for example,
when-new-item-instance
if :pst_yn='Y' then
if get_item_property('doc_date',update_allowed)='TRUE' then
set_item_property('doc_date',update_allowed,property_false);
end if;else
if get_item_property('doc_date',update_allowed)='FALSE' then
set_item_property('doc_date',update_allowed,property_true);
end if;end if;
To restrict deletions based on an item value(pst_yn), you have to write block level trigger like,key-delrec
if :pst_yn='Y' then
null;
else
delete_record;
end if;
-
7. Re: set_block_property on 6I
Andreas Weiden Oct 12, 2013 1:59 PM (in response to NZK)If GRN_POSTED in placed in the Master-Block, i would do the following:
Disable the INSERT_ALLOWED, UPDATE_ALLOWED and DELETE_ALLOWED in the Post-Insert and Post-Update trigger. Additionally, enable ro disable them in the WHEN-NEW-RECORD-INSTANCE-trigger on the master-block.
-
8. Re: set_block_property on 6I
Priyasagi Oct 12, 2013 2:16 PM (in response to NZK)Your post is not give us much information,
Andreas Weiden raised a big doubt. The indicator field where is located? Either Header or Detail?...
If it is located at Header then AndreasWeiden solution is suitable for your requirement.
-
9. Re: set_block_property on 6I
NZK Oct 12, 2013 2:38 PM (in response to Priyasagi)Dear Priyasagi
Yes the indicator is located in Header.
NZK