Friday, January 20, 2023

How to get SubGird Record Count with Webresource in Dynamics CRM

Introduction:


In this Blog, we will see how to Get SubGrid Record Count in MSCRM or Model Driven App using WebResource.


Implementation Steps:

 

1. Navigate to https://make.powerapps.com

 

2. Create or Open any Existing Solution

 

3. Open the Table/Entity where you want to get count of SubGrid in my case am taking Account Table

 

rampprakash_0-1674210056707.png

 

4. As per the ScreenShot there is 4 Records available so i need to show as a popup with Count as 4

 

5. So First Step i will take the Sub Grid Name

 

6. Open the Form where your SubGrid Exists 

 

rampprakash_1-1674210171186.png

 

 

7. Based on the Above ScreenShot the Name of the SubGrid is Contacts

 

8. Now Lets Start Writing the JavaScript

 

9. Open Your Visual Studio or VS Code and Write the Below Function

 

function getsubgridcount(executionContext) {
    setTimeout(function () {
        var formContext = executionContext.getFormContext();
        if (formContext !== null && formContext != "undefined") {
            var accountgridname = "Contacts";
            var count = formContext.getControl(accountgridname).getGrid().getTotalRecordCount();
            alert(count);
        }
    }, 15000);
}

 

10. Now Create a JavaScript (Web Resource) in CRM 

 

rampprakash_2-1674210958690.png

 

11. Click Save and Publish

 

12. Now Open the Same Account Form and Add the JavaScript Library in the Form

 

rampprakash_3-1674211210777.png

 

13. Now Add Function in the OnLoad Operation

 

rampprakash_4-1674211290953.png

 

14. Once Done Click Save and Publish

 

15. Now Open the Account Table and Open a Record you will see the alert message over there :slightly_smiling_face:

 

rampprakash_5-1674211665753.png

 

 

That's it :slightly_smiling_face:

Wednesday, January 4, 2023

How to Create Model Driven Apps With Security Role Restriction

Introduction: 


In this Blog we will see how to Create Model Driven Apps with Security Role Restriction.


Implementation Steps:

 

1. Navigate to https://make.powerapps.com

 

2. Click Apps

rampprakash_0-1672810833789.png

 

3. Now Click on New App and Select Model Driven App

 

rampprakash_1-1672810867637.png

 

4. Then Input the Name for the Model Driven App and click Create

 

rampprakash_2-1672810916805.png

 

 

5. Once Done Click Add Page and Select the Page which you want to display, for demo am selecting Dataverse table and click Next

rampprakash_3-1672811085419.png

 

6. Now select Existing table and select the table and Click Add

 

rampprakash_4-1672811132186.png

 

7. Once Done click Save and Publish

 

rampprakash_5-1672811166770.png

 

8. Once the App Gets Created now Click Play it will open a Popup with the App Which we have created.

 

9. Now Click on Settings and Select Advance Settings

 

rampprakash_0-1672811372993.png

 

10. Once Page Opened Select the Setttings and Click Apps

 

rampprakash_1-1672811593129.png

 

 

11. You can see the App which you have created now Select the three dots and select Manage Roles

 

rampprakash_2-1672811724501.png

 

12. Once Selected it will Open the Roles --> select the Roles and Click Save

 

rampprakash_3-1672813533473.png

 

13. Once Save done.

 

The Respective Model Driven App will Load if the Logged in user contains that Specific Security Role which we have selected in Step 12.


That's it :slightly_smiling_face:

Monday, November 14, 2022

Generate Word Document Template Using Power Automate

 Introduction:

In this Blog am explaining how to Generate Word Template using Power Automate with Back End as SharePoint.

And am Covering how to add Repeating Controller and Plain Text Content Controller in Word Document.

 

Implementation Steps:

 

1. Navigate to your SharePoint Site and Create SharePoint List

2. In my case i have created 2 SharePoint List One is Employee and another Student

rampprakash_0-1668425443919.png

 

3. Add Records to Employee List and Student List

rampprakash_1-1668425444174.pngrampprakash_2-1668425444175.png

 

4. Now Open Microsoft Word Document 

 

5. Once Microsoft Word Opened Click on Developer in Ribbon Tool Bar 

 

rampprakash_3-1668425445219.png

 

6. If the Developer is not available then Click File --> Select Options --> Click Customize Ribbon and Select Developer --> and Click OK

 

rampprakash_4-1668425445416.png

 

7. Once Done Click Insert and Select Table

 

rampprakash_5-1668425445218.png

 

 

8. Now Input the Name in the First Column

 

rampprakash_6-1668425443674.png

 

9. Now Select the ID  then Click On Developer Ribbon Tab at the TOP then Select Add Plain Text Content Controller

 

rampprakash_7-1668425444701.png

 

10. Now Once Done Select the ID Column then Click Properties

 

rampprakash_8-1668425445215.png

 

 

11. After Clicking Properties it will Open Popup Enter Title and Tag

 

rampprakash_9-1668425445220.png

 

 

12. Once done, do the same for other Column as Well

 

rampprakash_10-1668425444424.png

 

 

13. Once Done, Now we are ready to Add Repeating Content Controller For the Table so that it will display All the Values from the List

 

rampprakash_11-1668425444687.png

 

 

14. Now Click On Properties and Provide the Tag and Title For Relating Table

 

rampprakash_12-1668425444705.png

 

 

15. The Same Way Create a New Table For Student and Add the ID and Title 

 

rampprakash_13-1668425445220.png

 

16. Now am Adding a Single Line of Text  Value as Well--> Simply add a Single Line of Text

 

rampprakash_14-1668425444173.png

 

17. Once Done Save the File in Your SharePoint Site

 

rampprakash_15-1668425445214.png

 

Once after Record Gets Created navigate to https://flow.powerautomate.com

 

18 . Click Apps --> Select New Flow --> Select Instant Cloud Flow and Input the Name as (Generate Word Template Using Power Automate) and Click Create.

 

rampprakash_16-1668425445413.png

 

19. Now Click Add Step and Select SharePoint and Search for Get Items and Add the SharePoint Site and Select List Name

 

rampprakash_17-1668425445211.png

 

20. Now Add Get Items Again and Get the Student List

 

rampprakash_18-1668425444422.png

 

 

21.Once Done Click Add Step and Search For SELECT

 

rampprakash_19-1668425444933.png

 

 

22. Now Select the Respective Values then Please make sure the EMPID and EMPTITLE As like as Properties which we have created in Point 11

 

23. Now Select Add Steps --> Search for Word then Select POPULATE A MICROSOFT WORD TEMPALTE then Select the Locations

 

rampprakash_20-1668425444723.png

 

 

24. Now for Populating REPEATING TABLE click the HIGHLIGHED BUTTON and Select the OUTPUT Values form Point 21.

 

25. Now Add Some Custom Values in Single Line of Text.

 

26. Now Send an Email 

rampprakash_21-1668425444918.png

 

 

That's it :slightly_smiling_face:

 

Now are are good to start the Process

 

rampprakash_22-1668425444944.png

 

 

Now the Flow Created Successfully. Now am Opening My Email and Downloading the file

 

rampprakash_23-1668425444704.png

 

 

Open the Downloaded File 

rampprakash_24-1668425443942.png

 

 

That's it :slightly_smiling_face:

 

I have mentioned Step by Step behaviors for How to Generate Word Document Template Using Power Automate :slightly_smiling_face:

Monday, November 7, 2022

How to get Quarters from Date in Canvas PowerApps

Introduction

In this Blog we will see how to get Quarters from Date in Canvas PowerApps


Implementation Steps:

 

1. Navigate to https://make.powerapps.com

 

1.jpg

 

2. Select Apps --> Select New App --> Select Canvas

 

3. Once Page Opened Input the name and Select Tablet or Phone depends on your requirement, from my end am selecting Tablet Mode

 

2.jpg

 

4. Once Page Get Opened  --> Add a Label by Selecting (Insert --> Label) and Add a Button as Well

 

3.jpg

 

5. Now Select the Button and go to OnSelect and Write below code Logic

 

4.jpg

 

Code For Converting Date to Quarter

If(
    Month(Now())<=3,
        Set(getQuarterFromDate,"1"),
    Month(Now())>=04 && Month(Now())<=06,
        Set(getQuarterFromDate,"2"),
    Month(Now())>=07 && Month(Now())<=09,
        Set(getQuarterFromDate,"3"),
    Month(Now())>=10,
        Set(getQuarterFromDate,"4")
)

6. Now Set the Default Value to getQuarterFromDate

5.jpg

 

7. Now Click on the Button

 

 

You will see the Current Quarter Value there.

 

That's it :slightly_smiling_face:

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...