Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Simplication of Java Script

Avatar

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
aka44356106
Level 2

08-09-2019

in a livecycle dynamic form use this java script

if

   (Table92.Row1.Cell1.rawValue !== null && Table92.Row1.Cell2.rawValue !== null)

   {

          this.rawValue = "Completion of construction work for the " + Table92.Row1.Cell1.rawValue + " phase of instalment and request for release of " + Table92.Row1.Cell2.rawValue + " phase of instalment";

   }

if

   (Table92.Row1.Cell1.rawValue !== null && Table92.Row1.Cell2.rawValue == null)

   {

          this.rawValue = "Completion of construction work for the " + Table92.Row1.Cell1.rawValue + " phase of instalment and request for release of .................... phase of instalment";

   }

if

   (SfCC.Table89.Row5.Table92.Row1.Cell1.rawValue == null && SfCC.Table89.Row5.Table92.Row1.Cell2.rawValue !== null)

   {

          this.rawValue = "Completion of construction work for the .......................... phase of instalment and request for release of " + SfCC.Table89.Row5.Table92.Row1.Cell2.rawValue + " phase of instalment";

   }

if

   (SfCC.Table89.Row5.Table92.Row1.Cell1.rawValue == null && SfCC.Table89.Row5.Table92.Row1.Cell2.rawValue == null)

   {

          this.rawValue = "Completion of construction work for the .......................... phase of instalment and request for release of ................... phase of instalment";

   }

Please help me to short the java script ( i have very limited knowledge of java script)

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

08-09-2019

You can minimize it this way:

var oCell1 = Table92.Row1.Cell1,

oCell2 = Table92.Row1.Cell2,

cTxt = "Completion of construction work for the ";

if (oCell1.isNull) {

cTxt += oCell2.isNull ? (".......................... phase of instalment and request for release of ................... phase of instalment") : (".......................... phase of instalment and request for release of " + oCell2.rawValue + " phase of instalment");

} else {

cTxt += oCell2.isNull ? (oCell1.rawValue + " phase of instalment and request for release of .................... phase of instalment") : (oCell1.rawValue + " phase of instalment and request for release of " + oCell2.rawValue + " phase of instalment");

}

this.rawValue = cTxt;

or even more

var oCell1 = Table92.Row1.Cell1,

oCell2 = Table92.Row1.Cell2,

cTxt = "Completion of construction work for the ",

cDummy = "...................",

cTxt2 = " phase of instalment and request for release of ",

cTxt3 = " phase of instalment.";

if (oCell1.isNull) {

cTxt += oCell2.isNull ? (cDummy + cTxt2 + cDummy + cTxt3) : (cDummy + cTxt2 + oCell2.rawValue + cTxt3);

} else {

cTxt += oCell2.isNull ? (oCell1.rawValue + cTxt2 + cDummy + cTxt3) : (oCell1.rawValue + cTxt2 + oCell2.rawValue + Text3);

}

this.rawValue = cTxt;

Answers (2)

Answers (2)

Avatar

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
aka44356106
Level 2

09-09-2019

Sir

please suggest something so that font of Table92.Row1.Cell2 & Table92.Row1.Cell2 will also copy after calculation in script.

Avatar

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
aka44356106
Level 2

08-09-2019

thank you very much.

Its working..............