摘要: AddToDateis aPeopleCode built-in functionfor manipulating a date in PeopleCode.You can use it toadjustdates forwards and backwards, by a given number of years, months or days.The basic syntax is:Local date &dtExample;&dtExample = %Date;/* Get date forward 1 year, 0 months, 0 days */&dtEx 阅读全文
posted @ 2013-10-24 13:49 Bryan chen 阅读(291) 评论(0) 推荐(0) 编辑
摘要: If you are working with files or file attachments in PeopleCode, you will typically want to create a unique file name for each user to prevent them from overwriting each others files if files are being stored in the same folder.Here's a simple piece of PeopleCode that generates a file name prefi 阅读全文
posted @ 2013-10-24 13:48 Bryan chen 阅读(240) 评论(0) 推荐(0) 编辑
摘要: If you ever want to conditionally count the number of times a particular condition occurs in SQL, you can do it in Oracle using thecaseandcountfunctions. Here's a simple example which counts the number of males/females stored inPS_PERSONAL_DATA.selectcount(casewhenSEX='M'then1end)asMALES 阅读全文
posted @ 2013-10-24 13:47 Bryan chen 阅读(154) 评论(0) 推荐(0) 编辑
摘要: When trying to sort based on values that do not fit the standard ascending and descending sort logic provide by your database engine you can use the following decode() function to sort based on custom value ordering.By ordering your value list in a decode function you can sort based on the integer v 阅读全文
posted @ 2013-10-24 13:46 Bryan chen 阅读(123) 评论(0) 推荐(0) 编辑
摘要: The following SQL identifies custom queries created in your system from thePSQRYDEFNPeopleTools table. It includes the query type (and the operator ID who owns the query if it is private).selectQRYNAMEas"Query Name",DESCRas"Query Description",CREATEOPRIDas"Created By",C 阅读全文
posted @ 2013-10-24 13:45 Bryan chen 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 1. Set component changed page field property:For understanding this open a page in application designer and in the field property of one of the edit field uncheck the propertySet component Changedand save the page. Now go on the online page, make some changes in field value and save the page.What do 阅读全文
posted @ 2013-10-24 13:41 Bryan chen 阅读(455) 评论(0) 推荐(0) 编辑
摘要: Setting a Date to Null in PeopleCodeTo set a date to null in PeopleCode either use the SetDefault() function (deprecated) or the SetDefault field methodUsing the function:SetDefault(YOUR_RECORD.DT_FIELD);Using the field method If you are in the current context:YOUR_RECORD.DT_FIELD.SetDefault();Using 阅读全文
posted @ 2013-10-24 13:40 Bryan chen 阅读(394) 评论(0) 推荐(0) 编辑
摘要: SELECT DISTINCT REVERSE(LTRIM(SYS_CONNECT_BY_PATH(REVERSE(PORTAL_LABEL), ' >- '), ' >- ')) "NAVIGATION" FROM PSPRSMDEFN PWHERE PORTAL_OBJNAME = 'PORTAL_ROOT_OBJECT'START WITH PORTAL_URI_SEG2 = 'C_PUNCH_EXPET'/*要找的component的名称*/CONNECT BY PRIOR PORTAL_P 阅读全文
posted @ 2013-10-24 13:38 Bryan chen 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 1. Get the description of the translate value:No need to write SQLEXEC on PSXLATITEM passing fieldname and Field value. Just use LongTranslateValue property to get the long description of the field as:Local Any &VALUE;Local Field &MYFIELD;&MYFIELD = GetField();&VALUE = &MYFIELD.L 阅读全文
posted @ 2013-10-24 13:38 Bryan chen 阅读(1041) 评论(0) 推荐(0) 编辑
摘要: 在rowinit里面:/*增加打卡规则字段 陈楚豪 2013/5/7 新建*/Local Field &KL_PUNCH_RULE;&KL_PUNCH_RULE = GetRow().GetRecord(Record.SCH_SHIFT_DTL).GetField(Field.KL_PUNCH_RULE);&KL_PUNCH_RULE.ClearDropDownList();&KL_PUNCH_RULE.AddDropDownItem("01", Char(8233) | "正常上班打卡");&KL_PUNCH_R 阅读全文
posted @ 2013-10-24 13:37 Bryan chen 阅读(295) 评论(0) 推荐(0) 编辑