Thursday, August 19, 2021

How to Create Powerapps Gallery With Pagination

How to Create Powerapps Gallery With Pagination

1.     Add a Gallery (Gallery Name : galHidden)



2.     Set Visible Property for galHidden = false



3.     Create a New Dropdown by selecting Inputà Drop Down



4.     Items for Dropdown [5,10,15,20] (Note: Make Sure its Number]

5.     Add Four Icon Based on below snapshot



6.     On select of (Start of Record)  (ICON With round)

a.     Onselect = Set(varPageNumber,1)

b.     Display Mode = If(varPageNumber=1, Disabled,DisplayMode.Edit)

7.     On select of (icon Previous)(ICON without round)

a.     Onselect = Set(varPageNumber,varPageNumber-1)

b.     Display Mode = If(varPageNumber=1, Disabled,DisplayMode.Edit)

8.     On Select of (icon Next)(ICON without round)

a.     Onselect = Set(varPageNumber,varPageNumber+1)

b.     Display Mode= If(drpPaginationSize.Selected.Value*varPageNumber<=CountRows(galHidden.AllItems),Edit,Disabled)

9.     On Select of (icon End of Record)(ICON With round)

a.     OnSelect = Set(varPageNumber, RoundUp( CountRows(galHidden.AllItems) / drpPaginationSize.SelectedText.Value ,0) )

b.     Display Mode= If(drpPaginationSize.Selected.Value*varPageNumber<=CountRows(galHidden.AllItems),Edit,Disabled)

10.  On Page Load OnVisible

a.     OnVisible = Set(varPageNumber,1)



11.  Add Label between two icons



a.     Text = "Page "&varPageNumber&" of "&If(Mod(CountRows(galHidden.AllItems),100)=0,RoundUp(CountRows(galHidden.AllItems)/drpPaginationSize.SelectedText.Value,0)&"+ pages",RoundUp(CountRows(galHidden.AllItems)/drpPaginationSize.SelectedText.Value,0)&" page(s)")

12.  Add a new Gallery (Name : galMain)

a.     Items : If(icoNext.DisplayMode=Disabled,

LastN(FirstN(galHidden.AllItems,drpPaginationSize.Selected.Value*varPageNumber),drpPaginationSize.Selected.Value-(drpPaginationSize.Selected.Value*varPageNumber-CountRows(galHidden.AllItems))),LastN(FirstN(galHidden.AllItems,drpPaginationSize.Selected.Value*varPageNumber),drpPaginationSize.Selected.Value))


please find github link for sample msapp file

Further reference

Tuesday, August 17, 2021

Add Remove Users for CRM/Dataverse in Office.com

        

                                                                    Adding Users:

Navigate to https://www.office.com/



Click Settings at the left side

Click Users --> Active Users --> Add a User

Automatically create password

If you want to create a password from your end (Untick the Box to create)

  

2.       Require this user to change their password when they first sign in

a.       If you want user to change password while their first login you can Enable checkbox

3.       Send password in email upon completion

a.       If you want to share password to user in their personal/office account

4.       


5.       Click Next to go to Assign product license(assign respective license to the users)


6.       Click Next for Optional Settings

7.       


8.       Review the data and click Finish Adding to Add a New User

Remove Users:

Navigate to Active Users à Click on three dots and Click on Delete user to Delete the User


 

Attached github link for your reference
Subscribe

Monday, August 16, 2021

Friday, July 9, 2021

Remove special characters from string

Dear All,

 

Please find the below string to remove special characters from string using JavaScript  

 

var temp = new String('This is a te!!!!st st>ring... So??? What...');

document.write(temp + '');
temp = temp.replace(/[^a-zA-Z 0-9]+/g,'');
document.write(temp + ''); 

Subscribe

Thursday, May 6, 2021

Linq to find the Array values Based on another Array

Dear All,

Please find the below code to find the unique value between 2 JSON Array

 

JSONOriginalValues --> (1,2,3,4,5,6) à Array [6] à Original Values

JSONCompareValues --> (1,2,3,7,8) à Array [5] à  Value to Compare

TO be deleted --> 7,8

TO be Updated --> 1,2,3

TO be created --> 4,5,6 

var tobeUpdated = JSONCompareValues.Where(MembersObj => JSONOriginalValues.Any(partyList => MembersObj.ContactId["fieldname"].ToString().ToLower() == partyList.PartiesContact.ClePartie.ToLower()));

 

                            var tobeDeleted = JSONCompareValues.Where(MembersObj => !JSONOriginalValues.Any(partyList => MembersObj.ContactId["fieldname"].ToString().ToLower() == partyList.PartiesContact.ClePartie.ToLower()));

 

                            var tobeDeleteds = JSONCompareValues.Where(MembersObj => JSONOriginalValues.All(partyList => MembersObj.ContactId["fieldname"].ToString().ToLower() != partyList.PartiesContact.ClePartie.ToLower()));

Saturday, February 27, 2021

Editable Grid - Read Only Field MSCRM

Dear All,

Please find the below code to disable field ON select of Row

function (executionContext) {

    // debugger;

    var formContext = executionContext.getFormContext();

    formContext.getData().getEntity().attributes.forEach(function (attribute) {

        if (attribute.getName() === "new_status"//FieldName

            && attribute.getValue() == NameSpace.GlobalVariables.ChangeDetailStatus.Approved) {

            attribute.controls.get(0).setDisabled(true);

        }

    });

}


Wednesday, February 17, 2021

Query D365 ce using fetch xml in azure logic app (without cds connector)

 Step 1:- Go to your azure subscription and create a new logic app (http triggere in our case):

2.png

Step 2:- Save the logic app and click on next step and initialize a variable to store your fetch xml:

3.png

Step 3:- Name your variable and paste your fetch xml in the value:

4.png

Step 4:- Click next step and select http action:-

Step 5:- Now select values as follows:

Method: Get

URI: https://<yourd365ceinstance&gt;.api.crm8.dynamics.com/api/data/v9.1/<entitypluralname>?fetchXml=

8

Step 6:- Now we have to pass encoded fetch xml declared in variable in step above.

For that click after = in URI and paste “uriComponent(variables(‘fetchxmltoexecute’))” in dynamics content section and click ok.

What it does?

This uriComponnet method encode the fetch xml stored in variable fetchxmltoexecute.

Your step should look like this:

10

Step 7:- Now select authentication method as Active Directory OAuth:

11

Step 7:- Set the rest of the parameters as follows:

Tenant : Azure tenant id

Audience : your CE url

Client Id: Azure ad application id/ Clientid

Credential Type: Secret

Secret : A valid secret generated for above ad app

12

Step 8:- Now save the logic app and click on run button and wait for few seconds on same screen.

Looks like all steps got succeeded..!!

1314

Step 9:- Let’s click on last http step and see the output. Data from account record is visible in body of the action:

15.png

You can write complex fetch and pass filters dynamically and execute all those request using this way.

Similarly you can directly fo CURD operation on ce/cds using such http action and without using cds connector.  It’ll be useful in scenario like where you want to update only delta on a record in ce/cds. Then you can build your json and post the json using post/patch method on desired entity.

Hope it was helpful..!!


Link Verified : Query D365 ce using fetch xml in azure logic app (without cds connector) – Dynamics 365 CE/Power Platform, PowerApps, Power Automate, Azure by Vishal Grade

How to Run Microsoft Flow for Every one Month

Introduction: In this Blog we will see how to Run Microsoft Flow for Every one Month. Implementation Steps:   1. Navigate to  https://make.p...