Monday, February 10, 2020

Decode URL with confidence

Yesterday, while configuring a Unified Service Desk to automatically display a dashboard, I need to obtain the Dashboard GUID.
The first option was to ‘manually’ analyze the values in the Query String.
But this option is prone to error. Developers may copy less or more than the GUID because of the URL encoding.
To minimize this risk, I found this online tool, https://www.urldecoder.org/

What is URL Decoder

It decodes the encoded URL. It makes it easier for us to view the information.

How does it work?

Just paste the encoded URL (Query String) in the upper box and click Decode.
The decoded result will be shown in the lower box.
From here, I can easily copy (and ensure what I’m copying) is correct.

Monday, September 9, 2019

PowerApps: Pagination

Background

I am totally new to PowerApps and found-out that there is no, out-of-the-box (OOB) pagination feature in Datatable or Gallery Control.
I’ve seen a few how-to blogs which walk me through on how to implement it. Refer below for the list.
But it does not really explain the logic on how it was constructed.

Thus, this particular blog is all about. We will break-down the functions used and explain the logic behind it.

What is Pagination?

In layman’s term, it is a process of displaying a chunk/small of results, from a bigger set of results, and PowerApps has no OOB feature of this.
To create a custom pagination in PowerApps, we will use the following PowerApps functions.
  • FirstN – used to display the first set of data, N denotes the number of records to be returned per set.
  • LastN  – used to display the last set of data, N denotes the number of records to be returned per set.


Both of these functions will return collection which will be used to display records in the datatable or gallery control.

The Logic

FirstN will return a big set of records starting from the 1st record, and LastN will trim the records that we are not interested.
It’s confusing isn’t? It is easier if there is an illustration.
In the following case scenario, we will display (page), 2 records at a time.
Let’s start with Page 1 – FirstN will return records 1 & 2 and LastN will return 1 & 2.
Page 2 – FirstN will return 4 records (1-4) but LastN will only return records 3 &4. (Did you now get the picture?)
One more, Page 3 – FirstN will return 6 records, but LastN will only return records 5 & 6.

The Code

The code below is used in Gallery or DataTable Items’ property, where it defines what records will be loaded in that control.
LastN(
    FirstN(varRecords, varIncrementalPageItems),
    varPagingItems
)
Let’s discuss the variables used in the code below and associate them in The Logic above.
<![if !supportLists]>·       <![endif]>varRecords – is a collection, which holds all our data from a datasource. This is the datatable records 1-6 in the table above.
<![if !supportLists]>·       <![endif]>varIncrementalPageItems – is a counter for FirstN return. This will determine the total number of records, starting from the 1st record. This is indicated by 1st
<![if !supportLists]>·       <![endif]>varPagingItems – This defines the number of record to be displayed, per page.

Previous and Next Button Logic

Pagination is incomplete if there is no Previous or Next button.
In PowerApps, majority is event driven. Changes in variable values will take effect to the controls (or code) that is using that variables.
Thus, the Previous and Next button should update varIncrementalPageItems,

Next Button Code

UpdateContext({varCurrentPage:If(varCurrentPage > 0, varCurrentPage + 1, 0)});
UpdateContext({varIncrementalPageItems: varPagingItems * varCurrentPage});

varCurrentPage – is the current page number. The next and previous button must increment and decrement it, respectively.
varIncrementalPageItems as define above, is a result by multiplying current varCurrenPage (Page Number) and varPagingItems.

Previous Button Code

UpdateContext({varCurrentPage:If(varCurrentPage > 0, varCurrentPage - 1, 0)});
UpdateContext({varIncrementalPageItems: varPagingItems * varCurrentPage});
 ******************************************************************************************

Friday, April 7, 2017

MSDYN Diary: Workflow updating the Status Reason field

One of my design was executed today.
However, we discovered a limitation and ended changing the approach.
We just learned that,
“via workflow, when updating a record, we cannot use (or update) the Status Reason field.“
So instead of a workflow, we just created a plugin.

Monday, May 2, 2016

Two Monkey's Paid Unequally

Ever wonder why it is a company policy not to disclose salary details to your peers?

Even monkeys' have the same thoughts. Watch this video.

Monday, March 21, 2016

The unfortunate event due to mishandling of my D610

I got heart-broken last January when I found-out that my Nikon D610 is broken.

Whenever I take pictures, the 1) AF is not working; and 2) via Manual focus, there is a dark (black) shadow at the bottom of every picture.

