0
votes

currently i have a column profile.acct_no on datawindow, where user select a customer account from the popup listing. Now the problem is, user can't clear the previous already selected account, it always shows the selected account, unless you select another account. User can clear column box and click saved, but when they go back to view it, the account shows again.

Now from the database, all the selected account id are register into a table call interco.acct_id, what i need to do is, code the event itemchanged where if the column profile.acct_no are null, then it will clear the account id from table interco.acct_id to 0.

What i already do is code the non-visual object business rule for the datawindow, at event ue_itemchanged_acct_no return none:

string s_value

s_value = invo_tm.uf_getcolumnstring( istr_vldmsg.l_row, istr_vldmsg.s_column )

if isnull( s_value ) or trim( s_value ) = '' then invo_tm.uf_setcolumn( istr_vldmsg.l_row, is_dirulealias + '.acct_id ', 0 )

end if

Problem is, the account still shows and the id won't change to 0. Can anyone please help and advice? Much appreciated. Thanks.

1
It would help you can attach a sample application or code. Without seeing what is actually written in the function uf_setcolumn and data window properties and event it would be harder to answer.Ankur Patel
Hi, i don't know how to attach the sample application or code. Could you help? Thanks.knifeparty
Upload your code on Google drive or similar online storage and post a link here.Ankur Patel
I am not sure why 'user can't clear the previous already selected account'. If it is because you get the message 'Item '' does not pass validation test', then you can change that by clicking 'Empty string is NULL' in the 'Edit' properties of the column. Also make sure you have a call to 'AcceptText' before saving. Otherwise, it is possible that the modifications are not accepted before proceeding to the save operation.Marc Vanhoomissen
I've tried check 'Empty string is NULL' in the properties of the dw, but the modification still won't accept.knifeparty

1 Answers

0
votes

I would check a few things.

  • Check the update properties for your datawindow. interco.acct_id should be updateable.

  • If interco and profile are both in the same datawindow, you will need to do some fancy footwork to update both tables. Check out this great article by Rick Schultz about PFC DataWindow Multi-Table Update Service here https://pbbraindump.wordpress.com/2008/07/02/pfc-datawindow-multi-table-update-service/

  • Also, if interco.acct_id or profile.acct_no are unique in the database then you will be unable to successfully change several records to 0.