How to open a record on a subgrid using easyrepro? - automated-tests

https://github.com/Microsoft/EasyRepro/issues/178
Hi all,
I am using dynamics365 version 9.x
Using EasyRepro I can navigate into an account via the global search and then also use the xrmBrowser.Entity.ClickSubgridAddButton("foobar"); function to create a new record of that 'foobar' type. By doing this I know I am accessing the correct subgrid on the account record.
My question is....which function would I use to simply open up the record I have created. I have tried SelectSubgridLookup but I don't think that is the function I am looking for.
From the image you can see I have created the 'bonno bonno' contact but I cannot open the record using EasyRepro. any help would be greatly appreciated! :)

https://github.com/Microsoft/EasyRepro/issues/178
Hello #darthtang - sorry for the delayed reply to your post here. From reviewing, it appears this is a feature gap and needs to be enhanced.
While not ideal, if you wanted to open the record, you could try the following instead:
xrmBrowser.Entity.ClickSubgridGridViewButton(subgridName)
This should take you to the 'Associated View' via Related Navigation. From here, you could call:
optional:
xrmbrowser.Related.Search(contactrecordname);
xrmBrowser.Related.OpenGridRow(#)
At this point, you could then switch back to perform actions on the opened Contact entity record:
xrmBrowser.Entity.SomeMethod();
Please let me know if this set of steps help you with your scenario. I've added a feature enhancement to the backlog to allow opening of a record from a subgrid on a form.

Related

Execute custom function after purchase a course/complete an order in LearnPress?

I need to execute a function immediately when someone purchases a course or an order gets completed successfully. The function I am trying to execute is actually called an API. I don't see an appropriate Hook from LearnPress.
It works perfectly when I use "user_register"(when someone registers this hook fire) hook but it doesn't work when I use this "learn_press_confirm_order" hook given by LearnPress.
Do you guys know is there any appropriate way that I can follow and achieve this. Thank You for your time
First off, your Lime API key should be treated as a password - don't share it on the web! Go to your LimeLM Account right now, choose 'Settings', and choose 'Generate New Key'. I'll wait :)
There's nothing obviously wrong with your code, so I would debug it like this:
Put a die('setup'); immediately after the add_action. We want to be sure that this file is actually being called. If it is, remove the die.
Wordpress and LearnPress are fantastic, because you've got the source code. Go to wp-content/plugins/learnpress and type (on Linux or something *nix)
grep -R "learn_press_confirm_order" .
This will show you all the files that reference this action. There is only one:
./templates/order/confirm.php: transaction_method, $order->get_id() ); ?>
So pull up an editor and edit wp-content/plugins/learnpress/templates/order/confirm.php. You need to determine:
Whether the file is being run at all when you order. (Use die right at the top, or error_log if you can see your webserver/php log files.)
I'm fairly certain at this point you will have found the error, but there's a chance for some reason you're getting to this page, but the action isn't being called. So you might need to work out the exact flow of control on this confirm.php page. Again, die or error_log.
You can make live changes to the code of learnpress, to help you debug it. Most people are afraid to dig into other people's code, but that's the great power of open source. You can just reinstall learnpress when you're done.
Looking forward to hearing how it goes :)

Playing soundcloud stream on multiple clients with meteor

