Saturday, January 22, 2011

Na payroll

Check out this SlideShare Presentation:

Dynamic Filling Translate/Prompt value

The following peoplecode can be used for dynamic filling of Translate/Prompt value. For Prompt value use prompt table name instead of PSXLATITEM record.

Thursday, January 13, 2011

Adding Month, Date, Year (AddToDate)

AddToDate() Can be used to add Number of Years or Months or Date to Date field.
Example:

Function visa_expiratn_dt

Evaluate VISA_PMT_DATA.DURATION_TYPE
When = "Y"
      VISA_PMT_DATA.EXPIRATN_DT = AddToDate(VISA_PMT_DATA.ENTRY_DT,   
      VISA_PMT_DATA.DURATION_TIME, 0, 0);
Break;
When = "M"
     VISA_PMT_DATA.EXPIRATN_DT = AddToDate(VISA_PMT_DATA.ENTRY_DT, 0,     
     VISA_PMT_DATA.DURATION_TIME, 0);
Break;
When = "D"
     VISA_PMT_DATA.EXPIRATN_DT = AddToDate(VISA_PMT_DATA.ENTRY_DT, 0, 0,   
     VISA_PMT_DATA.DURATION_TIME);
Break;
End-Evaluate
End-Function;

Wednesday, January 5, 2011

Retrive Effective Dated Row

GetCurrEffRow() Methode is used to get the current effective dated row.
Lets consider the following code.
 
/* GetCurrEffRow()*/
Local Rowset &ROWSET;

&nCurrentRowNo = CurrentRowNumber(1);
&Row = GetLevel0()(1).GetRowset(Scroll.MY_TBL)(&nCurrentRowNo);
If %Mode = "U" And
   Row.isnew = False Then
   &ROWSET = GetLevel0()(1).GetRowset(Scroll.MY_TBL)(&nCurrentRowNo).GetRowset(Scroll.MY_DOC_REC);
   &NUMBER = ROWSET.GetCurrEffRow().RowNumber;
   &ROWSET(&NUMBER).FILE_ATTACH_WRK.ATTACHADD.Visible = False;
End-If;
  

LongTranslateValue And ShortTranslateValue

The following code is used to get the Long Translate Value of the translate field.
 
/* LongTranslateValue */
Local Any &VALUE;
Local Field &MYFIELD;

&MYFIELD = GetField();
&VALUE = &MYFIELD.LongTranslateValue;
If ALL(&VALUE) Then
   /* do processing */
End-if;
 
Note: Similarly to get the Short Translate Value we can use ShortTranslateValue property.

Monday, January 3, 2011