none
Exporting accountExpires RRS feed

  • Question

  • Hi 

    i'am using an extension rule for exporting the employeeEndDate  value to accountExpires. 

    I have an issue ,when i delete the value in FIM, I can't manage the update of the accountExpires to set it to 0 

     if (mventry[MVConst.empEndDate].IsPresent)
                        {
                            CultureInfo provider = CultureInfo.InvariantCulture;
    
                            if (mventry[MVConst.empEndDate].Value != null)
                            {
                                DateTime dt = DateTime.ParseExact(mventry[MVConst.empEndDate].Value, "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'", provider);
                                csentry["accountExpires"].IntegerValue = dt.AddDays(1).ToFileTime();
                              
                            }
                            else
                            {
                                csentry["accountExpires"].IntegerValue = 0;
                            }
                           
    					   
                        }
                        else {
                            csentry["accountExpires"].IntegerValue = 0;
                        }


    Any idea 

    Friday, June 26, 2015 10:44 AM

Answers

  • I am looking at your code.  Besides the fact that I don't know why you are using MVConst.emplEndDate instead of simply emplEndDate, it all looks good.

    You really need to debug and see what is happening.  I would also try to set it to a string instead of integer.

    csentry["accountExpires"].Value = "0";

    or try this

    csentry["accountExpires"].Value = "9223372036854775807";


    Nosh Mernacaj, Identity Management Specialist

    • Marked as answer by gentelman Friday, June 26, 2015 2:05 PM
    Friday, June 26, 2015 1:36 PM
  • But you are looking what is going into the AccoutnExpires. So you need to see that part.

    Also, try setting the values as I suggested in a string format.


    Nosh Mernacaj, Identity Management Specialist

    • Marked as answer by gentelman Friday, June 26, 2015 2:05 PM
    Friday, June 26, 2015 1:43 PM

All replies

  • You need to add an if statement where you say if mventey does not exist, set csentry to 0

    Nosh Mernacaj, Identity Management Specialist

    Friday, June 26, 2015 11:43 AM
  • I did a condition:  mventry[MVConst.empEndDate].IsPresent but it does not work

    Friday, June 26, 2015 12:09 PM
  • I am looking at your code.  Besides the fact that I don't know why you are using MVConst.emplEndDate instead of simply emplEndDate, it all looks good.

    You really need to debug and see what is happening.  I would also try to set it to a string instead of integer.

    csentry["accountExpires"].Value = "0";

    or try this

    csentry["accountExpires"].Value = "9223372036854775807";


    Nosh Mernacaj, Identity Management Specialist

    • Marked as answer by gentelman Friday, June 26, 2015 2:05 PM
    Friday, June 26, 2015 1:36 PM
  • When I run a preview I have a status not applied for my emplEndDate.


    Friday, June 26, 2015 1:40 PM
  • But you are looking what is going into the AccoutnExpires. So you need to see that part.

    Also, try setting the values as I suggested in a string format.


    Nosh Mernacaj, Identity Management Specialist

    • Marked as answer by gentelman Friday, June 26, 2015 2:05 PM
    Friday, June 26, 2015 1:43 PM