Showing posts with label Model Driven Apps. Show all posts
Showing posts with label Model Driven Apps. Show all posts

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:

Thursday, November 3, 2022

Filter Email To/CC/BCC Column in Email Table

Introduction:


In this Blog we will see how to filter Email To/Cc/Bcc Fields in CRM/Model Driven Apps


Implementation Steps:

 

Consider if I have an Email Table with To/CC/Bcc Fields, but To Fields contains lots of Entities in it, But we need to Restrict to Some of the Entities alone

 

rampprakash_0-1667380238890.png  

 

Here is the List of Entities with TO Fields,

 

rampprakash_1-1667380316045.png

 

Let's See how we can filter this Fields..

 

Steps to Follow :

 

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

 

2. Click Solutions --> Create a New Solution or open an Existing Solution

 

3. Click Add --> Select New Web Resource

 

4. Write Below Code and Save it..

 

function SetDefaultView(executionContext) {
var formContext = executionContext.getFormContext();
var customerControl = formContext.getControl("to");
if (customerControl.getEntityTypes().length > 1) {
customerControl.setEntityTypes(['account','contact']);
}
}

 

the Above code mentioned that we are taking the Control ("TO") and filtering the ENTITYTYPES only to ACCOUNT AND CONTACT Table.

 

5. Once Done , Call this Event in OnLoad of the Form once the Page Loaded you will see only 2 Entity Types with Account and Contact

 

rampprakash_2-1667381715759.png

 

That's it :slightly_smiling_face:

 

Using JavaScript we can Filter the TO/CC/BCC fields in Email table

Thursday, October 6, 2022

How to Increase File Column Size in Dataverse

Introduction:

In this Blog, we will see how we can increase size of File Column in Dataverse/MSCRM Environment.

 

Implementation Steps:

 

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


2. Select the Respective Environment


3. Click Solutions if you have any else click Dataverse and Select Tables


rampprakash_3-1665051411936.png

 

 

4. Click on Respective Table and Open it.


5. Click New --> Select Columns


rampprakash_2-1665051383311.png

 

 

6. Once Selected New Column it will open a Popup in that Select Data Type as File and Select File as an Option


rampprakash_1-1665051354400.png

 

7. On Selected Click Advance Settings to Increase file Size

      Default Size will be 32768


rampprakash_4-1665051436843.png

 

8. If we want to Increase the Default File Size you can increase the same in Maximum File Size Column.

 

9. Once Done Click On Save

 

That's it :slightly_smiling_face:

Friday, July 8, 2022

Revoke Permission for Users to Edit in Dataverse tab

Introduction: 


In this Blog, we will see how to Revoke Permission for Users to Edit in Dataverse Tab.


Implementation Steps:

 

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

 

2. Click Dataverse --> Click Tables

 

rampprakash_0-1657275370571.png

 

3. After selecting tables you will have permission to Edit or Add new Tables or Customize it.

 

Let's see how we can avoid user to Customize here.

 

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

 

2. Click Gear Icon at the Top

 

3. Select Advance Settings --> Select Settings --> Security

 

4. Create a New Security Role or Open an Existing Security Role --> Navigate to Customization Tab and Remove Permission for the Values

 

rampprakash_2-1657275585414.png

 

 

5. Once Done Click Save and Close

 

6. Now Assign this Security Role to User (Make Sure there is no Other Security Roles having More Permissions)

 

7. Now Try Clicking the Dataverse you will get below error.

 

rampprakash_3-1657275675146.png

 

That's it :slightly_smiling_face:

Tuesday, May 31, 2022

How to Copy Schema and Logical name in PowerApps

Introduction:


In this blog, we will see how to copy Logical name and Schema name in Dataverse/MSCRM canvas.


Implementation steps:

 

1. Navigate to https://make.powerapps

 

2. Click Solutions --> Open Solution where the table is Available else CLICK DataVerse --> Click Tables and Open Table

 

3. Now Click On Columns

 

rampprakash_0-1654001908579.png

 

4. It will take you to all the columns where the field is Available

 

5. Now Select One of the Field and then you can see a Button Will get Enable called TOOLS

 

