Interview Questions

Wednesday, May 20, 2015

In document management check all file types and for each sales order all documents have to be attached and its mandatory.

Hi,
 Kindly Go to Docuref Table, in the method called filestatus,
Paste this code and check:
Public boolean filestatus(salesTable    _salesTable)
{
    boolean         fileattached = false;
    boolean         repeat;
    Docuref         DocurefTableloc;
    DocuTypeId      type1,type2,type3;
    str             _null;
    Container       con;
    ;
    _null   = "";
    con     = conins(con,1,_null);
    con     = conins(con,2,_null);
    con     = conins(con,3,_null);
    // Collecting and storing the Document Types in the Container
    while select DocurefTableloc where DocurefTableloc.RefCompanyId == _salesTable.dataAreaId
                                    && DocurefTableloc.RefRecId     == _salesTable.RecId
    {
        if(conpeek(con,1)== "")
        {
            con = conins(con,1,DocurefTableloc.TypeId);
        }
        else if(conpeek(con,2)== "")
        {
            con = conins(con,2,DocurefTableloc.TypeId);
        }
        else if(conpeek(con,3)== "")
        {
            con = conins(con,3,DocurefTableloc.TypeId);
        }
     }
     type1 = conpeek(con,1);
     type2 = conpeek(con,2);
    // Comparing the Values to check whether both Document types are of same type
    
        if(type1 == type2)
        {
            return  fileattached;
        }
     type3 = conpeek(con,3);
        if((type2 == type3)||(type1 == type3))
        {
            return  fileattached;
        }
    // Mandatory Document types to be attached
    
    if((type1 || type2 || type3 == "File")&&
       (type1 || type2 || type3 == "Image")&&
       (type1 || type2 || type3 == "Inbox"))
    {
        fileattached = true;
        return  fileattached;
    }
    return  fileattached;
}

No comments:

Post a Comment