Syntax for Object Designer?

Is there a reference out there for using proper syntax when using the object designer to make changes to data fields?

I’m not sure I follow what you are talking about. What exactly are you trying to do?

I am trying to change the qty. per unit of measure for one of the units of measure for a family of items, of which I have 1000’s of parts so wish to do using an automated routine. Here is my sytax:

ItemUnitofMeasure.GET(Item.“No.”,‘ultr100MER’);
ItemUnitofMeasure.“Qty. per Unit of Measure” := 151;

MODIFY;

Firstly, replace MODIFY by ItemUnitofMeasure.MODIFY.

Where have you written this code? Is it a processing only report, having Item as dataitem and code is written on OnAfterGetRecord trigger?

Do you want to change “Qty. per Unit of Measure” value for all items to 151?

In some of the cases (where primary key value is not found)
ItemUnitofMeasure.GET(Item.“No.”,‘ultr100MER’) will give error also, so you may like to replace it by :

IF ItemUnitofMeasure.GET(Item.“No.”,‘ultr100MER’) THEN BEGIN
ItemUnitofMeasure.“Qty. per Unit of Measure” := 151;

ItemUnitofMeasure.MODIFY;

END;

I would use syntax “ItemUnitofMeasure.VALIDATE(“Qty. per Unit of Measure”, 151);”.

If your Item-UOM on some item is the Base-UOM you will have probems.
The validation will cause an ERROR, so the better way is first to get the UOM and check whether it is used as base on the item.

A change like this will not affect entries allready made.

Can’t thank you both enough; your combination of suggestions worked!

However, I’m still looking for a book or other resource I can use to learn how to answer these questions myself. Does such a think exisit? Thanks again!

The application designers guide for 5.0 and down (look in the Doc folder of your product disk). For NAV 2009 all of that stuff is incorporated into the help system, which is also all available online: http://msdn.microsoft.com/en-us/library/cc160853.aspx

As for books… the official C/SIDE Introduction and C/SIDE developer training manuals is where I would suggest that you start, and if at all possible get your boss to pay for the classroom training, they do that online now even. If you don’t work for a partner, or for a customer with customersource access, you might want to try David Studebaker’s book: http://dynamicsuser.net/groups/dynamics_book_reviews/media/p/138360.aspx