on 11-14-2011 4:27 AM
Hi Experts,
There is a requirement to maintain atleast one sales area while creating an account in WEB UI. If not, an error message is being thrown. But, though sales area is not maintained, the account is getting saved successfully having error messages.
Please let me know the process to stop save while having error messages for an account.
Regards,
Santosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santosh,
To stop the save event when sales area is not found can be performed in method EH_ONSAVE( ) which is triggered when you click on save( ).
If the method is not aready redefined, please redefine it & place a check to check existence of sales area assigned to the newly created account.
You can do this by, reading the entities using Genil Relations.
lr_entity = me->typed_context->account->collection_wrapper->get_current( ). "-- Get reference of the account entity.
lr_sales_ent = lr_entity->get_related_entity( 'BuilSalesArrangementRel' ). "-- Get the related Sales Area entity.
If lr_sales is bound.
" Check if there is data maitained
lr_sales_ent->get_properties( importing es_attributes = ls_sales ).
if ls_sales is initial.
"-- Raise Donot Save Fill error messages
else.
"-- Fill error messages for NO Save.
endif.
- Dedeepya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I hope you are raising the messages in the right class then.
because before the commit takes place the super class of EH_ONSAVE checks for error messages existence & if found it cancels the save.
Please debug into the standard Save method & check which class is being checked for error messages; you can add your Error Messages to that class & check once again.
User | Count |
---|---|
4 | |
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.