I have added a field Studid in Protable.extension form( feild added on projtable table and form)
I need hyperlink on studid so that it should open form of Form2 with data source table2(table2 have studid field)
trying jump ref as below:
class HyperlinkEventHandlerOverrides
{
public static HyperlinkEventHandlerOverrides construct()
{
return new HyperlinkEventHandlerOverrides();
}
public void studid_OnJumpRef(FormDataObject _targetField)
{
StudentTable::jumpRefstudId(_targetField.getValue(), OpenMode::Edit);
}
}
=========================
class HyperlinkEventHandler
{
[FormDataSourceEventHandler(formDataSourceStr(ProjTable, ProjTable), FormDataSourceEventType::Activated)]
public static void ProjTable_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
{
var overrides = HyperlinkEventHandlerOverrides::construct();
sender.object(fieldNum(ProjTable, studid)).registerOverrideMethod(methodStr(FormDataObject, jumpRef),
methodStr(HyperlinkEventHandlerOverrides, studid_OnJumpRef), overrides);
}
}
==============
Form2>table > method > jumpRefstudId
public static void jumpRefstudId(studid _id, OpenMode _openMode = OpenMode::Auto)
{
studtable studinfoTable;
MenuFunction menuFunction;
Args args = new Args();
if (_id)
{
studinfoTable = studTable::findbyid(_id);
}
if (!studinfoTable)
{
return;
}
args.record(studinfoTable);
menuFunction = new MenuFunction(menuitemDisplayStr(From2),MenuItemType::Display);
menuFunction.openMode(_openMode);
menuFunction.formViewOption(FormViewOption::Details);
menuFunction.run(args);
}
by this my functionality is working fine > i m getting link and it is navigating to correct records, but before that . I go on all projects > when i select any project at that point I am getting this error:
RegisterOverrideMethod was called twice for the same object for method 'jumpRef'. You can only override a method once per instance