Instinctively, I've search for similar cases and hoping to find a solution. Apparently, there are similar cases but all of the solution involves a camera technician.

Too afraid to extend the damage, I accepted that I need to see a technician to have it fix (hopefully), which is unusual to me.

Hidalgo 
Last weekend, I finally got a chance to go to Hidalgo beside Quiapo Church. This is the Go-To place who are into camera/photography. Either buying a new camera, lens, or accessories. Or, to have their beloved camera a second life.

I've done my research what are the two camera repair shop I should visit based on the online reviews and online presence.

1st - Boy Camera Repair, quoted me for 8,500 which would take awhile to finish.
2nd - Dong Camera Repair Shop - quoted me for 6,500. 2-3 days to finish.

I don't haggle for the price to repair my camera because of the thought they might sacrifice the quality of service.

Because of the pricey fee, I decided NOT to have it fix for the meantime.

Moy's Camera Repair Shop
After eating fish-balls and decided not to have my camera fix, on my way to jeepney stand, (for some reason) I encountered Mang Jhun of Moy's Camera Repair Shop.

After telling him my theory that there might be missed alignment, he quoted me for 3,500. Far better than the 1st two. He told me that he has to stripped all of the parts because there is just no easy to access the parts that needs to be align. He told me also it is a 2-3 hours job. A bit hesitant, I just said yes and have it a go.

Two hours later. My camera is fixed! No parts has been replace, just alignment.




Monday, February 29, 2016

Hiding the Open Associated Sub Grid

The Open Associated Sub Grid icon (when clicked) will redirect the user to a page that will display the associated records.
Figure 1) Open Associated Sub Grid icon

There are situations where, we need to prevent the user in disrupting the flow if not needed thus, we need to hide the icon.


The steps below will guide to hide the icon.


  1. Download and import Ribbon Workbench for Dynamics CRM.
  2. Go-to Settings > Solutions
  3. Select RibbonWorkbench2013
  4. Click Ribbon Workbench - It will lunch Ribbon Workbench 
  5. Select the entity where you do not want to show the Open Sub Grid (1) icon
  6. Locate Open Associated Grid View (2)  and Right-clicked.
  7. Select Hide Button (3)
  8. Click Publish
  9. Then refresh the page of your record which display the Associated Sub Grid




Saturday, February 6, 2016

Dynamics CRM Search is Not Working

A new field is created. Invoke a universal search for the content of the new field, yet it is not displayed.
Likewise, the search results for related entities are not displayed.
In order to resolve the above issues, Quick Find view must be configured.
This is a step-by-step guide to ensure that the search configuration is complete, and that attributes you want to search is configured as well.
You’ll soon notice that Quick Find view setup is very important.

Searchable Entities

Ensure that the entity is searchable.
  1. Go to Settings > Administration > System Settings.
  2. Under General tab, go to Set up Search group and select Select entities for search.
  3. Ensure that the entity you want to search is in the list and click Ok.
    1. The image below shows the list of default searchable entities.
    2. If your entity is custom, this is a must. 

Entity Field Setup

This is an optional step because Searchable attribute is by default set to Yes. However, it is good practice to check.
  1. Go to Customization, click Customize the System.
  2. Select the entity and click fields.
  3. Double click the name of the field you want to configure. 

Setup the Quick Find View

The universal search is using Quick Find view for each entity it searches, thus we need to configure. We need to setup with this criteria:
  1. Add Find Columns – defines which columns will be searched.
  2. Add View Columns – defines which columns will be displayed.

Setup Add Find Columns

  1. Click view under the entity.
  2. Double click Quick Find Active Accounts.
  3. Click Add Find Columns – ensure that the column you want to search is checked. 
  4. Click Ok.

Setup Add View Find Columns

This is an optional step. The column can be searchable but not doesn’t necessarily need to be displayed. But how can you verify if it is not displayed?
  1. Click Add View Columns
  2. Add Sector field. 
  3. Click Ok.
  4. Publish your changes.

Testing

Navigate to the Accounts grid. Invoke a search for sector field.
Three things to note:
  • Sector field is displayed.
  • Sector field contains the search string.
  • If search in the grid does not work, it will not be displayed in the universal search results.
Invoke a universal Search:

Conclusion

Search configuration is a three step configuration (2nd step is optional because it is defaulted in that state, but good to check during debugging).
It is possible for a column to be searchable but not displayed in Quick Find view and opposite.

Decode URL with confidence

Yesterday, while configuring a Unified Service Desk to automatically display a dashboard, I need to obtain the Dashboard GUID. The fi...