datablock item is not getting updated? [message #428572] |
Wed, 28 October 2009 23:17 |
mm_kanish05
Messages: 493 Registered: January 2007 Location: Chennai
|
Senior Member |
|
|
Hi,
I have a datablock(BillMain) and it have lot of items. One of item is Paid_Amount.
I am using the following coding on when-button-pressed of save button.
If :BillMain.DB_Amount > 0 Then
If :BillMain.DNRemarks is Null Then
Message('DN Amount > 0. DN Remarks is Null !!');
Raise form_trigger_failure;
End if;
End if;
If :BillMain.CR_Amount > 0 Then
If :BillMain.CNRemarks is Null Then
Message('CN Amount > 0. CN Remarks is Null !!');
Raise form_trigger_failure;
End if;
End if;
If :ClosedYear = 'Y' Then
Message('Saving records for Closed Financial Years not permitted !!');
Raise form_trigger_failure;
End if;
PickAPNo;
If :Ap_DocumentDate < :PoDate Then
Message('Bill Passing Date < Job Order Date !!');
Raise form_trigger_failure;
End if;
If :BillMain.Advdocno is Null Then
AdvanceChk;
End if;
UpdateLedger;
If Nvl(:BillMain.TDS_Amount,0) > 0 Then
UpdtTDSData;
End if;
Update LastDocs Set Serial_Number = To_Number(Substr(:BillMain.AP_DocumentNo,5,4)),
Doc_Date = :BillMain.AP_DocumentDate
Where Periodid = :Global.Periodid
and Doc_Type = :Prefix || :APDType
and Unitid = :Global.Unitid;
If :BillMain.Db_Amount > 0 Then
MakeDbNote;
End if;
If :BillMain.Cr_Amount > 1 Then
MakeCrNote;
End if;
if :BillMain.Advdocno is null then
null;
else
adv_selection;
end if;
If :Billmain.Advamt is Not null Then
If Nvl(:BillMain.Advamt,0) > Nvl(:BillMain.Ap_amount,0) Then
:Billmain.Paid_Amount := Nvl(:Billmain.Paid_amount,0)+(Nvl(:BillMain.Ap_amount,0) - Nvl(:BillMain.TDS_Amount,0));
Message('tds Amount'||:Billmain.TDS_Amount);
Message('AP Amount'||:Billmain.AP_Amount);
Message('Paid Amount'||:Billmain.Paid_Amount);
Else
:BillMain.Paid_Amount := Nvl(:Billmain.Paid_Amount,0)+Nvl(:BillMain.Advamt,0);
Message('Paid Amount'||:Billmain.Paid_Amount);
End If;
End If;
do_key('commit_form');
Go_Item('apmenu.Clear');
Specifically the following is not getting changes
If :Billmain.Advamt is Not null Then
If Nvl(:BillMain.Advamt,0) > Nvl(:BillMain.Ap_amount,0) Then
:Billmain.Paid_Amount := Nvl(:Billmain.Paid_amount,0)+(Nvl(:BillMain.Ap_amount,0) - Nvl(:BillMain.TDS_Amount,0));
Message('tds Amount'||:Billmain.TDS_Amount);
Message('AP Amount'||:Billmain.AP_Amount);
Message('Paid Amount'||:Billmain.Paid_Amount);
Else
:BillMain.Paid_Amount := Nvl(:Billmain.Paid_Amount,0)+Nvl(:BillMain.Advamt,0);
Message('Paid Amount'||:Billmain.Paid_Amount);
End If;
End If;
Billmain.Advamt = 5300
Billmain.Ap_amount = 1220
BillMain.Tds_Amount = 24
BillMain.Paid_Amount = 24 (Previous changes) but the above changes is not getting effect . Please help what it may be the problem.
kanish
|
|
|
|
|
|
|
|
|
Re: datablock item is not getting updated? [message #428659 is a reply to message #428572] |
Thu, 29 October 2009 05:35 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If you're using the mouse to navigate then KEY-NEXT-ITEM doesn't get fired AT ALL.
It fires when you press tab to move to the next item. Mouse navigation bypasses it completely. As does using up and down and shift/tab.
You should never use KEY-NEXT-ITEM for anything other than navigation code. You certainly shouldn't be using it to assign values to items.
|
|
|