To get the resource type and the resource ID for a production order in Axapta x++ you can get help from below code sample.
ProdRoute prodRoute;
RecId recId;
WrkCtrId wrkCtrGrpId;
ProdId prodId = "W000170";
WrkCtrActivityRequirementType WrkCtrActivityRequirementType;
WrkCtrActivityRequirement wrkCtrActivityRequirement;
while select prodRoute
where prodRoute.ProdId == prodId
{
recId = prodRoute.activityRequirementSet().RecId;
select WrkCtrActivityRequirement
where WrkCtrActivityRequirement.ActivityRequirementSet == recid;
wrkCtrGrpId = WrkCtrActivityRequirement.requirementEdit();
WrkCtrActivityRequirementType = WrkCtrActivityRequirement.WrkCtrActivityRequirementType;
info(strFmt("%1, %2",WrkCtrActivityRequirementType,wrkCtrGrpId));
}
Comments