How to make a date field to be autopopulated in Siebel CRM Desktop? - siebel

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

Related

How to get the date when the particular attribute was first changed in rails

I have a boolean atrribute whose default is false. How can i get the date when the attribute was changed to true?
The is_changed gives you if the value was changed. I want the date when the attribute was first changed.
How do i get it in rails?
add attribute 'first_change' in that table which will save time stamp of every first change of the boolean attribute changed to true or false, then in model write the callback like this
before_update :check_changes
def check_changes
if self.<boolean_attribute>.is_changed? and first_change.nil?
self.update(first_change: Time.now)
end
end
After this you can check when the boolean attribute was changed.
You can wrap your boolean attribute in distinct model and from there you can easily trace when specific field was initially setted up or updated. In your current model you can't trace changing state of specific attributes, only the whole object, but it's not what you need I guess.
Well, looks like you basically want the feature of git in ActiveRecord records.
There are two ways
Use a separate col like changed_date. Update it whenever the field is changed for the first time.
I recommend this if your requirement is that simple. Do not use heavier gems.
Use libraries like VestalVersion or PaperTrail
these are helpful to track every activity in your records.
you can keep track of every changes, what its changed to and when
also you can revert your record to any point of time it was changed
I think there are two ways like above answer suggested to make a separate field and add date there when field changed first time or
you can use Public Activity gem that will log all the model activity with params.
It creates a activities table based on this table you can get the date of the fields when it was first changed but it is a lengthy process

Lotus Notes: refresh form from field

I have an editable field. Another computed field value depends from the value of the editable field.
In the Exiting event of the editable field I add:
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument
Call uidoc.Refresh
But it still not works. If I check the form property Automatically refresh fields, it goes OK, but the form performance decreases, it is very slow.
Any suggestions? Thanks!
Lotus Notes always computes the whole form from left to right and from top to bottom.
If a computed field is above the field, that triggers the refresh, then it does not have access to the "new" values of the editable field on the first refresh.
You would need 2x Call uidoc.refresh to make the computed field reflect the changes.
Or you move the computed field BELOW the editable field, then one single refresh will be sufficient.
Alternatively you may choose to use the onBlur- Event instead of the exiting- event as the "on"- Events were meant to replace the "Classic" Field events since version 6 of Lotus Domino / Notes. Check this link to Designer Help to see hints like
The corresponding LotusScript-only events still occur, but their continued use in Release 6 applications is discouraged.
onBlur: New for LotusScript with Release 6 and
Exiting: Preferred is onBlur
in the editable field's event "OnBlur" , switch to Client/LotusScript) and only add :
notesuiuiworkspace.CurrentDocument.Refresh
Don't forget to remove the one in exiting.

Django admin store dynamic formset added with ajax

I'm currently implementing a solution using django admin, it allows users to define in the db a product, and then custom attributes and details, more details may be aggregated by a common attribute, this allows me to query with ajax a custom view that returns some JSON data to build automagically the form fields that I need directly in the same formset view (manipulating the DOM).
The current DB design follows this schema:
Catalog(name, description, photo)
Product(rel_catalog, name, base_price, photo, manufacturer_email)
ProductDetail(rel_product, rel_attribute, percentage_price, fixed_price)
ProductAttribute(rel_product, name, description)
As you may see I have a catalog, where there can be more products, a lot of details per product, aggregated by attributes. Then I simple show by default the Catalog, then the select with all available products for that catalog, then, choosing the right Product, I obtain the complete form (each row has a label with ProductAttribute.name and a select with related ProductDetail).
All works pretty dam good, but I also need to store this references in the DB when someone completes the form (making an order with choosen products). This forms are displayed as StackedInline (the ModelAdmin is for the Order).
I don't know how many options there may be per product so I was thinking to use this design to track orders:
Order(customer, status, notes, tot_price, inserted_by)
OrderItem(rel_order, catalog, product, unit_price)
But I don't know how to store the dynamic added inputs...
I was thiking to implement OrderItemProperty(rel_orderitem, rel_productdetail, rel_productattribute) to store each single input... but how do I loop over this unknown fields?
Maybe do you suggest a better design?
If you need more code just ask for it and I'll reply with a pastebin link.
Thankyou.
Finally I got a working solution,
I've created a custom view, overriding the default "add/" view, this way I can customize whatever I want to and I can read the POST data handling each validation, putting then the data in the right model.

I have a field in APEX set with a default of SYSDATE but it does not update

I have a field defined in my table as DATE and want it to automatically populate with the current system date when someone access the update form in my APEX application. But the date doesn't update. It was working when I first added it, but now when you pull up the update page it only shows the date that's in the table.
In Oracle, a default on a column means that if a record is inserted into the table without mentioning that field, then use the default. My guess is that since the field is displayed on your page, you are writing NULL or spaces to it, so it is definitely included in the insert statement.
So you need to either take it off the page, add an update trigger, or even better, write a process in Apex to update it whenever the record is modified -- perhaps an After-Submit computation.

Oracle APEX - Setting up a Tabular Form with default values

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.