Route Import issue - WrkCtrIdCost -Blank

Hi,

While importing route some how WrkCtrIdCost become Blank,

Any Job to execute to Update the WrkCtrIdCost Records where it’s Blank.

Kindly advise pls.

What is your AX version?

Do you a need code example for this?

Hi, Thanks for your reply .

Ax2012. Yes pls .

Moving to developer forum.

Have a look at \Data Dictionary\Tables\RouteOpr\Methods\getResource and see how system considers the resource in case there is no costing resource specified on the route operation.

Kranthi,

Please refer below

public WrkCtrTable getResource(boolean _findFirstApplicable = false,
TransDate _searchFromDate = dateNull(),
TransDate _searchToDate = maxDate(),
InventSiteId _inventSiteId = ‘’,
boolean _findCostingResource = false)
{

WrkCtrTable wrkCtrTable;

// Get the costing resource if none is found
if (_findCostingResource && this.WrkCtrIdCost)
{
wrkCtrTable = WrkCtrTable::find(this.WrkCtrIdCost);
}

// get directly assigned resource
if(!wrkCtrTable.RecId)
{
wrkCtrTable = this.activityRequirementSet().resourceRequirement();
}

// Get the first applicable resource if none is found
if(!wrkCtrTable.RecId && _findFirstApplicable)
{
wrkCtrTable = this.activityRequirementSet().firstApplicableResource( _searchFromDate,
_searchToDate,
_inventSiteId);
}

return wrkCtrTable;
}

// get directly assigned resource
if(!wrkCtrTable.RecId)
{
wrkCtrTable = this.activityRequirementSet().resourceRequirement();
}

// Get the first applicable resource if none is found
if(!wrkCtrTable.RecId && _findFirstApplicable)
{
wrkCtrTable = this.activityRequirementSet().firstApplicableResource( _searchFromDate,
_searchToDate,
_inventSiteId);
}

What i meant was to use similar logic to update the WrkCtrIdCost.