在apex类获取页面参数值

来源:互联网 发布:阿兴网络项目 编辑:程序博客网 时间:2024/06/04 20:44

一、URL传值以及页面中用普通html标签的,都可通过system.currentPageReference().getParameters()获取

如:

URL:https://c.cs5.visual.force.com/apex/TM_MainMenu?bkId=01rO00000000QqA

String bkId =system.currentPageReference().getParameters().get('id');

html标签

<input type="text" name="statusName"/>

String statusName =system.currentPageReference().getParameters().get('statusName');


注意一点,通过页面传值是区分大小写的

如:我在新规一条记录时,把它的name值设置成‘物件情报’

https://cs5.salesforce.com/a0G/e?retURL=%2Fa0G&RecordType=012O00000000KIL&ent=01IO00000000I0B&name=物件情报

这样是无法设置上的

https://cs5.salesforce.com/a0G/e?retURL=%2Fa0G&RecordType=012O00000000KIL&ent=01IO00000000I0B&Name=物件情报

这样name值就设置上了。


原创粉丝点击