Edit Mask Not Working

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
nazirul_fitri
Posts: 21
Joined: Thu Sep 15, 2016 7:00 pm

Edit Mask Not Working

Post by nazirul_fitri » Fri Jun 09, 2017 12:48 pm

Hi All,

Recently, I have been trying to use select_sql free format to run a SQL query. It is working well and the data is display to the web but I have 2 problem.

1)The edit mask that I assign to the field is not working and the result will have leading zero.
2)It will add one more entry at the end of the list which is not in the result (see entry below W.P Kuala Lumpur).
1.PNG
1.PNG (89.02 KiB) Viewed 1184 times
this is the field definition :
2.PNG
2.PNG (112.19 KiB) Viewed 1184 times
this is the code I use in server module :

Code: Select all

Srvroutine Name(Getdata2)

List_Map For(*OUTPUT) List(#TestList)

Define Field(#SQLQUERY) Type(*CHAR) Length(2500)

#SQLQUERY := 'select dbo.UF_GET_STATE_DESC(account_master.branch_code), sum(resit_amount), sum((case when type = ''C'' AND upper(substring(bis_no,1,1)) <> ''M'' then resit_amount else 0 end)), sum((case when type = ''T'' and substring(bis_no,1,3) = ''MBB'' then resit_amount else 0 end)), sum((case when type = ''T'' and substring(bis_no,1,3) = ''RHB'' then resit_amount else 0 end)), sum((case when type = ''T'' and substring(bis_no,1,3) = ''P'' then resit_amount else 0 end)), sum((case when type = ''T'' and substring(bis_no,1,3) = ''BSN'' then resit_amount else 0 end)), sum((case when type = ''T'' and substring(bis_no,1,3) = ''BMM'' then resit_amount else 0 end)), sum((case when type = ''T'' and substring(isnull(bis_no, ''N/A''),1,3) not in(''BMM'',''BSN'',''POS'',''RHB'',''MBB'') then resit_amount else 0 end)) from  dbo.resit2, dbo.account_master where (dbo.resit2.account_no = dbo.account_master.account_no) and (dbo.resit2.trx_date >= ''2017-06-01'') and (dbo.resit2.trx_date <= ''2017-06-06'') and (dbo.resit2.cncl_status not in (''X'',''R'')) and (dbo.resit2.vld_status = ''Y'') GROUP BY dbo.UF_GET_STATE_DESC(account_master.branch_code) ORDER BY dbo.UF_GET_STATE_DESC(account_master.branch_code) ASC'

Select_Sql Fields(#PC_NEGERI #PC_TOTAL #PC_CEK #PC_MBB #PC_RHB #PC_POS #PC_BSN #PC_BMMB #PC_TUNAI) From_Files((ACCOUNT_MASTER)(RESIT2)) Using(#SQLQUERY)
Add_Entry To_List(#TestList)
Endselect
Endroutine
And this is the code in the webpage to display the list:

Code: Select all

Evtroutine Handling(#Com_owner.Initialize)
#com_owner.test
Endroutine

Mthroutine Name(test)
Define_Com Class(#DWHPaymentTestSRV.GetData2) Name(#Find)
#Find.ExecuteAsync( #List1 )

Evtroutine Handling(#Find.Completed)
Add_Entry To_List(#List1)
Endroutine
Endroutine

User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Edit Mask Not Working

Post by Stewart Marshall » Fri Jun 09, 2017 1:46 pm

1 - I've had a look at the edit mask issue and I can't reproduce it in SP1

2 - The extra entry in the list is there because you explicity add it to the list

#Find.ExecuteAsync( #List1 )

will put the list returned from the SrvRoutine directly in to the list on the screen. The addition Add_Entry inside the completed event then adds an additional entry

Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au

Tim McEntee
Posts: 10
Joined: Thu May 26, 2016 8:46 am

Re: Edit Mask Not Working

Post by Tim McEntee » Fri Jun 09, 2017 3:01 pm

Hi

First up can you do a test to fill the list with some dummy data from the client to satisfy yourself that the issue is with VL/Web and not with the SQL or server module.

Next I noticed that you have set the field to be of type 'S' signed rather than P 'Packed. I haven't seen a numeric field use type S since the early 90's. Can you test your list using a field of type 'P'.

Tim

Post Reply