Sunday, October 31, 2010

open URL directly from X++ code

open URL directly from X++ code , and you can pass parameter or Query String

static void openURL(Args _args)
{
infoLog.urlLookup('http://www.google.com');

}

Tuesday, October 26, 2010

Filter lookup from other lookup

Filter lookup from other lookup

this method is overrided method in TextEdit methods , used for filtring lookup according to value selected in other lookup
just change tablename and field name

I select RefPointSetupId from table HRCCompRefPointSetupLine and according to its value the second field RefPointId will filterd

Public void lookup ()
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup;
;

//Create an instance of SysTableLookup with the form control passed in
sysTableLookup = SysTableLookup::newParameters(tablenum(HRCCompRefPointSetupLine), this);

//Add the fields to be shown in the lookup form
sysTableLookup.addLookupfield(fieldnum(HRCCompRefPointSetupLine, RefPointId));
sysTableLookup.addLookupfield(fieldnum(HRCCompRefPointSetupLine, RefPointSetupId));


//create the query datasource
queryBuildDataSource = query.addDataSource(tablenum(HRCCompRefPointSetupLine));

//Only show LocalEndpoints for the current company
queryBuildRange = queryBuildDataSource.addRange(fieldnum(HRCCompRefPointSetupLine, RefPointSetupId));
queryBuildRange.value(SalaryAmend.RefPointSetupId);

//Assign the query to the lookup form
sysTableLookup.parmQuery(query);

// Perform lookup
sysTableLookup.performFormLookup();

// Don't call super()
// super()
}