Unable to create a virtual field in view.

Hello All,

I'm trying to add a virtual field in a view by setting the IsVirtual property to yes, but I have got the following error.

This is the property I have given to the virtual field.

so I have tried adding the computed field in the view and have added a method, but this method is not getting hit. And I have tried calling this method in the postLoad() method and while debugging I have found that the SysComputedColumn is not returning the value.

This is the property screen for the computed field.

This is the method I have written.

public static server str RNIQuantity()
        qty RNIQuantity, vendPackingSlipQty;
        RefRecId	vendPackingSlipTransRecId;
        vendPackingSlipTransRecId = str2Int64(SysComputedColumn::returnField(tableStr(MUEVendAccruedPOLedgerDateView), identifierStr(VendPackingSlipTrans), fieldStr(VendPackingSlipTrans, RecId)));
        vendPackingSlipQty = any2Real(SysComputedColumn::returnField(tableStr(MUEVendAccruedPOLedgerDateView), identifierStr(VendPackingSlipTrans), fieldStr(VendPackingSlipTrans, Qty)));
        if (vendPackingSlipTransRecId)
            MUEVendInvoiceInfoTableExpandedView vendInvoiceInfoTableExpandedView;

            select sum(ReceiveNow) from vendInvoiceInfoTableExpandedView
                where vendInvoiceInfoTableExpandedView.JournalRefRecId == vendPackingSlipTransRecId &&
                    vendInvoiceInfoTableExpandedView.JournalRefTableId == tableNum(VendPackingSlipTrans)
                && vendInvoiceInfoTableExpandedView.ParmJobStatus == ParmJobStatus::Executed
                && vendInvoiceInfoTableExpandedView.TransDate <= today();

            if (vendInvoiceInfoTableExpandedView.ReceiveNow < vendPackingSlipQty)
                RNIQuantity = (vendPackingSlipQty - vendInvoiceInfoTableExpandedView.ReceiveNow);
        return any2Str(RNIQuantity);

So my questions are,

Why it throws an error when adding the Virtual field?
Why the method I have created for the computed field is not getting hit?
Why the SysComputedColumn is not returning the value?
What am I missing here? Experts out there please provide me with suggestions


Parents Reply Children
No Data