To refina a function or give a new one if any of the expert has.

PB7

I have a function which is meant to do the following.

It checks thoses columns of datawindow whoose required property is checked.

If data is note entered in that column then it throws message like this

'Value required for column +[column in question]'

It is working for one column.

For example, if the datawindow has more than one required columns and it would
throw message for the first column. ok.

But when I click the save button again , it does not do anything.

Calling method:
IF f_checkrequired (dw_master) = 0 THEN RETURN  



$PBExportHeader$f_checkrequired.srf
$PBExportComments$Checks that all required columns in a DataWindow control are filled in
global type f_checkrequired from function_object
end type
 
forward prototypes
global function integer f_checkrequired (datawindow adw_control)
end prototypes
 
global function integer f_checkrequired (datawindow adw_control);integer li_colnbr = 1
long ll_row = 1
string ls_colname, ls_textname 
 
IF adw_control.AcceptText() = -1 THEN
	adw_control.SetFocus()
	RETURN 0
END IF
 
IF adw_control.FindRequired( primary!, ll_row, li_colnbr, ls_colname, true ) < 1 THEN
	RETURN 0
END IF
 
IF ll_row <> 0 THEN
	// Get the text of that column's label.
	ls_textname = ls_colname + "_t.Text"
	ls_colname = adw_control.Describe(ls_textname)
	// Tell the user which column to fill in.
	MessageBox("Required Value Missing","Please enter a value for '" + ls_colname , exclamation!)
	// Make the problem column current.
	adw_control.SetColumn(li_colnbr)
	adw_control.ScrollToRow(ll_row)
	adw_control.SetFocus()
	RETURN 0
END IF
RETURN 1
end function

Open in new window

MehramAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

shru_0409Commented:
go to edit tab and select required field on.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MehramAuthor Commented:
<<go to edit tab and select required field on.>>

I have already done that.

We probably have suppresed error message throwing by field required, I dont know how and where.


0
sandeep_patelCommented:
did you check the 'empty string is null' check box for all columns? Because find required will report only if column value is NULL.

Actually you can debug your code and see from where it is retruning without message.

Regards,
Sandeep
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.