rampprakash_1-1654001973956.png

 

 

6. Click on the Tools you will see two options called Copy Schema Name and Copy Logical Name

 

rampprakash_2-1654002019210.png

 

 

What is the Main Difference Between Logical name and Schema Name?

 

  • Schema name --> It will be in Casing in my Case Schema Name will be pac_AccountId
  • Logical name --> It won't be in Casing in my Case Logical Name will be pac_accountid

 

That's it :slightly_smiling_face:

Tuesday, April 12, 2022

Clone OOB/Custom Entities in Dataverse Environment using Plugins

Introduction:

In this Blog, we will see how to clone OOB/Custom Entities in Dataverse or MSCRM Environment.

Scenario:

 

Consider I have an Opportunity Entity Available, once the Opportunity is WON or LOST, we want to Clone that Opportunity with Exact Same Details.

 

Let's see how we can achieve this. 

 

Note:

 

This Code is not only Restricted to OOB Entity, we can use this code in Custom Entity too

 

Implementation Steps:

 

You can write the below code in your Plugins.

 

 

Entity getOpprotuntiyRecord = (Entity)context.InputParameters["Target"];
Entity cloneRecord = service.Retrieve("opportunity", getOpprotuntiyRecord.Id, new ColumnSet(true));
cloneRecord.Attributes.Remove("opportunityid"); cloneRecord.Id = Guid.NewGuid(); Guid getCreatedOpportunity = service.Create(cloneRecord);

 

 

In the Above Code i mentioned as 

 

opportunity --> Change it based on your Entity Logical Name

opportunityid --> Entity Logical Name Primary Unique id name

 

That's it :slightly_smiling_face:

 

If Suppose you want to add some value to NAME Field while Cloning means you can write below code

 

Entity cloneRecord = service.Retrieve("opportunity", getOpprotuntiyRecord.Id, new ColumnSet(true));
cloneRecord.Attributes["name"] = cloneRecord.Attributes["name"].ToString() + " Renewal"; cloneRecord.Attributes.Remove("opportunityid"); cloneRecord.Id = Guid.NewGuid(); Guid getCreatedOpportunity = service.Create(cloneRecord);

 

You can Just Add the LOGICAL NAME while replacing.

Thursday, April 7, 2022

Disable Auto Save for Individual Forms in Model Driven Apps

Introduction:


In this Blog, we will see how to Disable Auto Save Functionality on Particular Form Using JavaScript.


Implementation Steps:

 

In my Previous Blog I have explained how to enable or disable AUTO Save functionality in Model Driven Apps. In this Blog we will see how to Prevent Auto Save in Particular or Individual forms using JavaScript.

 

Steps to Follow:

 

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

 

2. Navigate to Solution and Open the Solution which you already have else Create a New Solution

 

3. Create or Add Existing Table where you want to Prevent Auto Save functionality.

 

4. Once Table is Added, Add your Existing Web Resource. Else Create a new Web Resource.

 

5. Steps to Follow to Create a Web Resource

 

6. Add below JavaScript into your Web Resource

 

 

 

function preventAutoSave(executionContext) {
    var formContext = executionContext.getFormContext();
    var eventArgs = executionContext.getEventArgs();
    if (eventArgs.getSaveMode() == 70) {
        eventArgs.preventDefault();
    }
} 

 

 

 

7. Please find the Event Modes that will perform on SAVE operation

 

Event ModeValue
 Save1
 Save And Close2
 Save and New59
 Save as Completed58
 AutoSave70

 

8. Now Open the Table where you want to add Web Resource --> Click Forms --> Open the Form

 

9. Once Form Opens Click Form Library and Click Add Library and Search for the Library and Select the Check Box and Click Add

 

rampprakash_0-1649167174499.png

 

10. Once Added --> Click Events at the RIGHT Side --> Select OnSave --> Click ADD EVENT HANDLER --> Input Function name as preventAutoSave --> Make Sure You Select Check Box - Pass Execution Context

 

11. Now Click Ok --> Click Save and Click Publish.

 

That's it :slightly_smiling_face:

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...