Thursday, September 6, 2018

AX - How read specified note from production order (DocuRefSearch)

static void cieb_GetProdNote(Args _args)
{
    Notes notes = "";
    DocuRef docuRefTmp;
    ProdTable prodTable;
    DocuRefSearch docuRefSearchTmp;
    
    /* - find production order */
    
    prodTable = prodTable::find( "18-037399" );
    if ( ! prodTable ) return;
    
    /* - read its notes */
        
    docuRefSearchTmp = DocuRefSearch::newCommon( prodTable );
    docuRefSearchTmp.parmDocuTypeId( "Pozn√°mka" );
    
    if ( docuRefSearchTmp.next() )
    {
        docuRefTmp = docuRefSearchTmp.docuRef();
        
        notes += docuRefTmp.Notes;
    }

    /* - show result */
    
    info( notes );
}
Output:

No comments:

Post a Comment