Quantcast
Channel: Martin Dráb's Activities
Viewing all articles
Browse latest Browse all 17532

How to throw error on click of button even if single SalesQuotationLine has value for Config Id

$
0
0

Hi,

I am working on a task where I need to throw an error even if a single SalesQuotationLine has a value for Config Id field.

So, for this I have write code on Onclicked event of confirm Button & the config Id field is coming from InventDim Datasource of SalesQuotationTable Form.

I need to stop the confirmation status of this Quotation & throw error if line has config Id filled with value, but this code is not working as expected.

[FormControlEventHandler(formControlStr(SalesQuotationTable, ButtonUpdateConfirmation), FormControlEventType::Clicked)]
    public static void ButtonUpdateConfirmation_OnClicked(FormControl sender, FormControlEventArgs e)
    {
        InventDim inventDim = sender.formRun().dataSource(4).cursor();
        SalesQuotationLine salesQuotationLine = sender.formRun().dataSource(2).cursor();

        while select salesQuotationLine join inventDim where inventDim.inventDimId == salesQuotationLine.InventDimId
        {
            if(inventDim.configId)
            {
                throw Error(" Is not a product master");
            }

 

        }



    }

Thanks,

Rahul


Viewing all articles
Browse latest Browse all 17532

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>