Sunday, April 11, 2021

Get field value from Common buffer

public static SAZHoldCodeValidation Construct(Common _callerTable, CredManDocumentStatusCheck _documentStatus)
    {
        SAZHoldCodeValidation sazHoldCodeValidation = new SAZHoldCodeValidation();

        sazHoldCodeValidation.callerTable = _callerTable;
        sazHoldCodeValidation.documentStatus = _documentStatus;

        switch (_callerTable.TableId)
        {
            case tableNum(SalesTable):
                sazHoldCodeValidation.inventRefId    = _callerTable.(fieldNum(SalesTable, SalesId));
                break;

            case tableNum(PurchTable):
                sazHoldCodeValidation.inventRefId    = _callerTable.(fieldNum(PurchTable, PurchId));
                break;

            case tableNum(SalesQuotationTable):
                sazHoldCodeValidation.inventRefId    = _callerTable.(fieldNum(SalesQuotationTable, QuotationId));
                break;

            default:
                break;
        }
        
        return sazHoldCodeValidation;
    }

No comments:

Post a Comment

Table browser URL in D365FO

Critical Thinking icon icon by Icons8