Update the new field value for old records

Hi all,

Im using navision 6.0 sp1, i have added a new field in the table production order (5405) now i want to update the new field value for old records. i have tried from many ways but im not getting the value.

Regards
Manjul

Comments

  • Hi all,

    Im using navision 6.0 sp1, i have added a new field in the table production order (5405) now i want to update the new field value for old records. i have tried from many ways but im not getting the value.

    Regards
    Manjul

    :? I'm not sure I got what you want to do. You want to fill this new field also for records created before the creation of this field?
    ~Rik~
    It works as expected... More or Less...
  • yes, I want to update new field value for previous records. before created this new field. this new field value is coming ok for new orders but i want to update it for previous records.
  • yes, I want to update new field value for previous records. before created this new field. this new field value is coming ok for new orders but i want to update it for previous records.

    ok perfect. What did you try so far, and what error you got?
    ~Rik~
    It works as expected... More or Less...
  • What is the field type and value?

    You can run a batch job/report to fill the previous records..
  • My new field type is decimal, i have tried by creating a process only report.

    Regards
    Manjul
  • yes, I want to update new field value for previous records. before created this new field. this new field value is coming ok for new orders but i want to update it for previous records.

    ok perfect. What did you try so far, and what error you got?

    :thumbsup:

    Can you show what did you try?
  • My new field type is decimal, i have tried by creating a process only report.

    Regards
    Manjul

    Could be the right way to follow. Show us what stopped you...
    ~Rik~
    It works as expected... More or Less...
  • Actually i have created a new field which is Current batch size which is decimal.

    "Current Batch size" := ("Production Order".Quantity/"No. of Units")*"Production Order"."Batch Size";
    here "No. of Units" field is coming from different table Production bom header.

    Its working for new orders,

    My code in process only report


    ProductionBOMHeader.RESET;
    ProductionBOMHeader.SETRANGE("No.","Prod. BOM No.");
    IF "Production Order".FINDFIRST THEN BEGIN
    REPEAT
    "Current Batch size" := (Quantity/"No. of Units")*"Production Order"."Batch Size";
    MODIFY;
    UNTIL ProductionBOMHeader.NEXT =0;
    End;
    here ProductionBOMHeader table is a record, production bom header table.

    Regards
    Manjul
  • ProductionBOMHeader.RESET;
    ProductionBOMHeader.SETRANGE("No.","Prod. BOM No.");
    IF "Production Order".FINDFIRST THEN BEGIN
    REPEAT
    "Current Batch size" := (Quantity/"No. of Units")*"Production Order"."Batch Size";
    MODIFY;
    UNTIL ProductionBOMHeader.NEXT =0;
    End;
    here ProductionBOMHeader table is a record, production bom header table.

    Have you taken any dataitem (if yes, in which trigger you have written) or you wrote it in report triggers?

    You have put filter on ProductionBOMHeader and wrote "Production Order".FINDFIRST
    it should be ProductionBOMHeader.FINDSET and ProductionBOMHeader.MODIFY;
  • can u please explain me where im wrong step by step. im not clear.

    Regards
    manjul
  • can u please explain me where im wrong step by step. im not clear.

    Are you a technical consultant?
    Contact your senior technical person in your organization for step by step explanation..
  • Sir i think you are frusted with my comment im a beginner in technical environment here is no senior thats why im asking sir................. Sory if u feel hurt.
  • Have you taken any dataitem (if yes, in which trigger you have written) or you wrote it in report triggers?

    I hope you have taken Production Order as dataitem in report :-k

    and also I hope you are trying in test database only :wink:
  • I could only guess what you want to do... I suggest to use this code:
    IF ProductionBOMHeader.GET("Prod. BOM No.") THEN BEGIN
      "Current Batch size" := (Quantity/"No. of Units")*ProductionBOMHeader."Batch Size";
      MODIFY;
    END;
    
    Sincerely yours, GRIZZLY
    Follow my blog at http://x-dynamics.blogspot.com