cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Validation SAP IDM 7.2

Former Member
0 Kudos

Hi

I took reference from the link and followed relevant steps applicable to deploy custom validation ear file

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30f16242-9dec-2c10-7e88-838b4af75...

I am calling the class testcustomer.idm.impl.MyOnSubmit on user create. This onSubmit method is taken from the pdf. Here logic is to make sure that mobile phone number is prefixed with the international country code if it is missing.

When i try now to create a user it gives below error in UI

"Could not check if values are valid"

Can anyone please advice where it went wrong and how to fix it ?

Thanks

Karthik

Accepted Solutions (0)

Answers (3)

Answers (3)

ivan_petrov
Active Participant
0 Kudos

Hi Karthikeyan,

There are two possible reasons:

- first one, as Peter says, is exception in Java class

- the second one is if you forget to add the class path in Class Path Extension (JAVA tab) configuration of IDM management console

Best regards,

Ivan Petrov

Former Member
0 Kudos

Code is pasted as above. Not sure if there is any problem in it really as i could see in the logs following exception "Could not find validator: testcustomer.idm.impl.MyOnSubmit"

What JAVA TAB should i check here ? Is the Result Handling tab in the task or something else ? (Referencing the class from the task configuration)

ivan_petrov
Active Participant
0 Kudos

Hi Karthikeyan,

Look at this:

The error you received mean that IDM cannot find java class.

Best regards,

Ivan

Former Member
0 Kudos

Thanks for the screenshot. Actually we included sap.com~tc~idm~jmx~extfwk~default.jar in the class extension and still we are getting the same error. Do we need to include any other path here ?

Apart from following the pdf this is the one extra step that we did as of now.

Thanks

Karthik

ivan_petrov
Active Participant
0 Kudos

Hi Karthikeyan,

I don't have any other idea, but still for confirming that this doesn't work please put a screen shot of changes you have made in Java configuration tab.

Best regards,

Ivan

Former Member
0 Kudos

Please find above the screenshot. Kindly let me know if anything is incorrect ?

Former Member
0 Kudos

Yes. I copied the code from PDF

package testcustomer.idm.impl;

import com.sap.idm.extension.TaskProcessingAdapter;
import java.util.Locale;
import com.sap.idm.extension.IdMExtensionException;
import com.sap.idm.extension.api.IdMSubmitData;
import com.sap.idm.extension.api.IdMValueChange;
import com.sap.idm.extension.api.Task;

public class MyOnSubmit extends TaskProcessingAdapter {
/**
* This onSubmit method makes sure that the mobile phone
* number is prefixed with the international country code
* if it is missing (here "+47").
*/
public IdMValueChange[] onSubmit(Locale locale, int subjectMSKEY, int
objectMSKEY, Task task, IdMSubmitData validate)
throws IdMExtensionException {
  IdMValueChange[] changes = validate.getChangeList();
for (int i = 0; i < changes.length; i++) {
IdMValueChange aIdmValueToFix = changes[i];
String aAttr = aIdmValueToFix.getAttributeName();
if (aAttr.equalsIgnoreCase("MX_MOBILE_PRIMARY")) {
String aValue =
aIdmValueToFix.getAttributeValue().trim();
// Add international prefix if missing
if (!aValue.startsWith("+")) {
aValue = "+47 " + aValue;
aIdmValueToFix.setAttributeValue(aValue);
}
}
}
return changes;
}
}

Can you please advise where its going wrong here ?

ivan_petrov
Active Participant
0 Kudos

Hi Karthikeyan,

Do you added path to jar file in Class Path Extension (JAVA tab) configuration of IDM management console?

Best regards,

Ivan

Former Member
0 Kudos

Did you copy and paste directly from the document?

I assume that the error message is the default IdMExtensionException in which case there's probably a problem with the java code...

Peter