Announcements
Hi
I have custom field in grid, the field is sales order Id.
Now I need to provide the hyperlink to that field and when user clicked on this it has to open sales order form with selected sales order Id.
Kindly assist if any knows how to achieve this.
Thanks
Haribabu
*This post is locked for comments
Hi,
1. If you set your "Form Template" (which is under Form properties) as List Page and when you drag and drop fields from DS, you will get Hyperlink DataSource and Hyperlink Menu Item under Grid level field properties. Refer SalesTableListPage form in D365 F&O
2. Create Menu item button in Action Pane and set Visible as No (Refer ViewButton in SalesTableListPage Form)
3. In your Grid (under properties), set Default Action as View Button.
Thank you very much Raja
above code delete your listpage level jumpref override method now then-->
Class name -->ReqTransPOListPageInteraction
------------------------------------------------------
Class declaration //
add variable declaration --> FormStringControl purchidCtrl;
--------------------------------------------
Select --> initialized method
add the line --> this.hyperinitialized();
----------------------------------
add new method --> hyperinitialized
public void hyperinitialized()
{
Array fields;
FormStringControl ctrl;
FormDataSource frmDs;
Common currentRecord;
FormRun formRun;
super();
currentRecord= this.listPage().activeRecord('[Yourdatasourcename]');
frmDs = currentRecord.dataSource();
formRun = frmDs.formRun();
purchidCtrl = formRun.control(formRun.controlId("Yourfiledname"));
purchidCtrl.registerOverrideMethod(methodStr(FormStringControl, jumpRef), methodStr(ReqTransPOListPageInteraction, CustomjumpRef), this);
}
-----------------------------------------------------------------------
Add new method --->CustomjumpRef
private void CustomjumpRef(FormControl _formControl)
{
Yourtable(newfieldaddedtable) purch;
Args args;
MenuFunction menuFunction;
;
if (Yourfieldname.valueStr() != "")
{
menuFunction = new MenuFunction(menuitemDisplayStr("Yourhyperlinkformname"), MenuItemType::Display);
args = new Args(menuFunction.object());
purch = PurchTable::find(Yourfieldname.valueStr());
if (purch.RecId != 0)
{
args.record(purch);
menuFunction.run(args);
}
else
{
error(strFmt("Purchase order: %1 no longer exists"));
}
}
}
In which method can I add code?
Args locArgs = new Args();
SalesTable salestable;
locArgs.caller(this);
salestable = SalesTable::find(ReqPO.PeggingId);
locArgs.record(salestable);
locArgs.lookupRecord(salestable);
new MenuFunction(menuitemDisplayStr(SalesTable), MenuItemType::Display).run(locArgs);
ReqTransPOListPageInteraction class name add above code it will work man...
Listpageinteraction class -->use this methods...
//declare in classDeclaration
FormStringControl purchidCtrl;
public void initialized()
{
Array fields;
FormStringControl ctrl;
FormDataSource frmDs;
Common currentRecord;
FormRun formRun;
super();
currentRecord= this.listPage().activeRecord('[MyDataSourceName]');
frmDs = currentRecord.dataSource();
formRun = frmDs.formRun();
purchidCtrl = formRun.control(formRun.controlId("purchId"));
purchidCtrl.registerOverrideMethod(methodStr(FormStringControl, jumpRef), methodStr([MyListPageInteractionClass], jumpRefPurch), this);
}
private void jumpRefPurch(FormControl _formControl)
{
PurchTable purch;
Args args;
MenuFunction menuFunction;
;
if (purchid.valueStr() != "")
{
menuFunction = new MenuFunction(menuitemDisplayStr("PurchTable"), MenuItemType::Display);
args = new Args(menuFunction.object());
purch = PurchTable::find(purchid.valueStr());
if (purch.RecId != 0)
{
args.record(purch);
menuFunction.run(args);
}
else
{
error(strFmt("Purchase order: %1 no longer exists"));
}
}
}
Hi Hari,
Send me you code please.
Hi Raja,
Thanks for you reply by doing above I could provide the view details option.and still not able to provide hyperlink to field which is preview pane of list page.
Could you please suggest.
Thanks
Hari
Hi Hari,
Select the custom field and go to the properties -->
Display target default value-->Auto
Change the value --->Client
Now use the jumpref override method
public void jumpRef()
{
Args args;
MenuFunction menuFunction;
;
args = new Args();
menuFunction = new MenuFunction(menuitemDisplayStr(“FormName”), MenuItemType::Display);
args = new Args(menuFunction.object());
args.caller(element);
args.record(“RecordName”); // to be a datasource which added in the current form
menuFunction.run(args);
}
it will work....
André Arnaud de Cal...
294,095
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator