Tuesday, October 12, 2021

Open URL in PowerApps/Dataverse/MSCRM form Using JavaScript


Introduction:


In this blog we will see how to write Javascript to Open URL in PowerApps/MSCRM/Dataverse Environment.


Implementation Steps:

 

Syntax:

 

 

Xrm.Navigation.openUrl(url,openUrlOptions)

 

 

 

Consider am having a field in an Account Entity Called URL. Then in Onload of Page, if URL Field Contains Data Open another Page with URL

 

To Begin with i created a Field Called URL in Account Form

rampprakash_0-1634019498527.png

 

Then Create a WebResource File with Type as JS

rampprakash_1-1634020115162.png

 

function openURLOnLoad(executionContext) {
    var formContext = executionContext.getFormContext();
    if (formContext.getAttribute("cr608_url").getValue() != null) {
        var URL = formContext.getAttribute("cr608_url").getValue();
        var openUrlOptions = {
            height: 800,
            width: 800
        };
        Xrm.Navigation.openUrl(URL, openUrlOptions);
    }
}

 

Then Call the function in OnLoad Opearation

 

rampprakash_2-1634020208004.png

 

Save and then Publish

 

Create a Record in Account Entity 

rampprakash_3-1634020285670.png

 

Save then Refresh the Form

 

rampprakash_4-1634020327591.png

 

That's it :slightly_smiling_face:


Video For your Reference: Watch it and Subscribe it :slightly_smiling_face:




Friday, October 8, 2021

How to Create and Customize Sitemap in Model Driven App / Dataverse / MSCRM


Introduction:

In this Blog, we will see how to Create and Modify Site map in Model Driven Apps/ Dataverse Environment


Implementation Steps:

 

Consider you have 2 Different teams available in your Organization, 

 

1. Sales Team

2. Pay Roll Team

 

If Sales Team Logged into Dataverse environment they need to see only their Respective Entities in Site Map, the same way for Pay Roll Team as well.

 

So Come across this scenario, we can create 2 different Model-Driven Apps and we can share the same to Respective Teams.

 

To Create a Model-Driven Apps

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

 

2. Click On Apps

 

rampprakash_0-1633688339817.png

 

3. Then Select Model Driven Apps

 

4. Once You Selected it will prompt you with two option, 

          a. Classic Mode

          b. Modern App Designer.

 

rampprakash_2-1633688510980.png

 

 

Lets Start looking Classic Mode

 

1. Once You selected ok for Classic Mode it will take you to App Creation page, Enter your App Name, Unique name will be auto populated from App name.

 

If you have any Images you can select and click on Done

 

rampprakash_3-1633688552428.png

 

2. App Designer Page will gets loaded, Click on site map to Add the Entities

 

rampprakash_4-1633688694622.png

 

3. Enter the Area name, Group name 

 

rampprakash_5-1633688734468.png

 

4. Then Click On New Subarea and Select the Entities

 

rampprakash_6-1633688789889.png

 

That's it, Click on Save and Publish then Run the App to view the Designers

 

b. Modern App Designer

 

1. Once you select Modern App Designer, You will be request to Enter Model Driven App name

 

rampprakash_7-1633688907949.png

 

2. Click Add Page button in the Body of screen

 

3. Then Select Weather you want Table based View and form / Dashboard / Custom

 

rampprakash_8-1633688950188.png

If you select Table view and form pages you will be popped up with below screen. Select the Entities and Click Add by Selecting Show in Navigation

 

rampprakash_9-1633689004253.png

After clicking ok you can see the selected Entities in the Navigation

 

rampprakash_11-1633689157979.png

 

To add a new page click Add Page and you will be Popped with the Selection Screen Again

 

rampprakash_12-1633689196996.png

 

That's it.. this is how we need to Create Model Driven App in Dataverse Environment.

Tuesday, October 5, 2021

How to Use Open Entity Form in Dataverse Environment


Introduction:


In this blog we will see how to Open Entity/Quick Create Form from Dataverse/Model Driven Apps


There are two type of Forms Available

1. Main Form

2. Quick View Form

 

1. Main Form:

 

Consider you have a Ribbon Button and on Click on Button you want to Open a Main Form. So for that you can write the below JavaScript command to achieve the same


var parameters = {

};

parameters["cr608_logicalName1"] = Value1ForLogicalName1;

parameters["cr608_logicalName2"] = Value2ForLogicalName2;


Xrm.Utility.openEntityForm("cr608_EntityLogicalName", null, parameters);

 

2. Quick View Form:

 

Consider I have an account Entity and I want to Create an Contact Against that Account for that

 

First Retrieve Account Value and store in a Temporary Variable.

 

var retrieveAccountValue = null;

var accountId = null;

var account = primaryControl.getAttribute("parentaccountid"); // you can use formContext from Form. From Ribbon you need to pass Primary Control as Parameter

if (account != null) {

  retrieveAccountValue  = account.getValue();

  if (retrieveAccountValue  != null) {

    accountId = accountValue[0].id;

  }

}

 

Then Create a Variable to set the Account Values

 

