Production Entry Revision number

SOLVED

Hi,

I've been wondering if there's a way to get the latest revision number from A Bill of Materials.

I've tried to get the value by uising  oProduction.nGetValue("Revision$", strRevisionNo) but im still getting the "000" revision number.

Thanks!

  • +1
    verified answer

    BM_Bill_bus has a property called MultipleRevisionsExist which should be 1 for true or 0 for false.

    BM_BillHeader_svc has a method called FindCurrentRevision which can be passed a bill number as the first and only argument and the method will return the current revision.

    Now to answer your question regarding the "latest" revision, it depends on how you determine which revision is the latest, by the DateUpdated field or by the alphabetical order of the revisions. If the latter, then you could use either object referenced above, although i would use the service object if you only need to read info from the header. One you have you object handle, use the SetBrowseFilter method and pass the only the bill number (you may need to include a Chr(0) appended to the bill number) as the first and only argument. If the returned value is a 1, then there should be at least one record that matches the browse filter and you can then use the MoveLast method to go to the last record and use GetValue on the revision. If the former, you may find it easier to do a ODBC query on BM_BillHeader with a WHERE clause on the BillNo and a SORT BY clause in descending order on the DateUpdated field then look at the first record.