How to bypass empty records based on a field

Hi All,

hdsDailyReceiptsTmp.ReceiptDate = queryEWMLP.TransDate;

hdsDailyReceiptsTmp.WMSPalletId = queryWMSPallet.wMSPalletId;

hdsDailyReceiptsTmp.ReceiptsListId = queryEWMLP.HDSReceiptListId;

hdsDailyReceiptsTmp.PurchId = queryEWMLP.PurchId;

hdsDailyReceiptsTmp.insert();

I am inserting records into a table like above. If the above two fields are empty**(Highlighted in Bold)**. I want to bypass those records before inserting into the table.

Regards,

RK.

Hi

Please add Condition before inserting

the following code just example so add condition as per you requirements

if (queryEWMLP.value() != “”)

{

}

I hope that it’ll work

Regards

Don’t forget to verified solution if solve issue

if(queryEWMLP.HDSReceiptListId || queryEWMLP.PurchId)

{

hdsDailyReceiptsTmp.ReceiptDate = queryEWMLP.TransDate;

hdsDailyReceiptsTmp.WMSPalletId = queryWMSPallet.wMSPalletId;

hdsDailyReceiptsTmp.ReceiptsListId = queryEWMLP.HDSReceiptListId;

hdsDailyReceiptsTmp.PurchId = queryEWMLP.PurchId;

hdsDailyReceiptsTmp.insert();

}

if(queryEWMLP.HDSReceiptListId && queryEWMLP.PurchId)

{

hdsDailyReceiptsTmp.ReceiptDate = queryEWMLP.TransDate;

hdsDailyReceiptsTmp.WMSPalletId = queryWMSPallet.wMSPalletId;

hdsDailyReceiptsTmp.ReceiptsListId = queryEWMLP.HDSReceiptListId;

hdsDailyReceiptsTmp.PurchId = queryEWMLP.PurchId;

hdsDailyReceiptsTmp.insert();

}