var parentAccountForContact = {

  entityType: "account",

  id: accountId

};

 

then you can Call the below code to open a Quick Create Form

 

// Create a Parameter

var parameters = {};

//Open Quick Create Form

Xrm.Utility.openQuickCreate("contact", parentAccount, parameters).then(function (ValueOutput) { successCallback(ValueOutput); }, function (error) { errorCallback(error);});

// Success Call

function successCallback(success) {

  alert("Success");

}

// Error Call

function errorCallback(e) {

  alert("Error: " + e.errorCode + " " + e.message);

}

 

That's it


Conclusion:


This is how we need to user Open Entity Form in DataVerse/Model-DrivenApps/CRM Environment.

Monday, October 4, 2021

Scan Multiple Barcode at Once using PowerApps


Introduction :


In this Blog, we will see step by step implementation of how to Scan Multiple Barcodes at once and patch it to SharePoint


Implementation Process:

 

SharePoint:

 

1. Navigate to office.com

 

2. Click SharePoint (if SharePoint List Already Available Copy the List Name else follow from Step #3)

 

3. Click Create Site then Team Site

 

rampprakash_0-1633345239378.png

 

4. Site then Input the Site Name and Owner and Privacy Setting as PUBLIC

rampprakash_1-1633345304964.png

 

4. Click Next for completion of Site Creation

 

rampprakash_2-1633345367446.png

 

5. Click New then Click List and Select Blank List then Click Next and Input the Name and Create.

 

6. Copy the SharePoint Browser URL.

 

PowerApps:

 

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

 

2. Then Click on Apps

 

3. Click New and Select Canvas App

 

4. Once Page Opened Click on App and write the below Code

 

              getMultipleBarCodes --> to Collect Values after Scanning

 

ClearCollect(getMultipleBarCodes,Blank())

rampprakash_0-1633345525871.png

 

5. Add a Gallery and Set the Item for that Gallery as getMultipleBarCodes

 

rampprakash_1-1633345627696.png

 

6. Add a Barcode Button Insert --> Media --> Barcode Scanner

 

rampprakash_2-1633345683083.png

 

7. Select the Scan Button and in On Scan Operation write the below code ( if the Scanned code already exists then Throw Error else Collect the information)

 

If(CountRows(Filter(getMultipleBarCodes,Value=BarcodeScanner1.Value))>0,Notify("Scanned Barcode already Exists"),Collect(getMultipleBarCodes,BarcodeScanner1.Value));

 

8. Click on Data source then Select SharePoint then Input the copied URL and select the List

 

9. Click OK.

 

10. Add a Button 

 

rampprakash_3-1633346028817.png

 

11. Rename as Submit and write the below code in On Select of that button

 

ForAll(getMultipleBarCodes,Patch('BarCode List',Defaults('BarCode List'),{Title:Value}))

 

12. Save and Publish the App.

 

That's it. This is how we need to use Multiple Barcode Scanning with PowerApps.

 

Video for your Reference : To Subscribe

Thursday, September 30, 2021

Change DataVerse/D365 rollup frequency

Introduction

Usually When we create a Rollup Field it automatically creates a System Jobs with Recurrence of 1 Day. In this Blog, we will see how to change Rollup Frequency in DataVerse Environment.


Steps to Follow:

 

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

 

2. Then Click on Advance Settings by clicking Gear Icon at the Top

 

rampprakash_0-1633011956786.png

 

3. Then Click System Jobs

 

rampprakash_1-1633012030684.png

 

4. Change View to All Rollup Field Calculation Jobs

 

rampprakash_2-1633012121540.png

 

5. Then Open the Required Job to Change the Occurrence

 

rampprakash_3-1633012188014.png

 

6. Click Actions then Select Modify Recurrence

 

rampprakash_4-1633012252914.png

 

7. Then change Occurrence based on Requirement

 

rampprakash_5-1633012281581.png

 

That's it :slightly_smiling_face:

Tuesday, September 28, 2021

How to Create and Distribute Solutions from Power Platform

 Implementation Process:

 

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

 

2. Click Solutions then Click New then Enter the mandatory details like (Display Name/ Name / Publisher / Version)

 

rampprakash_0-1632315865876.png

 

3. Once Entered the Mandatory details click on Create --> Then open the Solution (in my case it is Demo Solution for publisher)

 

rampprakash_0-1632330684259.png

 

 

 

4. Click New to add a new Components(Tables/JS etc)

 

5. Click Add Existing to add the Existing Components

 

6. Once Done click On Export --> Then Publish

 

rampprakash_1-1632330787675.png

 

7. Then you will be directed to another screen for Exporting solution as Managed or UnManaged

rampprakash_2-1632330844242.png

 

a. Unmanaged --> If you Import it as Unmanaged in the destination environment we able to edit the Components available in the solution. Possible to export from the destination environment too.

 

b. Managed --> If you Import it as Managed you cannot edit the component. Not Possible to Export from destination environment.

 

8. Select the appropriate type and Click Export

 

9. Once import done you can import the same to your destination environment

 

That's it. This is how we need to Create, Export/Import solution from Source to Destination environment.

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