1. Tom Mangano
  2. PowerBuilder
  3. Tuesday, 10 August 2021 21:36 PM UTC

PB 2019 build 2170

dw user object inherited from an ancestor dw user object

 

in the dw painter, edit tab, for column customer_id, i've checked required

in the ancestor user object

i call a function that loops through the column names to determine if they are required

for lp = 1 to col_count

    // we need the name to start
    ls_describe = '#' + string( ll_loopCounter ) + '.name'
    ls_columnName = This.Describe( ls_describe )
    
    // is it a required column?
    of_columns_required_check2( ls_columnName, ref ls_required )  as it's written in ancestor object


        // this is an example of syntax in PB Help
        // setting = dw1.Describe("emp_name.Edit.AutoHScroll")

        // is it a required column?
        // it has to be checked in the dw painter
    
        ls_describe = as_columnName + '.Edit.Required'
        as_required = This.Describe( ls_describe )
        
        // per the doc's expecting yes or no
        as_required = lower( as_required )
        // as_required = "?"  is what's returned.  per previous experience ? means error / doesn't exist
        
        // tried this for testing
        as_required = This.Object.customer_id.Edit.Required
        // as_required = "?"
        
        Return
...

screen shots with errors

 

 

Tom Mangano Accepted Answer Pending Moderation
  1. Monday, 23 August 2021 13:27 PM UTC
  2. PowerBuilder
  3. # 1

Renee's response solved my issue in 10 minutes.
Thank you for the help

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Wednesday, 11 August 2021 05:19 AM UTC
  2. PowerBuilder
  3. # 2

Hi Tom,

The required check depends on the edit style of the column.

In PFC the code to the if column is required is:

ls_describe = as_colname + '.Edit.Required ' + &
as_colname + '.EditMask.Required ' + &
as_colname + '.DDLB.Required ' + &
as_colname + '.DDDW.Required '
ls_rc = idw_requestor.Describe(ls_describe)
If Pos(Lower(ls_rc), 'yes') = 0 Then // not required

HTH,

René

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 11 August 2021 02:59 AM UTC
  2. PowerBuilder
  3. # 3

Hi Tom;

   This is an interesting question as it's a little more complex as just one Describe() command syntax as the required column is processed differently based on the Edit Style that the column is assigned to.

  For a complete look at a full required column implementation, have a look at the STD Framework. More precisely the "vs_dc_detail_master" object class. Then have a look at its "oe_postcontructor" user event where the "ib_required_colour" variable is referenced.  HTH

FYI: http://sourceforge.net/projects/stdfndclass/files/FrameWork/Integrated

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.