|
Re: LOV , autoselect values [message #550941 is a reply to message #550940] |
Fri, 13 April 2012 13:29 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
A little bit of explanation, please.
Suppose you are in a form. You navigate into an item (your "units" item). It can hold only one value. So, what do you mean by "selecting THESE compulsory values into a single item"?
On the other hand, if it is a multi-record block (doesn't really mater if its layout is "form" or "tabular"), you can populate it "in advance". Depending on your form, it could be WHEN-NEW-BLOCK-INSTANCE, PRE-BLOCK, or even WHEN-NEW-FORM-INSTANCE trigger. As you'd insert multiple records into a block, you'd do that in a loop.
|
|
|
Re: LOV , autoselect values [message #550942 is a reply to message #550941] |
Fri, 13 April 2012 13:43 |
|
vinni
Messages: 34 Registered: March 2012
|
Member |
|
|
Ok,
The user is in a form. They are shown a list of optional values to choose from. But I want some specific values to be compulsory, meaning i don't want them to be optional... i want them to be "automatically inserted" alongside the options they will be inserting.
Could a post-insert trigger or after-insert trigger be useful for this? <<== whats the difference?
[Updated on: Fri, 13 April 2012 13:57] Report message to a moderator
|
|
|
Re: LOV , autoselect values [message #550946 is a reply to message #550942] |
Fri, 13 April 2012 14:23 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Maybe it is because of lack of my imagination, but I can't imagine how this form looks like. Could you post a screenshot and LoV you currently have (opened on the screen, I mean)?
Here's how I see it: there are these "units" (something like school subjects - Maths, Physics, English, Chemistry, ...), and some of them are a "must" (for example, Maths & English).
User opens a form, selects a student and enters his subjects, for example: Maths, Physics, Chemistry. Commits.
But stop! English is missing! You want to warn the user that something's missing. Right?
If that's so, maybe it would be the simplest if you pre-create these compulsory units. I suppose that there's some mark that "marks" these units compulsory. So, create a KEY-DELREC trigger that would prevent deleting these records, as well as PRE-RECORD which would - by SET_ITEM_INSTANCE_PROPERTY - disable items in these records.
Or, as you know number of compulsory units, user :SYSTEM.TRIGGER_RECORD to prevent navigation to these records.
Then, omit these units from a LoV so that users couldn't duplicate compulsory units. Also, set "unit" item's "Validate from list" property to YES (so that they couldn't manually enter these values).
You mentioned POST-INSERT (which is a Forms trigger) and AFTER INSERT (which is a database trigger). You might try them; why not? You'd have to compare list of compulsory units with units already inserted into a table, and then fill in the missing ones (MINUS set operator might be useful in this case).
|
|
|
|