hghrp
12/27/2005 2:38:00 PM
Hi Eric,
use:
record.set_field("ItemType", ItemType::Item);
else you would send a string
Hth,
harald
"EricR" wrote:
> I'm trying to create an InventTable record and need to know how to
> reference the ItemType base enum to fill in the type field.
>
> Anyone know how to do this?
>
> The basic flow of the code is:
> string axTableName = "InventTable";
>
>
> // some prep code
>
>
> IAxaptaRecord record =
> (IAxaptaRecord)_Axapta.CreateRecord(axTableName);
>
>
> record.InitValue();
> record.set_field("ItemGroupId", newPart.ItemGroup);
> record.set_field("Dimension[2]", newPart.ItemGroup);
> record.set_field("DimGroupId", newPart.DimGroup);
> record.set_field("modelGroupId", newPart.InventModelGroup);
>
> record.set_field("itemName", newPart.Description);
> record.set_field("itemId", newPart.PartNumber);
> record.set_field("NameAlias", newPart.PartNumber);
> record.set_field("CostGroupId", newPart.CostGroup);
> record.set_field("PrimaryVendorId", newPart.Vendor);
>
> // The set_fields below are the problem, I was just guessing
> // here but this does not work.
> if( newPart.ItemType == "Item" )
> record.set_field("ItemType", "ItemType::Item");
> else
> record.set_field("ItemType", "ItemType::BOM");
>
>
> I was looking for a way to create the ItemType base enum but have not
> found a way to do it yet.
>
>
> Thanks all..
>