on 09-30-2015 8:25 AM
Hi Experts,
I am new in crm ui and I was wondering how can I fill automatically with the current date a field when load for the first time the page?
I already create the field and I use a data element type Dats, so I have the standar search help in the field, but I have the following doubts:
1) if the user can select another date and I need to compare if the date selected is the current date and if it is the current date disable the field
.
I was wondering in what method the validation should be: in get_p, get_m, get_, set_ I would be thankful you could give an example in source code.
I appreciate your help
thanks in advance John
Hi John,
I would try to use methods DO_INIT_CONTEXT or DO_PREPARE_OUTPUT (check parameter iv_first_time) of your view controller class to automatically fill the initial date.
For disabling/enabling the field, you can add your logic in GET _I method.
Hope that helps you a little more.
Kind regards,
Garcia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
If you generate GETTER and SETTER method for that field, you can call them directly.
Something like: typed_context->your_context_node->set_date( attribute_path = '' value = sy-datum ).
If not, you can instantiate an entity for your context node and change there directly.
Something like:
DATA lr_entity TYPE REF TO cl_crm_bol_entity.
lr_entity = typed_context->your_context_node->collection_wrapper->get_current( ).
lr_entity->set_property_as_string( iv_attr_name = 'DATE' iv_value = sy-datum ).
There is a lot of information regarding BOL programming in these CRM foruns there can help you a little more and do some more complex stuff
Kind regards,
Garcia
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.