I'm attempting to create a collaborative jukebox as a little project to learn Meteor, so apologies for this very high-level noob question.
I need to be able to call the soundcloud SC.stream (see https://developers.soundcloud.com/docs/api/sdks#streaming) function on multiple clients. The template all clients are looking at is binded to a object that looks something like:
room: {
title: "roomname"
currentlyPlaying: {
trackName: "track name"
trackStreamURL: "http://soundcloud/12345"
}
}
I can't seem figure out a way so that when a client, say the admin, sets a new currentlyPlaying to trigger all client to run SC.stream and start the new song.
I'm just not sure what the right meteor features are to use in this scenario, so i'm not looking for a code solution exactly, just a point in the right direction.
Thanks in advance.
Save the currently playing url in a document in a collection. Then use cursor.observe() or cursor.observeChanges() on the client to watch the document with the url in it. Do this inside a Tracker.autorun in block.
When the url changes, stop playing the previous tune and start playing the new one.
See here for documentation on cursor.observe().

Open direct links to AX-objects or datasets from external application

Is there a way to open a specified document, eg "production order 123" or form, eg "purchase orders" in Ax2012 from an external application directly?
In detail, I'm looking for something similiar like AXPath, but this doesn't work with versions greater then 2009.
Is there any ( maybe included ) way to achieve this?
There is! It's using AX's drilldown functionality which uses AxHLink.exe to handle dynamics:// URLs, which are passed to the Classes\SysStartupCmd function. You could also create some custom code there if you wanted to launch the AX client executable directly.
My question I asked some while back should have a great deal of useful information in it here:
What handles dynamics:// URLs?
Some more can be found: http://technet.microsoft.com/en-us/library/aa834337.aspx
EDIT:
It sounds like you are confused or the posts weren't clear enough. I think you have 3 basic options.
Dynamics:// URLs are handled by AxHLink.exe and they only seem to handle drilldown, viewalert, and viewalertrule. So if you want to use Dynamics:// URLs, you will need to hi-jack those somehow. There is a pastbin from Jan in that other stack post.
Create a custom URI handler and event poller (lot of work) see http://axcoder.blogspot.dk/2010/10/how-to-open-form-in-running-ax-from.html
Extend SysStartupCmd and then instead of using Dynamics:// URLs, just call Ax32.exe -startupCmd directly and a parameter can be passed to your custom class.

How to find which menu a node belongs to in drupal

I currently have nodes setup on my site, and each node belongs to a particular menu (not primary or secondary prebuilt menues).
How can i find out which menu a node belongs to?
Maybe this is what you mean:
$trail = menu_get_active_trail();
$lastInTrail = end($trail);
$menu_name = $lastInTrail['menu_name'];
menu_get_active_trail() returns a breadcrumbs like array, the last breadcrumb represents the current node.
Cheers,
Laurens Meurs, Rotterdam
I'm a noob, so don't bash me if what I'm going to write is worthless babbling.
I think you can't do that directly, unless there's some smart module out there that would do all the nasty SQL queries necessary to check this.
Node info is stored in the SQL table "node", and is identified merely by NID (node ID, which is the node number that appears after /?q=node/ in the address). Their aliases, if any, are stored in "url_alias" table, where you can find columns "src" and "dst", identifying the original and the aliased path (for instance, src='node/123', dst='my/url/alias'). The menu links can be found in the table "menu_links", where you can find the columns "menu_name" (the machine-radable name of a menu) and "link_path" (either the node/... or the alias).
So, what you'd need to do is the following:
get the current node's NID
query "url_alias" if there's an alias for node/NID and retrieve it, otherwise leave node/NID
query the "menu_links" table for the path you've determined and retrieve "none" or the menu's machine-readable name
You could then also query the table "menu_custom" to check what's the human-readable name of the menu you've determined.
Anyway, that's a complicated query (several queries?) and I'm a MySQL ignorant, so I can't help you with the actual code you'll need to use to check all that :P.
This isn't a direct solution and I see from your reply to a previous answer that you didn't wanted the simplest solution possible, but I thought I'd mention this option. The Menu Node API module maintains a table which Drupal lacks, a node-menu relationship table.
The module does nothing on its own, but there seems to be contributed modules which build on this, so depending on how complex your problem is it might be a starting point.
http://drupal.org/node/584984
Updated: Sorry guys, didn't even realize I had posted this link. I think I intended it as a draft and simply posted it when closing tabs. That said, mingos (above) is right on.
My link is to a function menu_get_active_menu_name() that appears to provide you with an array containing the active menu for the current page. As I presume that is what you are using it for, it would be a nice way to abstract yourself away from the database calls that might cause problems down the line.
I myself have never tried it, which is probably why I didn't elaborate and post. well... at least didn't post on purpose.

How can I add more information to MS Dynamics 2009 AX's alert messages with X++?

Does anyone have some sample code or can direct me to which class I can modify to add more information to the alert messages in Dynamics AX (DAX). I want to for instance add a vendor number and userid when a name of a vendor has been changed.
EDIT: I have been told by someone that HTML code must be entered in the description panel when setting up the alert. If this is true and anyone has more info on this it would be great if you could share this info.
Thanks in advance.
There's an article on Technet that shows the merge-data elements you can use in an e-mail template.
To add a new merge-data element, you will need to modify the class EventActionEmail. The method createEmailParameterMap returns a map containing the elements and the data to replace them with. The execute method passes that map to SysEmailTable::sendMail to actually format and send the email.

Resources