AxShowField插件安装方法 SysSetupFormRun中Task方法
public int task(int _p1)
{
#task
FormDataSource formDataSource;
//zcb insert begin
//Use origin class
object object;
//zcb insert end
//AXAPTA-LINKS
FormControl formControl;
FormBuildStringControl fbsc;
AL_FieldInfo fieldInfo;
str fieldName;
//end AXAPTA-LINKS
int ret;
if (_p1 == #taskFilter)
{
formDataSource = this.objectSet();
if (formDataSource &&
formDataSource.queryRun() &&
formDataSource.queryRun().args() &&
!formDataSource.queryRun().args().caller())
{
formDataSource.queryRun().args().caller(this);
}
}
//AXAPTA-LINKS
if (_p1 == #taskShiftEnter) //F10 or ALT
{
formDataSource = this.objectSet();
formControl = this.selectedControl();
if (formDataSource)
{
fbsc = formDataSource.formRun().form().design().control(formControl.id());
fieldName = fieldId2Name(formDataSource.table(), fieldExt2Id((fbsc.dataField())));
fieldInfo = new AL_FieldInfo(formDataSource.formRun().name(), formControl.name(), formDataSource.name(), tableId2Name(formDataSource.table()), fieldName, fbsc.dataMethod());
fieldInfo.run();
return true;
}
else
info("Form has no datasource");
}
//end AXAPTA-LINKS
ret = super(_p1);
//Modified by zhangchaobin on 20080628 Begin
//Refresh data source after deletting one record or more
//You should add a method named 'excuteQuery' on the method node of running form
//The deletting taskId is 2832
object = this;
if(_p1 == 2832 && formHasMethod(this,"excuteQuery"))
{
object.excuteQuery();
}
//Zhangchaobin modify End
return ret;
}