tag:blogger.com,1999:blog-20103408.post7073269056549802214..comments2023-06-08T10:13:45.402-04:00Comments on PeopleSoft Support & Tips: Use Dynamic SQL for Prompts - SqlTextKetan Kotharihttp://www.blogger.com/profile/17459077644208180243noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-20103408.post-54977828483527153662008-02-12T08:38:00.000-05:002008-02-12T08:38:00.000-05:00At runtime using sqltext property of field object ...At runtime using sqltext property of field object or by specifying it in the view definition.Ketan Kotharihttps://www.blogger.com/profile/17459077644208180243noreply@blogger.comtag:blogger.com,1999:blog-20103408.post-33795392204930363952008-01-31T15:12:00.000-05:002008-01-31T15:12:00.000-05:00Hello,Hopefully this post will tweak someones memo...Hello,<BR/><BR/>Hopefully this post will tweak someones memory. <BR/><BR/>How does the SQL in the SQLText get into the dynamic view?<BR/><BR/>Thanks,<BR/>Mikemrpogshttps://www.blogger.com/profile/08442783196172714618noreply@blogger.comtag:blogger.com,1999:blog-20103408.post-78846562860285774822008-01-21T02:09:00.000-05:002008-01-21T02:09:00.000-05:00AddDropDownItemSyntaxAddDropDownItem(CodeString, D...AddDropDownItemSyntax<BR/><BR/>AddDropDownItem(CodeString, DescriptionString)<BR/><BR/>Description<BR/><BR/>The AddDropDownItem method adds an item to the dropdown list in the control for the field. The first time this method is called, it overrides the prompt table or translate table used to populate the list. Those items no longer appear in the list. Only the items added using this method display. <BR/><BR/>Subsequent calls to this method adds additional items to the dropdown list. The items added with the first call to the method also display. <BR/><BR/>If there is an existing value and the dropdown list is changed with these functions, the selection shows as (Invalid value) unless the new list contains an entry with the same code as the existing value. <BR/><BR/>Considerations Using AddDropDownItem<BR/><BR/>If the data for the dropdown is language sensitive, the values for the dropdown should come from the message catalog or from a database field that has a related language record, and should not be hard-coded. <BR/><BR/>A good place for your PeopleCode program to populate a dropdown list is in the RowInit event. This event executes before the page is shown for the first time, so it prevents unnecessary SQL. <BR/><BR/>Parameters<BR/><BR/>CodeString <BR/> Specify the value used to set the field value if this item is selected. Codes longer than the size of the field are truncated.<BR/> <BR/>DescriptionString <BR/> Specify the value the end-user sees in the dropdown list.<BR/> <BR/><BR/>Returns<BR/><BR/>None.<BR/><BR/>Example<BR/><BR/>Using a hardcoded list is not appropriate for this function because translations do not work. The data must come from the Translate Table (or other record) directly so that the data is translated correctly. <BR/><BR/>Local Rowset &Xlat;<BR/><BR/>&FLD = GetRecord(Record.JOB).GetField(Field.ACTION);<BR/>&FLD.ClearDropDownList();<BR/><BR/>Evaluate %Component<BR/>When Component.JOB_DATA_CONCUR<BR/> &Xlat = CreateRowset(Record.PSXLATITEM);<BR/> &Xlat.Fill("WHERE FILL.FIELDNAME = 'ACTION' AND Fill.FIELDVALUE in ('ADL','HIR') and EFFDT = (select max(EFFDT) from PSXLATITEM<BR/>B where B.FIELDNAME = 'ACTION' and B.FIELDVALUE in ('ADL','HIR') and EFFDT <= JOB.EFFDT)");<BR/> <BR/> &Xlat_cnt = &Xlat.ActiveRowCount;<BR/> For &I = 1 To &Xlat_cnt<BR/> &CodeIn = &Xlat.GetRow(&I).GetRecord(1).FIELDVALUE.Value;<BR/> &DescIn = &Xlat.GetRow(&I).GetRecord(1).XLATLONGNAME.Value;<BR/> <BR/> &FLD.AddDropDownItem(&CodeIn, &DescIn);<BR/> End-For;<BR/> <BR/> Break;<BR/>When-Other<BR/>End-Evaluate;<BR/><BR/>See Also <BR/><BR/>Field class: ClearDropDownList method.Unknownhttps://www.blogger.com/profile/02847099252601307334noreply@blogger.comtag:blogger.com,1999:blog-20103408.post-78817972841140915122007-07-09T09:51:00.000-04:002007-07-09T09:51:00.000-04:00No. You may try to use the %EDITTABLE as the prom...No. You may try to use the %EDITTABLE <BR/>as the prompt table and change the view name at run time.Ketan Kotharihttps://www.blogger.com/profile/17459077644208180243noreply@blogger.comtag:blogger.com,1999:blog-20103408.post-85980137021281635272007-07-05T12:30:00.000-04:002007-07-05T12:30:00.000-04:00Hi Ketan, Thanks for your response. I chec...Hi Ketan,<BR/> Thanks for your response. I checked PeopleBooks and the property 'SQLText' is not available for the 'Field' class. do you have any suggestions as to how I can achieve the same functionality without using the 'sqltext' property ? Any help would be greatly appreciated.<BR/><BR/>Thanks, BaharBaharhttps://www.blogger.com/profile/04058706721167140088noreply@blogger.comtag:blogger.com,1999:blog-20103408.post-33554427028548053402007-07-03T14:51:00.000-04:002007-07-03T14:51:00.000-04:00Check your peoplebooks. I have not used this in To...Check your peoplebooks. I have not used this in Tools 8.20Ketan Kotharihttps://www.blogger.com/profile/17459077644208180243noreply@blogger.comtag:blogger.com,1999:blog-20103408.post-63611424128808752702007-07-03T13:37:00.000-04:002007-07-03T13:37:00.000-04:00We are on tools version 8.20.07. When I try to use...We are on tools version 8.20.07. When I try to use this method, I get this error:<BR/><BR/> "SQLText is not a property of class Field"<BR/><BR/>Is there any way to make this work for tools 8.20 ?Baharhttps://www.blogger.com/profile/04058706721167140088noreply@blogger.com