How to use the cache intialize the value & clear the catche


/// <summary>

/// Get the values in cache to get & set

/// </summary>

/// <param name = "clearCache">true</param>

/// <param name = "_isValidated">false</param>

/// <returns>boolean</returns>

public static boolean cachedParmIsSavedSetUp_POR(boolean clearCache = true,boolean _isValidated = false)

{

    str key =  funcName() + bfpCacheType(Types::Enum);

 

    if(prmisDefault(_isValidated))

    {

        _isValidated = bfpCacheGet(key,_isValidated);

    }

    else if(!clearCache)

    {

        bfpCacheSet(key,_isValidated);

    }

 

    if(clearCache)

    {

        bfpCacheClear(key);

    }

 

    return _isValidated;

}

======================================================================


SFCProductionProgressTransService_POR::cachedParmIsSavedSetUp_POR(false,true);

this.createProdRAFJournal(_progresstrans, inventDim);

SFCProductionProgressTransService_POR::cachedParmIsSavedSetUp_POR(true);


===================================================================


if (ret > 0 && bom.TableId == tableNum(ProdBOM) &&  !SFCProductionProgressTransService_POR::cachedParmIsSavedSetUp_POR(false))

{

    ProdBOM     prodBOM = bom;


    ret += prodBOM.QtyBOMCalcDiff_POR;

}

else if(ret > 0 && bom.TableId == tableNum(ProdBOM) && SFCProductionProgressTransService_POR::cachedParmIsSavedSetUp_POR(false))

{

    ProdBOM     prodBOM = bom;


    Qty  trasactionQty = this.checkFinalqty_POR(ret, bom);


    if(ret > trasactionQty)

    {

        ret = trasactionQty;

    }

     

}


====================================================================




Comments

Popular posts from this blog

Customization on Sales invoice Report in D365 F&O

75) COC - Create a coc of the table modified method

46) D365 FO: SHAREPOINT FILE UPLOAD USING X++