Add a link in a Broadcast message to open a record

Environment

None

Attachments

1

Activity

Nicolas Micoud 
January 12, 2022 at 2:16 PM

https://wiki.idempiere.org/en/NF9_Links_in_Broadcast_Messages

nb: Is possible to let windowUUID of getUrlZoom method empty, the window be determined by ZoomCommand when opening the link

Nicolas Micoud 
January 7, 2022 at 9:23 AM

I think is solved (there was a missing </a> in the generated link)
See https://github.com/nmicoud/idempiere/tree/IDEMPIERE-5135_fixLink

Nicolas Micoud 
January 5, 2022 at 4:20 PM

Reopening it as we find a very strange behaviour.
When the broadcast message panel rise at login, "Home tab label", "ToolTip", "ToolTip detail" and "HowTo detail" (but not "HowTo") are clickable (underlined).

To reproduce, add those lines at the beginning of the MBroadcastMessage.beforeSave method

if (newRecord) {
MProduct product = new MProduct(getCtx(), 50019, get_TrxName());
setBroadcastMessage(getBroadcastMessage() + " / "
+ getUrlZoom(product, "0db4ed02-c936-4318-87b4-a9e1208e689c", "click here") // open Assembly Area
);
}

Then, log in GardenWorld using GardenAdmin role and create a new Broadcast Message with :

  • type = immediate + login

  • target = role

  • role = GardenAdmin

  • frequency = until acknowledge

Save it and publish it.
Then change role and relogin

All red rectangles are links.
If you click on Home, that will open the product window, not display the Home tab.

 

Any idea where to look ?

?

Nicolas Micoud 
January 4, 2022 at 8:48 AM

Here’s an example:

 

String message = "bla bla bla";

MBroadcastMessage bm = new MBroadcastMessage(getCtx(), bmID, get_TrxName());
bm.setBroadcastType(MBroadcastMessage.BROADCASTTYPE_Login);
bm.setBroadcastFrequency(MBroadcastMessage.BROADCASTFREQUENCY_UntilAcknowledge);
bm.setTarget(MBroadcastMessage.TARGET_User);
bm.setAD_User_ID(recipients.get(0));
bm.setBroadcastMessage(subject + "
" + message + "
" + bm.getUrlZoom(, "85d25fa6-72c3-4a85-9f6f-1f507851b272", "click here"));
bm.saveEx();

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created January 3, 2022 at 12:44 PM
Updated March 1, 2022 at 12:21 PM
Resolved January 11, 2022 at 3:16 PM