codeunit problem

Markandey_PandeyMarkandey_Pandey Member Posts: 178
Hi all,

I have added some fields to the Purchase Header Table and the same i have added to Purchase Invoice Header table.
Now i want to update the fields of Purch. Inv Header Table having the data of Purchase Header table, when the invoice is posted.

can anybody guide me how to do this.
Markandey Pandey

Comments

  • kapamaroukapamarou Member Posts: 1,152
    If your fields have the same ID (number) then they will be transferred automatically.

    Lookup TRANSFERFIELDS command.
  • Markandey_PandeyMarkandey_Pandey Member Posts: 178
    kapamarou wrote:
    If your fields have the same ID (number) then they will be transferred automatically.

    Lookup TRANSFERFIELDS command.


    Thanx
    Markandey Pandey
  • ara3nara3n Member Posts: 9,256
    standard Navision posting routine already are using Transferfields.

    So you shouldn't need any programming.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • stvnstvn Member Posts: 4
    Hi i'm new to navision, anyone can tell me what's is this code mean please thankx. The red color highlighted .


    IF NOT FIND('-') THEN BEGIN
    INIT;
    STVN
  • IsakssonMiIsakssonMi Member Posts: 77
    That means FINDFIRST.
  • DenSterDenSter Member Posts: 8,305
    IsakssonMi wrote:
    That means FINDFIRST.
    No it most definately does NOT mean FINDFIRST
  • IsakssonMiIsakssonMi Member Posts: 77
    DenSter wrote:
    IsakssonMi wrote:
    That means FINDFIRST.
    No it most definately does NOT mean FINDFIRST

    (He asked for the red highlight)
  • KYDutchieKYDutchie Member Posts: 345
    yes,

    but the whole line of code is a really expensive way of doing an ISEMPTY, especially on SQL.

    In these kind of situations please replace it with:

    IF ISEMPTY THEN BEGIN
    INIT;

    Regards,

    Willy
    Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
  • DenSterDenSter Member Posts: 8,305
    IsakssonMi wrote:
    DenSter wrote:
    IsakssonMi wrote:
    That means FINDFIRST.
    No it most definately does NOT mean FINDFIRST

    (He asked for the red highlight)
    And that STILL doesn't mean the same.
  • vijay_gvijay_g Member Posts: 884
    IsakssonMi wrote:
    IsakssonMi wrote:
    That means FINDFIRST.

    (He asked for the red highlight)

    You should have a look in Navision help and view about findset and findfirst.
  • IsakssonMiIsakssonMi Member Posts: 77
    DenSter wrote:
    And that STILL doesn't mean the same.

    Without debugging the SQL-queries that NAV creates I found this in the help:

    FINDFIRST (Record)
    Use this function to find the first record in a table based on the current key and filter.

    FIND (Record)
    Use this function to find a record in a C/SIDE table based on the values stored in keys.
    '-' The first record in the table ('-' can only be used alone)

    I guess the case is closed :roll:
  • DenSterDenSter Member Posts: 8,305
    IsakssonMi wrote:
    DenSter wrote:
    And that STILL doesn't mean the same.

    Without debugging the SQL-queries that NAV creates I found this in the help:

    FINDFIRST (Record)
    Use this function to find the first record in a table based on the current key and filter.

    FIND (Record)
    Use this function to find a record in a C/SIDE table based on the values stored in keys.
    '-' The first record in the table ('-' can only be used alone)

    I guess the case is closed :roll:
    FINDFIRST retrieves just one record, FIND('-') can retrieve more than one.

    You can roll your eyes at me all you want. They are not the same.
  • rdebathrdebath Member Posts: 383
    IsakssonMi wrote:
    I guess the case is closed :roll:
    If that's what you really believe then you must never ever use FINDFIRST, FINDLAST or FINDSET. They will not have any benefit for you and if used improperly can seriously change the performance of your code.

    OTOH, you could read more documentation than a superficial scan of and old help file.
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Again and again this old discussion because of someone who posted a new topic to an old thread?! This has been discussed many times and can be found easily by the search function. I think it doesn't deserve an answer especially no annoying discussion. :thumbsdown:
    Sorry for that, guys.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
Sign In or Register to comment.