cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HelvinFrancis
Regular Visitor

Set a default value in Currency field

Hi,

How to set a default value '0' in a currency column, can anyone help me on this?

Screenshot 2020-12-17 123124.png

Like this screen shot

 
 
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @HelvinFrancis 

 

What @yanoh @has suggested is a solution but it’s complex.


There are easier ways, without having to write code, using Business Rules or real-time workflow.

 

Depending on how you want the fields to default, Business Rules might not be appropriate as they only tigger when as user is interacting with the form in the user interface. If you have a background process or integration creating your records then you will want to use the real-time workflow as this also runs in the background.

 

Hope that makes sense

View solution in original post

2 REPLIES 2
yanoh
Microsoft
Microsoft

@HelvinFrancis Please try to use following Javascript.


function test(executionContext){
var formContext= executionContext.getFormContext();
var currency =formContext.getAttribute("cr39c_testcurrency").getValue();
if (currency = "null"){
formContext.getAttribute("cr39c_testcurrency").setValue(0);
}
}

Hi @HelvinFrancis 

 

What @yanoh @has suggested is a solution but it’s complex.


There are easier ways, without having to write code, using Business Rules or real-time workflow.

 

Depending on how you want the fields to default, Business Rules might not be appropriate as they only tigger when as user is interacting with the form in the user interface. If you have a background process or integration creating your records then you will want to use the real-time workflow as this also runs in the background.

 

Hope that makes sense

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,562)