How to enable the purchases of Resources in Dynamics NAV?

AdministratorAdministrator Member, Moderator, Administrator Posts: 2,476
edited 2014-04-17 in How Tos section
How to enable the purchases of Resources in Dynamics NAV?

Discuss this How To here.


  • Luc_VanDyckLuc_VanDyck AartselaarMember, Moderator, Administrator Posts: 3,632
    So you are saying that How To's for beginners should not be posted. Don't you forget you were once a beginner also.
    No support using PM or e-mail - Please use this forum.
    NAV TechDays 2021: 18 & 19 November 2021, Antwerp (Belgium)
  • ajhvdbajhvdb Member Posts: 672
    I never implemented this but like the howto, thx.

    I always say it's not possible and can think of some pitfalls if the customer starts using it. Am i correct?
  • David_SingletonDavid_Singleton Member Posts: 5,456
    BlackTiger wrote:
    What is a point to post this "helpful" how-to?
    Each NAV developer knows how to do it. It's task for beginners.

    Have you heard of Prozac? :mrgreen:
    David Singleton
  • garakgarak Member Posts: 3,263
    good post. it gives a good start point to implement the resources on purchase.
    Hope no customer of mine, which i have sold this customized add-on for some times, find this how to ;-) then they see, that my settle time is to "heavy" :whistle:
    Do you make it right, it works too!
  • Alex_ChowAlex_Chow Member Posts: 5,063
    One thing I might add to this add-on (if it hasn't been mentioned already) is that don't just download the objects and import it into your database. You will need a developer license in order to put this mod in.
  • mgmmgm Member Posts: 126
    ehhh (I almost don't dare to ask),
    Just some beginners questions:
    - Where are Job Ledger Entries created?
    - What version is it made for?
    Since 5.0 a Job has a Task and Planning Lines. I don't see anything with that.
    (I must admit I did not try the code yet).
  • zoranpzoranp Member Posts: 3

    I love this code. I'm just sorry that mibuso didn't exist when I started to "adapt" NAV.

    But going back to the topic - your how-to is not complete. You forgot to mention these:
    - you need to include table 5110
    - you need to change OptionString and OptionCaption of field Type on forms 54,55,97,98,5165,5168,6641 and include Resource otherwise it will not show in these forms
    - what about Requisition Lines and changes to Calculate Plan batch job?
    - what about using Resource Costs?
    - what about adding Purchase option also to Res. Journal Line?

    These are all things that you have to consider before enabling purchase of resources.

  • chadchad Member Posts: 25
    Very helpful topic specially for begginers modifying purchases. :)
  • MeriMeri Member Posts: 29
    :D:D Hi everyone :)

    I saw the code for purchasing Resources and it is very very helpfull but I cannot understand the folloing two rows:

    ResJnlLine."Unit Price" := PurchLine.Amount/PurchLine.Quantity;
    ResJnlLine."Total Price" := PurchLine.Amount;

    Why the Purchase Price and the Purchase Amount are taken for Unit Price and Total Price while posting (aren't the Unit Price and Total Price related to sales transactions? After posting the Purchase transaction in the Resource Ledger Entry the Unit Cost/Total Cost and the Unit Price/Total Price have same values. Why is that?

    I did post Purchase Entry with the Resource Jounral and the Unit Price/Total Price are left blank in the RLE if there isn't defined Unit Price on the Resource Card or if there is defined Unit Price in the Resource card are filled with the Unit Pirce form the Resource Card which means in the two cases are different than the Unit Cost/Total Cost.

    Can somebody explain? :oops:

    Thanks in advance :)
  • tinoruijstinoruijs Member Posts: 1,226
    Just implemented this in NAV 2013 R2.
    Because of the new dimensions some code has to be replaced:
              //TempDocDim.SETRANGE("Table ID",DATABASE::"Purchase Line");
              //TempDocDim.SETRANGE("Line No.",PurchLine."Line No.");
              ResJnlLine."Dimension Set ID" := PurchLine."Dimension Set ID";

    Much easier than before. :-)

    Now I only have to find out why there are no Job Ledger Entries created when posting an invoice to a Job.. :-(

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • tinoruijstinoruijs Member Posts: 1,226
    tinoruijs wrote:
    Now I only have to find out why there are no Job Ledger Entries created when posting an invoice to a Job.. :-(

    After ResJnlPostLine.RunWithCheck(ResJnlLine); in codeunit 90 I added:
              // RS TRU 19-02-2014 BEGIN
              IF (PurchLine."Job No." <> '') THEN BEGIN;
                CreateJobPurchLine(JobPurchLine,PurchLine,"Prices Including VAT");
              // RS TRU 19-02-2014 END

    And in codeunit 1001 in function InsertPurchLine:
    // RS TRU 19-02-2014 BEGIN
    //IF (PurchLine.Type <> PurchLine.Type::Item) AND (PurchLine.Type <> PurchLine.Type::"G/L Account") THEN
    //  EXIT;
    IF (PurchLine.Type <> PurchLine.Type::Item) AND 
       (PurchLine.Type <> PurchLine.Type::"G/L Account") AND
       (PurchLine.Type <> PurchLine.Type::Resource) THEN
    // RS TRU 19-02-2014 END

    And in codeunit 1004 in function FromPurchaseLineToJnlLine:
      // RS TRU 19-02-2014 BEGIN
      //IF Type = Type::"G/L Account" THEN
      //  JobJnlLine.VALIDATE(Type,JobJnlLine.Type::"G/L Account")
      //  JobJnlLine.VALIDATE(Type,JobJnlLine.Type::Item);
      CASE Type OF
        Type::"G/L Account": JobJnlLine.VALIDATE(Type,JobJnlLine.Type::"G/L Account");
        Type::Item: JobJnlLine.VALIDATE(Type,JobJnlLine.Type::Item);
        Type::Resource: JobJnlLine.VALIDATE(Type,JobJnlLine.Type::Resource);
      // RS TRU 19-02-2014 END

    That's it. First tests are ok. Not yet tested completely.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • tinoruijstinoruijs Member Posts: 1,226
    Just to add to the needed changes.
    Had to change function CreateTempJobJnlLine in table 39.
    Added Type::resource next to G/L and Item.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • MoiresMoires Member Posts: 1
    Thanks for the guide. I'm just a beginner and stuff like this helps a lot!
Sign In or Register to comment.