cancel
Showing results for 
Search instead for 
Did you mean: 

SAP C4C Mandatory field in SDK not work

Former Member
0 Kudos

Hello,

As my pictures show:

I set custom BO filed mandatory(without ABSL check) and it did not work

Attention please!It's a Custom BO so I can't "edit layout" in H5 or SL to set mandatory attribute.

If I must to add extra checks using ABSL like the blog:https://archive.sap.com/discussions/thread/3608195 ?????

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Benny,

Please create a new question for this.
Don't mix up several questions in one. 😞

As I watch this tag I will find it. 🙂

Thanks,
. Horst

Accepted Solutions (1)

Accepted Solutions (1)

former_member422907
Contributor
0 Kudos

In UI designer mandatory property is for marking field with red star (as you attached in picetures).

If you want make field mandatory and prohibit save action, you have at least two possibilities:

1. possibility:

in BO define corresponding field as AlternativeKey if necesary

[AlternativeKey] AgreementDate : Date;

or

2. possibility:

in BO define flag:

[Transient] element MandatoryFieldsSet:Indicator; 

in "Event - AfterModify" script:

this.GetFirst().MandatoryFieldsSet= true;
if (this.GetFirst().AgreementDate==""){
	this.GetFirst().MandatoryFieldsSet= false;
}

in "Validation - OnSave" script:

return this.GetFirst().MandatoryFieldsSet;

Please use following code snippet and mark this answer correct if you accept this 🙂

Former Member
0 Kudos

Hi Zoran,

As you say,it just mark the field as mandatory and we need to use extra absl to implement the mandatory check.

Btw,I reported an incident and received the following answer:

“Question:If this function mentioned can be supported in 1705.
Answer:=> No it cannot be supported as for custom logic to replicate there should be some script files and current frame work does not support without creating validation script files. Its not possible in the current or future releases. ”

Thanks very much for your reply!

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Baoxiang,

The setting in the UI Designer is just for the visibility -> show a red star.

To have a real check you need some ABSL coding in the validation for the rep. node.
Or define it as an AlternativeKey (if it is really one) like Zoran mentioned above. In this case the check (incl. a uniqueness check) is done by the system.

HTH,
. Horst

Former Member
0 Kudos

Hi Horst,

You are right but at the same time I want to say that it is really a bad design,especially,designers seem to have no plans to change it,I'm so confused.

Baoxiang

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Benny,

If you expect to be able to replace the UI or use a different input mechanism (WebService,...) you need different ways (UI, BO, ...).

But I agree: it is not strait-forward. 😞

Bye,
. Horst

Former Member
0 Kudos

Hi Horst,

I have deleted my mistake question way and asked a new question"https://answers.sap.com/questions/235417/sap-c4c-copy-textcollection-from-custombo.html".

Looking forward to your reply.

Thanks in advance.

Answers (0)