April 20, 2013

Sunday Fun Day............ Cheers ...........

Hi Friends;
Finally its Sunday tomorrow,  Awhhhhh rest is best this day.
Check these funny Lines for you and your buddies check it out........

Types of Project Managers; which one are you? -- 
    If you get in my way, I'll kill you! - ideal project manager
 
 
If you get in my way, you'll kill me! - somewhat less than ideal project manager 
    If I get in my way, I'll kill you! - somewhat misguided project manager 


    
If I get in your way, I'll kill you! - A tough project manager (eats glass, live cats, etc.) 
    If get kill in will way I you. - dyslexic, functionally illiterate project manager 

    
I am the way! Kill me if you can! - messianic project manager 
    Get away, I'll kill us all! - suicidal project manager 

    
If you kill me, I'll get in your way. - thoughtful but ineffective project manager 
    If I kill you I'll get in your way. - project manager who has trouble dealing with the obvious 
    
If a you gotta in my way, I gonna breaks you arm. - project manager from New York 

    

I am quite confident that there is nothing in the way, so no one will get killed. - project manager who is about to get in big trouble 

    

If you kill me, so what? If you get in my way, who cares? - weak, uninspired, lackluster project manager 

    
If I kill me, you'll get your way. - pragmatic project manager 
    If we get in each other's way, who will get killed? - An utterly confused manager
    Kill me, it's the only way. - every project manager to date.

-Harry.................... :)

X++ code for document attachment

X++ code for document attachment





In Axapta, we can attach document with Purchase order via document handling, if you need to attached a document using your x++ code, we need to use following x++ AOT objects.
  • DocuRef (table)
  • DocuActionArchive (class)
Here is a generic method that will attach record to any table in AX based on parameters passed to it

void attachDoc(RefTableId _refTableId, RefRecId _refRecId, selectableDataArea _refCompanyId, FileName _name)
{
    DocuRef docuRef;

    DocuActionArchive archive;
    ;
    docuRef.clear();
    docuRef.RefRecId = _refRecId;
    docuRef.RefTableId = _refTableId;
    docuRef.RefCompanyId = _refCompanyId;
    docuRef.Name = _name;
    docuRef.TypeId = 'File';
    docuRef.insert();
    archive = new DocuActionArchive();
    archive.add(docuRef, _name);
}

To use this method write following code to attache the document.

this.attachDoc(tableNum(PurchTable), purchTable.RecId, purchTable.dataAreaId, filepathname);

-Harry