EP Samples from TechReady3
Yesterday (07/24/2006) I presented at TechReady3 (Microsoft‘s Internal Technical Readiness Event) on the EP Session. I demoed creating a web page to display vendor list with “zero code”. And then I demoed how you could do the same thing completely through coding to control the layout and format. Then I demoed the WebPart Connection and how you can control what is being displayed on the left menu based on some business logic and here is the code sample that I used.
Here is the sample code of the weblet that I created in this demo
public class TechReadyWebLet extends WebLet
{
boolean _even;
}
public void run(Args args)
{
str ret;
VendTable vt;
ret = "<h1>Top 10 Vendors</h1>";
ret += "<table border=0>";
_even=1;
while select vt
where vt.AccountNum < '3010'
{
if ( _even ==1)
ret += "<tr>";
ret += "<td><div class=formcaption>";
if ( vt.VendGroup == '10')
ret += "<IMG src=/_layouts/ep/images/green.gif /> ";
if ( vt.VendGroup == '50')
ret += "<IMG src=/_layouts/ep/images/yellow.gif /> ";
ret+= vt.name + "</div>";
ret += vt.address + "<br>" + vt.state +" " + vt.zipcode + "<br>" + vt.countryregionid + "</td>";
if ( _even ==0)
ret += "</tr>";
_even = _even ? 0 : 1;
}
ret += "</table>";
webSession().writeTxt(ret);
}
Here is the sample code that I used in EPVendTableInfo Web form to demo the Web Part connection
public boolean showMenuFunction(WebMenuFunction _menuFunction)
{
boolean ret;
ret = super(_menuFunction);
if (_menuFunction.name() == weburlitemstr(EPDocuList) && vendTable.VendGroup == '50')
ret = false;
return ret;
}
public Common setMenuFunctionRecord(WebMenuFunction _menuFunction, Common _cursor)
{
Common ret;
if (_menuFunction.name() == weburlitemstr(EPDocuList))
ret = null;
else
ret = super(_menuFunction, _cursor);
return ret;
}
Comments
Anonymous
July 25, 2006
<code>
ret+= vt.name + "</div>";
ret += vt.address + "<br>" + vt.state +" " + vt.zipcode + "<br>" + vt.countryregionid + "</td>";
</code>
In the "Writing Solid Code" was mentioned that MS inspects even examples for security flaws.
Can you add HTML escaping to this code?Anonymous
August 16, 2006
Q: On the sales orders info web form on the enterprise portal (Sales &gt; Sales orders &gt; select one...Anonymous
October 08, 2007
i am trying to integrating dynamic Ax with WSS 2007,but i have a lot of problem, such as when i deploy EP only have -deployStaticFiles: Success -DeployWebPart: Success -DeploySiteDefinition: Success but it doesn't success with axwebparts.cap:Deploying to http://YourServerName please what can i do?=??? please help meAnonymous
May 29, 2009
PingBack from http://paidsurveyshub.info/story.php?title=solutions-monkey-ep-samples-from-techready3Anonymous
June 15, 2009
PingBack from http://debtsolutionsnow.info/story.php?id=2214