Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-07-09
3
Medium Priority
?
253 Views
Last Modified: 2013-12-26
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

0
Comment
Question by:Mehram
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Accepted Solution

by:
shru_0409 earned 1000 total points
ID: 24813627
go to edit tab and select required field on.
0
 

Author Comment

by:Mehram
ID: 24820317
<<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
 
LVL 14

Assisted Solution

by:sandeep_patel
sandeep_patel earned 1000 total points
ID: 24824173
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deletiā€¦
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question