cancel
Showing results for 
Search instead for 
Did you mean: 

Performing field validation at END button on IC toolbar with CRM 2007

laercio_azevedo
Active Participant
0 Kudos
171

Hi friends I need some help with END BUTTON on IC toolbar with CRM 2007.

My problem is, clicking on button END all documents (activities) are automatic saved and closed, but the mandatory fields are not validated.

What I need is, clicking on button END the system have to perform before all screen validation for mandatory fields, in case everything OK, save and close all documents (activities), otherwise cancel this action.

Does anybody know if there is a way to do this?

Regards,

Lalas

Accepted Solutions (1)

Accepted Solutions (1)

saumya_govil
Active Contributor
0 Kudos

Hi Lalas,

Check if the following [link1|] [link2|] helps you!

Regards,

Saumya

laercio_azevedo
Active Participant
0 Kudos

Saumya,

Thanks for your help, I will try both sugestions.

Lalas

Answers (1)

Answers (1)

Former Member
0 Kudos

Lalas,

The cleaner way of doing this is.

Step1:

Implement the field validation in ORDER_SAVE BADI Prepare method.

Here is the pseudo code for ORDER_SAVE Badi

IF_EX_ORDER_SAVE~PREPARE

CALL FUNCTION 'CRM_ORDER_READ'.

Check mandatory field is filled

if mandatory field is not filled

Raise a error message using CALL FUNCTION 'CRM_MESSAGE_COLLECT'

endif

ENDMETHOD.

Step 2:

Enhance the component CRMCMP_IC_FRAME and View CRMCMP_IC_FRAME/HiddenView

On click of END button the EH_ONFORWARDCALL is triggered, if any of the error message is raised in ORDER_SAVE BADI Prepare method open the popup or else call the super method EH_ONFORWARDCALL .

Here is the pseudo code for EH_ONFORWARDCALL

METHOD eh_onforwardcall.

Get clip board content

Read the error messages of the objects in the Clip Board

IF the error messages raised in ORDER_SAVE Badi you raised exists

Show Popup with appropriate message

Else.

CALL METHOD super->eh_onforwardcall( ).

ENDIF.

ENDMETHOD.

If you need more information let me know

-Thanks

Mahadeva

Edited by: Mahadeva Honnalaganadoddi on Oct 26, 2011 5:02 PM