I pretty new to APEX and I'm having a bit of trouble working with my first Tabular form. The table I've linked it to is fairly simple. The columns are as follows:
Primary key representing an internal
code for a college major
Foreign key representing the "real"
code for the college major
Description for the college major
The user that inserted/updated the
row in the table
The date the row was inserted/updated
At the moment, I'm facing two problems.
I want the user to be able to specify their own primary key for the row but not to be able to change any existing primary keys. When I specify the column type as "Text Field" users are able to edit existing rows' primary keys and it also seems to break the report when trying to add a new row as I get a checksum error.
I would like the user and date
columns to default to the currently
logged in user and the current date,
but specifying default values for
either of these columns also seems
to cause syntax/SQL errors. Does
anyone have any examples of how to
use the default value functionality
for a column? Fixed. I can just use SYSDATE as a value on it's own when specifying the PL/SQL type for default. Username can be obtained through functions in APEX_UTIL
Perhaps you could use 2 conditional fields. If the field value is null, display the edit box, if the field value is not null display the display-only field.
Related
My list is a simple employee list, which contains basic information you'd expect(e.g. - Last Name, First Name, empID, Worksite, etc.). Is it possible to to filter a view to show records that are related to the current user's site?
Like... [Me].[Worksite]?
Please bear in mind installing add-ons or other 3rd-party extensions are restricted.
What you can do is create a one calculated columne which will have a condition on WorkSite column.
For example, [WorkSite] == [Me].[WorkSite].
This will set Yes or No for in that column.
Then generate a view which will filter the records where Calculated column has a value true.
In that way only those rows will be displayed which has the WorkSite as current user.
I am a total beginner on DynamoDB and hardly know how to make a working query. But I recently came up with something which is apparently doing what I want.
Here is my question, I now have a table like this:
It has a primary partition key and a primary sort key:
Primary partition key
primaryPartitionIdKey (String)
Primary sort key
primarySortIdKey (String)
But two fields are not enough to do what I need. I would like to add one more.
Another field:
otherFieldIdKey (String)
Is that possible, if YES: how should I do it?
I can' see anything on the AWS console for that.
DynamoDB tables are schemaless, which means that neither the attributes nor their data types need to be defined beforehand. Each item can have its own distinct attributes.
So, your new "field" or attribute will be automatically created upon the first record put/update operation.
See DynamoDB Core Components.
Follow these steps to write data to the Music table using the DynamoDB console.
Open the DynamoDB console at
https://console.aws.amazon.com/dynamodb/.
In the navigation pane on the left side of the console, choose
Tables.
In the table list, choose the Music table.
Select View Items.
In the Items view, choose Create item.
Choose Add new attribute, and then choose Number. Name the field Awards.
Repeat this process to create an AlbumTitle of type String.
Enter the following values for your item:For Artist, enter No One You Know as the value. For SongTitle, enter Call Me Today. For AlbumTitle, enter Somewhat Famous. For Awards, enter 1.
Choose Create item.
Do this one more time to create another item with the same Artist as the previous step, but different values for the other attributes
Whenever I create a new activity, I need a date field to be autopopulated ( it will be autopopulated but greyed out until and unless a checkbox next to it needs to be checked).
I perform a validation based on the date field, when a new activity is created. since the date field check box is not checked, it is not considering the value for the validation.
Any help or suggestion is appreciated.
Thanks.
Jaya Vignesh.
make use of predefault and postdefault values to populate current-date.
set field Read-only (BC field user property). You can find it under Business Component in object explorer.
Field read-only allows you to make a field read-only based on value of other field from same BC or joined field.
I perform a validation based on the date field, when a new activity is created. since the date field check box is not checked, it is not considering the value for the validation.
This requirement of yours isn't clear what exactly you want to validate. Since you are populating it bydefault, I don't find the significance in validating your own auto-populated data. well yet I provide a suggestion below
There are two types of validations, 1. Using configuration or 2. Using scripting. I am not pretty much sure if it can be achieved with configuration but scripting it is possible by overriding BusComp_presetFieldValue, BusComp_preWriteValue. The first one executed when you populate a field. And the latter one when you commit the record.
I have answer assuming your requirement. Let me know if you have any questions or clarifications required.
You can add the Predefault property of the field to be the following
System: TimeStamp
Greetings:
Is there anyway to make an apex report table cell (or even the entire report itself) conditionally read-only in Apex 3.2? I don't see the "read-only" box anywhere in the options; tried searching everywhere.
Thanks in advance!
Since the whole tabform is to be made read-only for particular users, you can do this at rendering time rather than using Javascript. However, you would need 2 copies of each column:
Column to be displayed for an authorised user, not readonly
Identical column to be displayed for a non-authorised user, with Element Attributes set to readonly=readonly
Authorisation schemes can be used to control which columns are displayed to the user.
I was hoping to find a way to do this with a single column and a dynamic value for Element Attributes, but I couldn't get it to work.
OK, I had an error in concept. I wanted to make a tabular form read-only. That's why I couldn't see the "read-only" box. If you open the source for the generated page, each column has given an id with the following naming convention:
id="f02_0001"
This table cell is in column 2, row 1. So, you can use JavaScript to loop through a column and modify it's properties. In this example, I use jQuery:
var payments = $("[id^='f08_']"); // get all cells for column 8
// loop through items
$.each(payments, function(){
alert($('#'+this.id).val());
// make whatever changes you want to this.id, such as make read-only
});
I have a model which represents the user's display preferences. Just about all of these preferences are boolean values. Instead of having 50 boolean columns, is there a better way to go about this? In the future when I want to add a new item, I don't want to have to add a new column in my database.
If you have that many booleans and are anticipating adding more, you should not be using columns, but entries.
Then when you need to look up "User wants emails", just search for UserPrefs.objects.get(User=user, Preference=Preferences.objects.get(name="wants email")).
User_Table:
User
username
etc
Preferences_Table:
name
description
etc
UserPreferences_Table:
User (FK_User)
Preference (FK_Preferences)
Setting (Boolean)
Depending on your setup, you may be able to omit the Setting field in the UserPreferences table and simply use the existence of an entry for that User/Preference as a True and the lack of one as a False.
You could also use a bitmap. You only need single char field in you database. Somewhere in your app you store a list of preferences, pref1, pref2, pref3 ... and in the bitmap filed you store a sequence of 1's and 0's that correspond to the preferences.
For example 101 means pref1=yes, pref2=no, and pref3=yes and 011 means pref1=no, pref2=yes, and pref3=yes.
You could make this reusable by creating a new model field type for bitmaps.
" In the future when I want to add a new item, I don't want to have to add a new column in my database."
In this case, you'll want to add a row.
You have a table with the domain of possible setting Names. 50 rows.
You have a table of actual settings. User, Setting Name, Setting Value.