iş akışına onay/harcama sınırı parametresi ekleme

WorkflowDocument classına aşağıdaki metodlar eklenmeli

public class yourClassName extends WorkflowDocument
{
}
> Class metodları
protected void checkContext(tableId    _tableId,
                            RecId      _recId)
{;
    if (_tableId != tablenum(DRTExpenseTable)) // Your table name
    {
        // Workflow context table id reference: %1 is not valid
        throw error(strfmt("@SYS107963", _tableId));
    }

    if (_recId == 0)
    {
        // Workflow context record id is zero.
        throw error(strfmt("@SYS107964"));
    }

}

public PurchReqSpendingLimitValueMST parmSpendingLimit(CompanyId _companyId,
                                           tableId   _tableId,
                                           RecId     _recId)
{
    YourTableName        yourTableName = YourTableName::findRecId(_recID);
    HRPLimitTypeTable           limitTypeTable;
    HRPLimitTableMap            limitTableMap;
    AmountMST                   limitValue;
    ;
    this.checkContext(_tableId, _recId);
    while select limitTypeTable
        where limitTypeTable.LimitType == HRPLimitType::Spending &&
              limitTypeTable.DocumentType == HRPLimitDocumentType::CustCredit
    {
        limitTableMap = HRPLimitTableRelationship::getActiveLimitEmpl(limitTypeTable.LimitId, EmplTable::userId2EmplId(yourTableName.createdBy));
        limitValue = max(limitValue,Currency::mstAmount(limitTableMap.LimitValue, limitTableMap.CurrencyCode));
    }
    return limitValue;
}

number sequence hatası

yeni bir modül yükledikten/oluşturduktan sonra aşağıdaki gibi bir hata alıyorsanız aşağıdaki kodu çalıştırıp AX’ı restart edelim. hatayı burda aldım Organization adm…>NumberSequences>Generate

“The NumberSequenceDatatype record for extended datatype ShippingCharge(sizin enum olacak) contains a reference to area 74 which does not exist. This may be the result of importing data inconsistent with the current build. Please reinitialize or reload the references.”

static void NumberSeqApplicationModule(Args _args)
{
    NumberSeqApplicationModule::loadAll();
    SysGlobalObjectCache::clearAllCaches();
    appl.numberSeqGlobal().buildModulesMap();
}

kayıt düzeyi ve müşteri limiti

satışçılarınıza kayıt düzeyi ile müşteri düzeyinde kesişen yetkiler/kısıtlar verdiyseniz ve müşteri kredi limitinde kaçaklar oluşuyorsa; aşağıdaki kod satırı bu sıkıntınızı çözecektir.

böylece kredi limiti hesaplanırken kayıt düzeyini devreden çıkarmış olursunuz. müşterinin gerçek limiti ortaya çıkmış olur.

query.recordLevelSecurity(false);

CustCreditLimit class initQuery

InventTrans’ta update mi yaptınız?

InventSum’ı yeniden hesaplatmayı unutmayın.

checkfix::fix | eğer hata varsa size bir info gösterir ve günceller.
checkfix::check | eğer hata varsa size bir info gösterir ama güncelleme yapmaz.

tek bir kaydı güncellemek için;

void InventSumRecalcItem(Args _args)
{
   InventSumRecalcItem InventSumRecalcItem;
   ;
   InventSumRecalcItem = new InventSumRecalcItem("ITEM001", true, checkfix::fix);
   InventSumRecalcItem.updatenow();
}

tüm kayıtları güncellemek için;

void InventSumRecalcAllItems(Args _args)
   InventTable InventTable;
   InventSumRecalcItem InventSumRecalcItem;
   ;

   while select InventTable
     where (InventTable.ItemType == ItemType::Item) || (InventTable.ItemType == ItemType::BOM)
   {
     InventSumRecalcItem = new InventSumRecalcItem(InventTable.ItemId, true, checkfix::fix);
     InventSumRecalcItem.updatenow();
   }
}

Kaynak: http://mvpdynamicsax.blogspot.com/2013/01/recalculate-inventsum.html