cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Conditional mandatory fields in SAP Cloud(C4C)

Former Member
0 Likes
2,218

Hello Cloud folks,

I have a basic requirement that, when we change any opportunity status to "Won", we need to make few fields are mandatory.

Can anyone worked already on this? I have a idea we should work on on save even in the the extension of standard BO. But looking more help into that.

Thanks,

Bala.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member

Hello Bala,

try the following:

1. Create an extension field type indicator on your Opp.XBO

     - e.g. IsWon : Indicator

2. Implement logic which sets IsWon to "true" when the status changes to "Won"

      - AfterModify or BeforeSafe

3. Implement the OnSave validation of your Opp.XBO

     - check here the value of your fields if IsWon == true and raise messages if empty

4. Set the mandatory option in the UI designer to "Bound" and select your IsWon element

I hope this helps.

regards,

Eugen

Former Member
0 Likes

Hi, I think with UISwitch and Dynamic screen it is not possible to check if the status of the opportunity is won or not. You can just switch the field properties based on the user role. Correct me if I am wrong.

I was thinking to the following solution:

in the validation on save event - absl implementation for the opportunity xbo, you can check the status of the opportunity, and if it is "won" you can:

1) check the status of the mandatory fields

2) raise a message to the user in case these fields are not filled

On the UI side, for now, I think there is no possibility to show some kind of indicator to the user for the specified fields. Anyway you can add a custom label (in an embedded component for example) contaning the information about the mandatory fields, and show this label only if the opportunity is "won".

Former Member
0 Likes

Hi Alessandro,

It's possible to set a mandatory star via extensibility explorer.

Thanks.

Fernando

Former Member
0 Likes

Thank you! I had some doubts about the possibility to bind this field with a custom field extension, but now I checked and seems yes its possible

Former Member
0 Likes

Once i select the field and activate it doesn't turn up as expected in account bo.

example: i selected zipcode as mandatory True and activated it is not working.

any idea.

once i save and activate i see below message.

an offline merge model is available for this floorplan do you want to update it ? yer or no

i tried both options it didn't turn to * the postal code field.

Thanks,

Mahesh

Former Member
0 Likes

I think you should try to

1- delete all the rules by expanding the "adjust properties" node

2- delete the cache of your cloud app studio (C:\Users\<youruser>\Documents\CopernicusIsolatedShell\Projects\<system>\<solution>

TomK
Product and Topic Expert
Product and Topic Expert
0 Likes

Do you use the Silverlight-client? In SL a cache clear might help you... I have seen this often working after a SL cache clear.

Rightclick somewhere on the SL-UI -> Silverlight/Application Storage -> delete / delete all

Afterwards re-logon to you tenant. Then it should work :-)!

Best regards

Tom

Former Member
0 Likes

Another option, which could be done without PDI:

Hope this helps.

Thanks

Fernando

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello Bala,

The normal way would be to use some scripts which modify the attributes (like Mandatory) depending on the value of a separate field.

Unfortunatey the scripts are not available for extending UIs, only in own UIs.

What you can use is a UI Switch.

has written a blog in which he describes how to set a UI Switch dynaimcally.

May this helps you.

Bye,

   Horst