adding unit cost field in the production BOM line

johnson_alonsojohnson_alonso Member Posts: 690
Dear all,

I would like to ask you if there is a nother coding if I want to add unit cost field in production BOM line, the codings are as follows:

CASE Type OF
Type::Item:
BEGIN
Item.GET("No.");
.....
"Unit Cost" := xxx."Unit Cost";

in the properties I also set fieldclass and calcformula. I just want to know of there is another method besides the above, yes indeed my coding work good, if I select an item from item list and then press OK, the line in the production BOM will consists of unit cost in the unit cost field.

before I set properties, it can't work. I wonder whether one or two or more of this forum members have done what I've done too. I am not a developer but I understand well enough about developing techniques, where I can do that without manual books, other person's help, andso on.



Rgds,

Johnson

"stronger than all"

Comments

  • ara3nara3n Member Posts: 9,257
    The code will work on new records that are inserted on production bom line. If you want to populate the existing records, you have to write a report.

    As for making it a flowfield, I guess that is what you meant by
    (fieldclass and calcformula). yes you can make it a flowfield, but then you don't need to change any code.


    So basically you did the two ways, and you only need to do one.
    With the coding, the problem will be that the data won't be updated if you change the unit cost on the item card. So you have to write more code to sync them up. flowfield would be the easier solution in this case.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • DenSterDenSter Member Posts: 8,307
    I would not make a cost field a flowfield, simply because the cost could be different for different orders.
  • ara3nara3n Member Posts: 9,257
    what do you mean by that DenSter?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • johnson_alonsojohnson_alonso Member Posts: 690
    Dear Ara3n is right, after I made it I aware that I must create a function button to update if there is a cost change in the items but especially for standard cost, I think it will be rarely to do. after production order set to finished, the production BOM will be remain on history only.
    I am currently in Singapore on Vacation and view Mibuso on the grand cophtorne waterfront hotel. It's nice to vacation here.


    Rgds,
    Johnson Alonso

    http://sea-navision-community.blogspot.com (see the members update)
    mailists:
    sea-navision-community-subscribe@yahoogroups.com
Sign In or Register to comment.