cancel
Showing results for 
Search instead for 
Did you mean: 

How to make Email address field non-mandatory for Accounts and Mandatory for Contacts at the same time?

Former Member
0 Kudos

Hello Experts,

Is there a way to make email address field non-mandatory for Accounts and mandatory for Contacts at the same time (both in the header)?

The problem is when I make Email non-mandatory in Accounts, it also makes Email non-mandatory in Contacts automatically.

We dont want this. We want Email address should not be a required field in Accounts, but it should be a required field in Contacts. How can i achieve this??

It seems that Email address field for Accounts and Contacts is tied up together.

How can i separate it? 

Any suggestions/help will be appreciated.

Thanks,

Abhinav

Accepted Solutions (1)

Accepted Solutions (1)

praveen_kumar194
Active Contributor
0 Kudos

hi you can make two different configurations with different object and sub objects of that view one with mandatory field and another with not mandatory field  and load the configuration dynamically with the do config determination method based on some conditions. you can use set config keys method inside this do config method and set the keys accordingly. kindly share your inputs i will try to help you.

Former Member
0 Kudos

Hi Praveen,

I actually did the same thing. I created a new configuration under the same view. But i dont know how to proceed further because Accounts and Contacts both pick up the same view with same configuration key (and objects and sub-objects). I am trying Accounts to pick one config key and Contacts to pick another, but no success as yet.

Is there some code change involved?

Thanks,

Abhinav

praveen_kumar194
Active Contributor
0 Kudos

we need to redefine the do config determination method and set the config keys based on condtions as i already suggested. try do that and let me know if you need any further help.

durga_prasad25
Participant
0 Kudos

Hi Abhinav,

Praveen is absolutly correct you can proceed with that I am just adding some coding part of that may be it will help you.

Assume you have created Config1 for Account with Object1 and Sub-Object1 same way you have created Config2 for Contacts with Object2 and Sub object2 now

check in do_config_determine method that your BP is account or contact

if it is account then

    me->set_config_keys( iv_object_type          = Object1

                  iv_object_sub_type      = Sub-Object1   ).

else if it is contacts then         

    me->set_config_keys( iv_object_type          = Object2 

                  iv_object_sub_type      = Sub-Object2  ).

This will load two different views one with mandatory and non mandatory email address which you created and assign in the above configuration.

hope this explore praveen's point.

BR

Durga Prasad

Former Member
0 Kudos

Hi Praveen and Durga,

Thanks for your input.

I guess this is what i needed. I will work on the code change and update this post with my results.

Thanks,

Abhinav

Answers (0)