hello my name is Charisse and this is our third tutorial video where we're
still going over how to create mobile work spaces for the dynamics 365 for
operations mobile app and the first two videos we created an all sales orders
page would you see on the right hand side here on my android device which
allows scrolling the list of sales orders you have in operations and in the
second video we showed how to design a details page and an application that
allows you to navigate from an item in this list to his details inside of the
mobile app alright so now the third to video third tutorial video we're going
to talk about how to create an action which allows adding a sales order to
this list from with inside of the mobile app so the first thing we're going to do
is we're going to edit our mobile work space when i select sales order
management which is the mobile work space we've been working on for the
tutorials will click the edit button and now we want this action to appear on the
all sales orders page right so we're going to select the all sales orders
page and edit it then we'll click on actions and i will go ahead and add our
action and this action is going to do what that allows you to create a sales
order so we'll call it create new sales quota there we go and i will click done
and now we're in the place where we can start editing on action so as i
mentioned in the previous tutorial video the magic button is being selected
fields button and it has an intelligent system behind it that tells it when it
should be enabled and when it should not be enabled in this case the system
understands that it can only be enabled when the form that is currently open in
this case we're open to the dashboard when the form that is currently open has
an entity that matches the expected entity for the particular data context
of action is attached to in this case this action is sitting on the all sales
orders page and the all sales want to stage the banking entity for it or
whether the banking entity for this list is sales table right so the cream sales
are going to light up once we're on a form that has the same backing entity as
this page so we go to all sales orders here we go le to the button has
magically been enabled you now will go through the same process we went to
before we were designing the list page or rather designing the page looks list
on it and designing the details page inside of our mobile app we're going to
open a top form and we're not going to make any
changes to it we're not going to click anything on it first thing we're going
to do is click select fields all right and now we're in the design mode we see
the orange border around the form now we're going to go ahead and execute the
process that's a part of creating the sales order and that process involves
clicking the new button on the all sales orders form right so it's important that
we click the new button while we're in the design mode while the orange border
is there because the mobile system is now the mobile framework is actually
going to capture clicking of the new button as a part of executing this
action it's going to click the new button for the user automatically when I
do this action on the mobile app all the user needs to do in the mobile app is
fill in the customer account so we want to add customer account and an editable
field in our page right now right now we have no editable fields so we can go
ahead and just set the customer account we could we could click the plus button
beside you to other fields is wanted to ask them what we're designing in action
sometimes you'll see the plus button doesn't appear beside the field but that
doesn't mean that it can be used it just means that you can't use the plus button
as a shortcut it means that you need to know change your value in it so to set
the value in the field in this case we're just going to set up value in our
customer count field so that it's added to our action design this case is coming
to us 001 is my customer account i'm going to go ahead and type that in press
tab all right we see the field has been added to my design by the action over
here and we'll see all the rest of the data has been defaulted for so the user
won't have to do the delivery name address and so and so now the third step
as a part of my action you're the first step being clicking the new button the
second step being entering a data value here at the customer count the third
step is going to be click ok so I'll go ahead and click ok while we're in the
design or we're still in the design mode is actually going to create a new sales
order of operations for mrs. creating rule data alright but now what that data
is created you see this pop-up appears and this is coming from the mobile
framework inside of operations the mobile framework detected aykroyd
operation create read update or delete operation and the reason that the mobile
framework automatically ends at the design mode you'll notice that the
orange border is gone and we can now select the kilt again the reason that it
automatically ends the design mode is because the right
that the process should be complete you've created a new entity is created
in sales order and that should be the end of this action this action should
have any other side effects it shouldn't create and then delete the sales order
and it shouldn't create the sales order and update other entities this is our
way of making sure that we understand it is a create action right and this create
action won't have any of the side effects so when the user is in the
mobile app and let's say they're all fly to the mobile app when they create that
sales order will be able to add that sales order to the list here Wilder
offline and will understand that there's no other related information that needs
to be updated the mobile app because there are no side effects there's just a
temporary sales order will create and will synchronize when that usually get
certified so high that's important making sure that this dialog appears
when you're done designing your action is very important sometimes as dialog
won't appear automatically after you've done something like a safe or after
you've done something like a new or delete own this dialog doesn't appear
what that means that it means that that action probably won't work well when the
user's device is offline it means that whatever way once you perform that crud
operation on your backing form code or you're back in table code it means that
the court operation isn't discoverable in a way that the mobile app expects
usually what that means is that you edited created saved where you perform
that operation on an entity that wasn't the same entity as we expect for the
action or a respect for the backing page in this case you created a new record in
sales table and sale table to the banking entity for slit so everything is
going to work as we expect we'll go ahead and click close here all right
we're done designing our action we're going to go ahead and back out this will
take us back to the page that has the action the old Phil source page so we're
on the actions tab here and on fields are still hear the things change as far
as our fields for the also that are still gonna see this list and card style
will go back one more time take them back to the mobile workspace the root
level part we're going to look done and I save this is going to overrun our
existing changes great now remember every time we might apply the metadata
for the mobile workspace you need to pull to refresh from the workspace
landing page slow and pull to a trench there now when we go into sales orders
again we're going to the actions now appear at the bottom
because we've added an action how the action bar appears the bottom we go
ahead and open that action bar will see the option to create a new sales order
let's go ahead and open that there we go and there's the one field that we
expected to enter data into the customer account so now all the user has to do is
type in a customer account number such as us us as 001 there you go and now
when the user clicks done something imagine what's going to happen so it's
important to understand what's happened so far so far our user had simply open
the action on the mobile device at that point in time the user has no session
there's no service call being made to operations to the AOS this entire
process can be done offline no forum code is being executed as a user open
this action and as a user types in or select this value the form code won't be
executed into the user clicks the done button when the user click the done
button what the mobile app is going to do is it's going to take that data value
us dash 0 0 1 and it's going to put that data value into the metadata for the
action you know the action metadata is a description of how to process that
action on the server and that description contains those three steps
we described before the description contains the fact or the step of
clicking on the new button of course you have to open the all sales orders form
as well but the framework behind will at four years of the level form so the
action definition says you know on the all sales orders form click the new
button entering a value for the customer count and in this case use the value
that they user typed in to the action of the mobile app and then click the ok
button alright so those through things are going to happen for the user
automatically when they click the done button here go ahead and click done
alright so that process has completed on the server on ALS and we think we have a
temporary record here in the mobile app and now that temporary records filled in
with the new sales over all right so the user clicks have done button and we
process that change on the ALS if the users online we process it immediately
if the user is offline we would simply navigate them back to this list and they
will see that temporary record and the record wouldn't get its final
information they reconnect it again but if they're
on lines and we'll leave them on the action and they'll see the sinking
notification of another word processing that action and then the mobile
framework is going to go out to the AOS it's going to create a new session with
that user context and of course with that company context you SMS it's going
to open the all sales orders form which is a top-level form it's going to click
the new button on that form it's going to enter into the customer account field
the data that the user typed in u.s. dash 0 0 1 and then it's going to click
the ok button for the user automatically so all that is happening as that action
is being processed and synchronized with the servant once the process completes
successfully the servers are until the mobile app the mobile lab navigates the
user back to the list of all sales orders and it shows the user that
tempura temporary record saying we successfully created a record for you on
the server but there's still some more information from the sales orders such
as a sales or ID that we don't have yet so because we recognize that we created
an in sales order we need to refresh the data on this page for the user
automatically since the banking entity for this page is sales table and we
created a new record and sales table the mobile app is automatically going to
cure refresh for this list so the user will see a temporary record while that
refreshes being processed and left the Refresh is done they'll see the actual
data for that new sales order all right so that's it into an example of how to
create a very simple pump action for creating a record some important topics
there are making sure that your entities match up making sure that I'm of course
the backing entity for your action is the same as the banking entity for the
page that the action is going to land on and in our case our action was created
from the exact same point and came from the old sales orders for so long is good
there we're using the same backing entity in the next next video we're
going to talk about how to make that add a sales order experience a bit more
user-friendly by adding a look up to the customer account so that the user
doesn't have to type in via customer account number