title: WeekOfYear in X++ using .net lib
body: <pre><code> static void Job5(Args _args)
      {
       int i;
       System.DateTime netDttm;
       System.Int32 intnet;
      ;
       netDttm = new System.DateTime(2011,03,20 ,13,44,55);
       intnet = System.Globalization.CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(netDttm, Globalization.CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Sunday);
  
       i = intnet;
  
       info(int2str(i));
     }
  </code></pre>
  
  <p>I tried the in vb.net it works fine but doing the same in x++(using .net lib) it shows syntax error..All I am trying is to get the week no. from a supplied date. Any insight would be appreciated.</p>
  
  <p>P.S. I found another solution to this which is I created a dll file in VS .net and added this to Reference node(AOT)of AX. It has shorten the code in AX 
     <code>static void Job5(Args _args)
      {
      weekofyear.wof asd; 
      ;
      asd = new weekofyear.Wof();
      print asd.weekofyr(today());
      pause;
      }</code></p>