Skip to main content

Posts

How to set a redirect page after log-out in PowerApp portal

We need to follow the following steps Setp:-1) open the harder file from the web template. Step:-2) Go to the element same as following < a role = "menuitem" aria-label ="{{ snippets [" links / logout "] | default : resx [" Sign_Out "] | escape }}" href ="{% if homeurl %}/{{ homeurl }}{% endif %} {{ website.sign_out_url_substitution }} "" title ="{{ snippets [" links / logout "] | default : resx [" Sign_Out "] | escape }}" > {{ snippets ["links/logout"] | default : resx ["Sign_Out"] | escape }} </ a > Step:-3) Now replace the above higlited part with the following / Account / Login / LogOff ? returnUrl =%2 F Recirectionpageneme %2 F a.)In this highlighted URL highlighted with the green is page name or page relative URL

Debt Repayment Calculator via JS

  function   GetDebtCalculationval ( arg_p ,  arg_n ,  arg_r ) {      debugger ;      var   p  =  parseFloat ( arg_p );      var   n  =  parseFloat ( arg_n );      var   r  = ( parseFloat ( arg_r ) /  12 ) /  100 ;      var   powerval  =  n  * - 1 ;      var   step1  =  Math . pow (( 1  +  r ),  powerval );      var   step2  =  1  -  step1 ;      var   step3  =  step2  /  r ;      var   result  =  p  /  step3 ;      return   result ; } function   GetN_NumOfMonthViaMPA ( principal ,  interest ,  monthlypayment ) {      debugger ; ...

PMT Calculation via JS

  // Function to calculate Periodic Payments. function   pmt ( rate ,  per ,  nper ,  pv ,  fv ) {      fv  =  parseFloat ( fv );      nper  =  parseFloat ( nper );      pv  =  parseFloat ( pv );      per  =  parseFloat ( per );      if  (( per  ==  0 ) || ( nper  ==  0 )) {          alert ( "Why do you want to test me with zeros?" );          return  ( 0 );     }      rate  =  eval (( rate ) / ( per  *  100 ));      if  ( rate  ==  0 )  // Interest rate is 0     {   ...

JS retrieve multiple with FetchXML

"; fetchXml = "?fetchXml=" + encodeURIComponent(fetchXml); Xrm.WebApi.retrieveMultipleRecords("account", fetchXml).then( function success(result) { for (var i = 0; i var fetchXml = "<fetch mapping='logical'><entity name='account'><attribute name='accountid'/><attribute name='name'/></entity></fetch>" ; fetchXml = "?fetchXml=" + encodeURIComponent (fetchXml); Xrm.WebApi.retrieveMultipleRecords( "account" , fetchXml).then( function success ( result ) { for ( var i = 0 ; i < result.entities.length; i++) { console .log(result.entities[i]); } // perform additional operations on retrieved records }, function ( error ) { console .log(error.message); // handle error conditions } );

Js Code for auto populate lookup on a create from a subgrid in Power Portal

$ ( document ). ready ( function  () {          var   url  =  window . location . href ;      var   id  =  getParameterByName ( "id" ,  url );      var   name  =  $ ( "#msnfp_name" ). val ();      localStorage . setItem ( "id" ,  id );      localStorage . setItem ( "name" ,  name );      function   getParameterByName ( name ,  url ) {          if  (! url )  url  =  window . location . href ;          name  =  name . replace ( / [ \[\] ] / g ,  " \\ $&" );          var   regex  =  new   RegExp ( "[?&]"  +  name  +  "(=([^&#]*)|&|#|$)" ),    ...