Job Queue in NAV 4.0?

nvermanverma Member Posts: 396
Hi yall,

Has anyone been able to implement Job Queue functionality from NAV 5.0 to NAV 4.0.

One of our customer is still using NAV4.0 and they want some reports to get executed automatically. Therefore, we decided to use NAS. However, rather than modifying CU 1 all the time, I was wondering has anyone been able to successfully implement Job Queue functionality from NAV 5 to NAV 4.

If someone was able to do it successfully, and they wouldn't mind sharing the modified objects or giving me tips as to how they were able to do it, will be much appreciated.

Answers

  • FDickschatFDickschat Member Posts: 380
    In the Object Designer of NAV 5 (why not 2009 R2?) just filter Name = "Job Queue*". Export all Objects from Source DB
    Import into NAV 4 (5 Tables, 6 Forms + 2 CUs)
    Amend CU448: Remove all References to Clearlasterror, Getlasterror - Functions do not exist in NAV4
    Amend CU1
    Re-Compile all Job Queue objects
    Done

    Maybe at the same time a technical upgrade to 2009 R2? This would give you the possibility to use Clearlasterror, Getlasterror.
    Frank Dickschat
    FD Consulting
  • tinoruijstinoruijs Member Posts: 1,226
    And I guess you have to get a new license for 4.0 to access the imported new objects. Ask your partner for a renewed version.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • nvermanverma Member Posts: 396
    I was going to give that a try, but I just wanted to know if someone else had any issues with the import or the functionality once it was completed (aka placed in NAV 4.0).

    Adding Job Queue functionality will require additional granule to be added to the license?
  • tinoruijstinoruijs Member Posts: 1,226
    nverma wrote:
    Adding Job Queue functionality will require additional granule to be added to the license?

    I'm not sure, but you can expect it.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • nvermanverma Member Posts: 396
    Thanks FDickschat this worked.
    FDickschat wrote:
    In the Object Designer of NAV 5 (why not 2009 R2?) just filter Name = "Job Queue*". Export all Objects from Source DB
    Import into NAV 4 (5 Tables, 6 Forms + 2 CUs)
    Amend CU448: Remove all References to Clearlasterror, Getlasterror - Functions do not exist in NAV4
    Amend CU1
    Re-Compile all Job Queue objects
    Done

    Maybe at the same time a technical upgrade to 2009 R2? This would give you the possibility to use Clearlasterror, Getlasterror.

    I also had to modify the HasWinPermission function in 'Job Queue Start Codeunit' since I was getting the following error (Reference to the member ShortUserID of the variable could not be solved.) .
    IF WinLogin.FINDSET THEN
    REPEAT
    WinLogin.CALCFIELDS(ID);
    // >> ARP1
    CopyFromPos := STRLEN(WinLogin.ID) - STRLEN(UserId2);
    IF CopyFromPos <= 0 THEN
    CopyFromPos := 1;
    Found := UPPERCASE(COPYSTR(WinLogin.ID,CopyFromPos)) = UPPERCASE(STRSUBSTNO('\%1',UserId2));
    //Found := UPPERCASE(COPYSTR(WinLogin.ID,STRLEN(WinLogin.ID) - STRLEN(UserId2))) = UPPERCASE(STRSUBSTNO('\%1',UserId2));
    // << ARP1
    // >> ARP2
    IF Found THEN
    WinLogin2.GET(WinLogin.SID);
    // << ARP2
    UNTIL Found OR (WinLogin.NEXT = 0);
    IF NOT Found THEN
    EXIT(FALSE);

    // >> ARP2
    //HasPermission := WinAccessControl.GET(WinLogin.SID,'SUPER',COMPANYNAME);
    HasPermission := WinAccessControl.GET(WinLogin2.SID,'SUPER',COMPANYNAME);
    // << ARP2
    IF NOT HasPermission THEN
    // >> ARP2
    //HasPermission := WinAccessControl.GET(WinLogin.SID,'SUPER','');
    HasPermission := WinAccessControl.GET(WinLogin2.SID,'SUPER','');
    // << ARP2
    IF HasPermission THEN
    EXIT(TRUE);

    Permission.SETRANGE("Object Type",ObjectType);
    Permission.SETRANGE("Object ID",ObjectID);
    Permission.SETRANGE("Execute Permission",Permission."Execute Permission"::Yes);
    IF Permission.FINDSET THEN
    REPEAT
    // >> ARP2
    //HasPermission := WinAccessControl.GET(WinLogin.SID,Permission."Role ID",COMPANYNAME);
    HasPermission := WinAccessControl.GET(WinLogin2.SID,Permission."Role ID",COMPANYNAME);
    // << ARP2
    IF NOT HasPermission THEN
    // >> ARP2
    //HasPermission := WinAccessControl.GET(WinLogin.SID,Permission."Role ID",'');
    HasPermission := WinAccessControl.GET(WinLogin2.SID,Permission."Role ID",'');
    // << ARP2
    UNTIL HasPermission OR (Permission.NEXT = 0);
    EXIT(HasPermission);

    The function modification mentioned above was from the following post --> http://dynamicsuser.net/forums/p/26131/141438.aspx
Sign In or Register to comment.