Flow a datetime from a reference in a worklow

Dear all,

I'm trying to flow a datetime attribute in a workflow from a reference user without success.

The goal is to populate our admins accounts with the same end date than the normal user account.

[//Target/UserRefence/EndDate] to [//Target/EndDate].

Does someone knows how to achieve this?

Thanks in advance,

Yannick

June 24th, 2015 6:39am

Since these are 2 different objects you can not access them at one time, Requests only have access to the requestors and target objects.

You will need to have a custom activity (PowerShell for ex.). This activity should search for the corresponding adminuser of the normal user, and should change the date attribute on that.

Use this activity in a as a action workflow that triggers on users enddate changes.

/Peter

Free Windows Admin Tool Kit Click here and download it now
June 24th, 2015 7:13am

Thanks peter but in fact, it works for string attributes but not for datetime.

For example, a custom expression with [//Target/UserRefence/City] to [//Target/City] is ok.

Maybe there is a trick with a date conversion?

Regards,

Yannick

June 24th, 2015 7:30am

ohh yes sorry, i see the two objects are referenced, so of course you can do that.

I checked this and also got an "PostProcessing" Error, the eventlog says:

System.ArgumentException: The parameter for the function is of an unknown type: '2003-01-01 00:00'. System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
   at System.Guid..ctor(String g)

Seem that the automatic GUID detection thinks that the date look similar to an GUID and tries to resolv this to an object. Could be a bug, you can report this to support.

As a Workaround you can also use a custom activity, which read the date from the attribute and sets it back. I think you can supress the resolving using this method.

/Peter

Free Windows Admin Tool Kit Click here and download it now
June 24th, 2015 8:14am

Thank you very much Peter.

I wanted to avoid a custom activity... As a good starting point, do you think i can use the following sample from Ross Curie for my date flow?

http://www.fimspecialist.com/fim-portal/custom-workflow-examples/update-resource-activity-example/

Yannick

June 24th, 2015 8:34am

There's a date bug in the Function Evaluator. Try adding :00 to your date.

e.g.

[//Target/UserRefence/EndDate]:00 to [//Target/EndDate]

Free Windows Admin Tool Kit Click here and download it now
June 24th, 2015 8:44am

I can't, FIM says it is not a valid attribute when i save the workflow
June 24th, 2015 8:50am

Ok. We use the Granfeldt Activity Library, which seems to handle this.

https://fimactivitylibrary.codeplex.com/wikipage?title=Copy%20Values&referringTitle=Documentation

Free Windows Admin Tool Kit Click here and download it now
June 25th, 2015 2:37am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics