Wednesday 29 March 2017

Show Documents Icon in Listpage

Show Documents Icon in Listpage

Show document icon in list page, if documents attached to the specific record

Scenario:  Display document icon if user attached any document to the specific record in Listpage.
Below are the steps to bring it in real..

1    1)      Create a below display method in table
display smmDocIconNum showDocHandIcon()
{
    #macrolib.resource

    if ((select firstonly docuRef where docuRef.RefCompanyId  == this.DataAreaId && docuRef.RefTableId ==                this.TableId && docuRef.RefRecId == this.RecId).RecId)
    {
        return #RES_NODE_DOC;
    }

    return #RES_AM_NEW;
}

2     2)      Create a window control in form listpage  and point the table method in control properties.
3     3)      Create window control mouseUp method and paste the below code

int mouseUp(int _x, int _y, int _button, boolean _ctrl, boolean _shift)
{
    int ret;

    ret = super(_x, _y, _button, _ctrl, _shift);

    smmUtility::openSmmDocHandling(salesQuotationTable, element);

    return ret;
}


(I took SalesQuotationtable as an example)

Happy coding!

No comments:

Post a Comment