Skip to content

Instantly share code, notes, and snippets.

[ExtensionOf(classStr(FormRun))]
public final class FormRun_Class_Extension
{
/// <summary>
/// This allows unencrypted setting of the recordContext via the q querystring parameter:
/// q={"Parameters":[{"DataSource":"CustTable","FieldValues":[{"Field":"AccountNum","Value":"C123456789"}]}]}
/// </summary>
/// <param name = "_recordContext"></param>
/// <returns></returns>
public boolean applyRecordContext(str _recordContext)
private static str lastUniqueReference;
/// <summary>
/// Get a unique numerical reference
/// </summary>
/// <returns>Unique numerical reference</returns>
public static str getUniqueReference()
{
str nextUniqueReference;
int retryCount = 0;
public class wwReportExampleTest extends SysTestCase
{
[SysTestMethodAttribute]
public void TestReport()
{
//Arrange
wwSysUserRoleInfoReportPage report =
wwSysUserRoleInfoReportPage::construct();
//Pass arguments here if the report has a contract
public class wwSysUserRoleInfoReportPage extends wwBaseReportPage
{
protected void new()
{
this.parmReportName(ssrsReportStr(SysUserRoleInfo, Report));
}
public static wwSysUserRoleInfoReportPage construct()
{
return new wwSysUserRoleInfoReportPage();
public void run()
{
//Configure the SrsReportRunController controller
controller.parmReportName(reportName);
controller.parmShowDialog(false);
controller.parmLoadFromSysLastValue(false);
controller.parmReportContract().parmReportServerConfig(SRSConfiguration::getDefaultServerConfiguration());
controller.parmReportContract().parmReportExecutionInfo(executionInfo);
//Associate the Rdp contract with prepopulated values if we have one
protected XmlDocument xmlDocument;
protected Object contract;
protected str reportName;
protected SRSReportRunService srsReportRunService = new SrsReportRunService();
protected SRSReportExecutionInfo executionInfo = new SRSReportExecutionInfo();
protected SRSReportRunController controller = new SRSReportRunController();
public void run()
{
@noakesey
noakesey / IteratingXmlNodelList.xpp
Created January 25, 2019 16:03
Iterating an XML node list
public boolean elementExists(str elementName, str attributeName, str attributeValue)
{
XmlNodeList nodes = xmlDocument.GetElementsByTagName(elementName);
XMLNodeListIterator iterator = new XMLNodeListIterator(nodes);
while (iterator.moreValues())
{
XmlElement e = iterator.value();
str val = e.getAttribute(attributeName);
@noakesey
noakesey / xpp
Created December 14, 2018 16:19
Subscribe to a multicast delegate
[SubscribesTo(classStr(MyDelegateClass) delegateStr(MyDelegateClass, myDelegate))]
public static void delegateExample_myDelegate(real a, real b, EventHandlerResult result)
{
real total = a+b;
result.result(total);
}
@noakesey
noakesey / xpp
Last active December 14, 2018 16:24
Define a delegate
void myMethod()
{
EventHandlerResult result = new EventHandlerResult();
this.nydelegate(1, 2, result);
var total = result.result();
}
delegate void myDelegate(real parm1, real parm2, EventHandlerResult result)
{
@noakesey
noakesey / xpp
Created December 14, 2018 15:57
Handling table events
[DataEventHandler(tableStr(FMVehicle), DataEventType::ValidatedWrite)]
public static void FMVehicle_onValidatedWrite(Common sender, DataEventArgs e)
{
ValidatedEventArgs validateArgs = e as ValidatedEventArgs;
FMVehicle vehicle = sender as FMVehicle;
boolean result = validateArgs.parmValidateResult();
if (vehicle.NumberOfCylinders == 0)
{
result = checkFailed('Invalid number of cylinders.');