When you have Enterprise Portal configured within your SharePoint environment, it is possible to open your ERP data from Microsoft Dynamics AX towards every user having access to the SharePoint environment. This can be achieved by making use of Web Forms. Web Forms have no filtering possibilities compared to the regular forms in the Microsoft Dynamics AX client. End-users are only able to sort records displayed in a Web Form.
To enable advanced filtering possibilities on Web Forms, you should do a little coding in your Web Form in the Microsoft Dynamics AX environment and you should create a Web Page to display your Web Form in your SharePoint environment.
The steps to follow in your Microsoft Dynamics AX environment:public class FormWebRun extends ObjectRun
{QueryBuildRange NameQBR;
}
QueryBuildRange CustGroupQBR;
Name name;
CustGroup custGroup;
#define.Name('WebForm_Name')
#define.CustGroup('WebForm_CustGroup')public void init()
{super();
}
NameQBR = this.query().dataSourceNo(1).addRange(fieldNum(CustTable,Name));
CustGroupQBR = this.query().dataSourceNo(1).addRange(fieldNum(CustTable,CustGroup));public void executeQuery()
{;
}
if(name)
{NameQBR.value(name);
}
else
{NameQBR.value(FilterName.text());
}
name = FilterName.text();
if(custGroup)
{custGroupQBR.value(custGroup);
}
else
{CustGroupQBR.value(FilterCustGroup.text());
}
custGroup = FilterCustGroup.text();
super();void clicked()
{name = FilterName.text();
}
custGroup = FilterCustGroup.text();
CustTable_ds.executeQuery();
super();public void saveViewState()
{super();
}
if(Name)
{
}
this.viewStateItem(#Name,name);
if(CustGroup)
{this.viewStateItem(#CustGroup,custGroup);
}public void loadViewState()
{super();
}
if(this.viewStateContains(#Name))
{Name = this.viewStateItem(#Name);
}
if(this.viewStateContains(#CustGroup))
{custGroup = this.viewStateItem(#custGroup);
}
So far what is needed in your Microsoft Dynamics AX environment. Your created objects should look like this:
In our SharePoint environment, we need to display the data to our SharePoint end-users. To achieve this, follow these steps:
Your SharePoint end-users are now able to use advanced filtering (wildcard filters, ...) on the Name and CustGroup field of the CustTable just like the Dynamics AX end-users can in the Microsoft Dynamics AX Client. By clicking the Submit button, the records in the CustTable Web Form are filtered, taking into account the filter values entered in the WebGroup Filter control.
Continue reading......