Update the new field value for old records

manjulcha007manjulcha007 Member Posts: 7
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

  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    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...
  • manjulcha007manjulcha007 Member Posts: 7
    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.
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    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...
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    What is the field type and value?

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

    Regards
    Manjul
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    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?
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    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...
  • manjulcha007manjulcha007 Member Posts: 7
    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
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    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;
  • manjulcha007manjulcha007 Member Posts: 7
    can u please explain me where im wrong step by step. im not clear.

    Regards
    manjul
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    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..
  • manjulcha007manjulcha007 Member Posts: 7
    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.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    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:
  • GRIZZLYGRIZZLY Member Posts: 127
    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
Sign In or Register to comment.