Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 2 of 2 total |
whats wrong here ? |
Thu, Oct 9 2014 10:13 AM | Permanent Link |
kamran | Hi
I have some code as follows: showmessage('Just Before Append'); Datafrm.tbProduct.Append; showmessage('Just Before Assign'); Datafrm.tbProduct.FieldByName('PRODUCT_SELLING_CODE').AsString:=datafrm.tbTranDetail.FieldByName('TD_TRAN_PRODUCT_SELLING_CODE').AsString; Datafrm.tbProduct.FieldByName('PRODUCT_SELLING_BARCODE').AsString:=datafrm.tbTranDetail.FieldByName('TD_TRAN_PRODUCT_SELLING_BARCODE').AsString; Datafrm.tbProduct.FieldByName('PRODUCT_CATEGORY_ID').AsString:='UNKNOWN'; Datafrm.tbProduct.FieldByName('PRODUCT_CATEGORY_ONE').AsString:='UNKNOWN CATEGORY'; Datafrm.tbProduct.FieldByName('PRODUCT_DESCRIPTION_ONE').AsString:=datafrm.tbTranDetail.FieldByName('TD_TRAN_PRODUCT_DESCRIPTION_ONE').AsString; Datafrm.tbProduct.FieldByName('PRODUCT_UNIT_QTY').AsInteger:=datafrm.tbTranDetail.FieldByName('TD_TRAN_QTY').AsInteger; Datafrm.tbProduct.FieldByName('PRODUCT_WT_KG').AsCurrency:=datafrm.tbTranDetail.FieldByName('TD_TRAN_PRODUCT_WEIGHT_KG').AsCurrency; Datafrm.tbProduct.FieldByName('PRODUCT_UNIT_OF_SALE').AsString:=datafrm.tbTranDetail.FieldByName('TD_TRAN_PRODUCT_UNIT_OF_SALE').AsString; Datafrm.tbProduct.FieldByName('PRODUCT_SELLING_PRICE_EXC_VAT').AsCurrency:= datafrm.tbTranDetail.FieldByName('TD_TRAN_PRODUCT_SELLING_PRICE_EXC_VAT').AsCurrency; Datafrm.tbProduct.FieldByName('PRODUCT_SELLING_PRICE_INC_VAT').AsCurrency:=datafrm.tbTranDetail.FieldByName('TD_TRAN_PRODUCT_SELLING_PRICE_INC_VAT').AsCurrency; Datafrm.tbProduct.FieldByName('PRODUCT_VAT_PERCENT').AsCurrency:=datafrm.tbTranDetail.FieldByName('TD_TRAN_VAT_PERCENT').AsCurrency; showmessage('Just Before Post'); Datafrm.tbProduct.Post; showmessage('New Product Added Successfully'); For some reason it does not get to the 'Just Before Post' message. it goes past the 'Just before append' and 'Just before Assign' messages but then just does nothing after that. Its failing on the assignments ? I am assigning strings and also dbisam bcd 4 values as currency Is that not allowed or is that wrong ? Thanks Kamran |
Thu, Oct 9 2014 10:32 AM | Permanent Link |
Raul Team Elevate | On 10/9/2014 10:13 AM, kamran wrote:
> For some reason it does not get to the 'Just Before Post' message. it goes past the 'Just before append' and 'Just before Assign' messages but then just does nothing after that. Its failing on the assignments ? > I am assigning strings and also dbisam bcd 4 values as currency > Is that not allowed or is that wrong ? My guess is you're getting an exception thrown and since you are not handling any errors conditions function will just exit with and error. Try something like this and see if you get an exception thrown and see what the actual message is : try showmessage('Just Before Append'); <... rest of the code as before ... > showmessage('New Product Added Successfully'); except On E:Exception do begin showmessage('ERROR ' + E.Message); end; end; Raul |
This web page was last updated on Thursday, March 28, 2024 at 06:05 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |