cancel
Showing results for 
Search instead for 
Did you mean: 

Default Value for date in web UI

clotilde_martinez
Participant
0 Kudos

Hi,

I'm working on a form on IDM 8.0 (classic webdynpro). I'd like to have the MX_VALIDFROM set to today's date when opening the form.

I tried with the parameter %ddm.-date%, it didn't work.

I tried putting a date with format yyyy-mm-dd, it worked (but obviously, I won't go and change it everyday to put the correct date).

Must I conclude that the forms can't retrieve parameters, only strings? Or should I review the syntax (I copied/pasted my constant from another pass since the ctrl+space didn't work on the Default Value column...)

Did anyone manage to do it?

Thanks a lot,

Clotilde

Accepted Solutions (1)

Accepted Solutions (1)

lambert-giese
Active Participant
0 Kudos

Following up on Matt's suggestion to solve this using an onLoad extension: there's the free and open source Rhidmo® extension for SAP IDM 8.0 which enables you to implement onLoad handlers as a normal SAP IDM package script using the JavaScript language. The benefit is that this can be developed and transported using your well-known SAP IDM Developer Studio directly. No custom Java development required.

In case you wish to have a look, Rhidmo® has a GitHub project site here:

https://github.com/foxysoft/idm-extension-rhidmo

clotilde_martinez
Participant
0 Kudos

Great, I knew the Rhidmo extension back in 7.2 but I didn't know it also applied to IDM 8.0, I might give it a try.

Thanks a lot,

Clotilde

clotilde_martinez
Participant
0 Kudos

Hi lambert.boskamp,

I'm completely new to gitHub, git and Maven. I think i figured out how to retrieve the archive in my eclipse using Git, but I don't have a clue on how to generate the ear file (since i didn't find it in the archive, I guessed i have to do it from the project).

I saw the command lines

But i don't know where to launch them. That's why i tried it from eclipse, where git and maven are available as plugins. Could you help me please?

Thanks a lot,

Clotilde

lambert-giese
Active Participant

If your unfamiliar with Maven and Git, the easiest way is to download the latest Rhidmo release precompiled directly from GitHub. You can always find the latest release at

https://github.com/foxysoft/idm-extension-rhidmo/releases/latest

Regarding your original question - how to build with Maven directly from Eclipse? - it depends on the exact set of plugins you have in your Eclipse environment. It's possible, for instance, with the m2eclipse plugin. The process is documented here. In short, you need to create a new "Run configuration" of type "Maven Build", and specify the required parameters as shown in the following screenshot:

clotilde_martinez
Participant
0 Kudos

Great thank you, I was able to download the ear. And I think the deployment procedure is pretty clear on the PDF.

Thank you again,

Clotilde

clotilde_martinez
Participant
0 Kudos

Hi lambert.boskamp,

I have another question : I managed to deploy rhidmo correctly (or at least apparently). I created a script to check if someone with the same firstname, lastname and birthdate was already present in the IDM database.

I can see in the developer logs that my script is called correctly. But I can't find a way to get the user's mskey or the filled attributes in the web UI, and I get the following error in the UI : "Values validity cannot be checked"

I tried to show what the input was using uError(Par), and all I got in the log was "fr", so I'm guessing my script doesn't receive any input from the UI.

Is there a method to get them?

I tried getField from a website I found and had the error :

Error during custom validation
[EXCEPTION]
org.mozilla.javascript.EcmaError: TypeError: Cannot find function getField in object fr

What would be the function to get my parameters?

thank you,

Clotilde

lambert-giese
Active Participant

When using Rhidmo for SAP IDM 8.0, the function signatures of the extension functions you implement in JavaScript are exactly the same as when you would implement the same in Java:

IdMValue[] onLoad(Locale locale, int subjectMSKEY, int objectMSKEY,
Task task, IdMLoadData data) throws IdMExtensionException

IdMValueChange[]  onSubmit(Locale  locale,  int  subjectMSKEY,int objectMSKEY, Task task, IdMSubmitData validate) throws IdMExtensionException


Just they don't need to be named onLoad and onSubmit; you can choose any name you want.

The source code examples given in the SAP Identity Management Extension Framework Implementation Guide apply 1:1 to Rhidmo, except that you need to use JavaScript syntax instead of Java syntax. This useful guide on MDN may help you with specific "turn Java into JavaScript" questions.

The reason why you get "fr" when using uError(Par) is that when you (erroneously) delcare your JavaScript function as myFunction(Par), you only assign a name (Par) to the first parameter, which is the user's locale. The value of the user's locale is "fr", which means French.

To fix this, declare five parameters as shown above. Then you have direct access to the user's MSKEY in subjectMSKEY, and you can access all the data using the fifth parameter (data/validate). Again, please refer SAP's implementation guide linked above for more specific information on how to deal with each parameter..

clotilde_martinez
Participant
0 Kudos

Thank you again, I'm going to read all of this.

Clotilde

clotilde_martinez
Participant

Hello,

I managed to do it \o/

For future reference, this blog also helped a lot :https://blogs.sap.com/2010/04/15/java-input-validation-with-idm-71-sp4/

I mainly had a problem on how to send the error message to the UI. It now works perfectly.

Regards,

Clotilde

Answers (2)

Answers (2)

former_member2987
Active Contributor
0 Kudos

Maybe an OnLoad Java extension? Not too up on that particular part of IDM, but it's an idea. Hmmm.... Maybe a small project for me? 🙂

clotilde_martinez
Participant
0 Kudos

Haha, for another requirement I actually looked the OnLoad Java extension so I might use that, even though Rhidmo seems easier to setup. I'll keep you posted 😉

former_member2987
Active Contributor
0 Kudos

That's Kai's package? Only issue I could see is that it costs money, but then again so does your development time. 🙂

clotilde_martinez
Participant
0 Kudos

According to Lambert comment above yours, he wrote "free and open source", but i also remembered that in 7.2 it wasn't free. Didn't have a chance to read the new documentation yet.

Steffi_Warnecke
Active Contributor
0 Kudos

Hello Clotilde,

I had the same idea for a UI mask in 7.2., but could not get it working. Now I have no default value on the mask, but if the user does not put a value, after saving I calculate the current date and write it to the attribute (with a script that checks, if the attribut is empty). So kind of the other way around.

.

Regards,

Steffi.

clotilde_martinez
Participant
0 Kudos

Thank you Steffi 🙂 For now, I put the date as mandatory, this way it can't be empty, hope that it will be enough for the end users.