Write message to console from After save(PHP)

Questions related to using nuBuilder Forte.

Write message to console from After save(PHP)

Unread postby slobodan » Tue May 11, 2021 3:21 am

Is it possible to write "Hello World" to console from After save, using php custom code?
slobodan
 
Posts: 12
Joined: Sat May 08, 2021 8:50 pm
nuBuilder Version: 4.5

Re: Write message to console from After save(PHP)

Unread postby kev1n » Tue May 11, 2021 3:34 am

Hi,

Does it have to be in After Save?

This would work in Before Edit:

Code: Select all
$j = "
   if (nuHasBeenSaved()) {
      console.log('Hello World');
   };
";

nuAddJavascript($j);
kev1n
nuBuilder Team
 
Posts: 1771
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Write message to console from After save(PHP)

Unread postby slobodan » Tue May 11, 2021 4:41 am

I would like to write to console during application development, for debugging purposes. It is relatively easy with javascript, but from php all my tries failed.
slobodan
 
Posts: 12
Joined: Sat May 08, 2021 8:50 pm
nuBuilder Version: 4.5

Re: Write message to console from After save(PHP)

Unread postby slobodan » Tue May 11, 2021 5:20 am

I tryed :

$j="console.log('Hello World');";
nuAddJavascript($j);

in As and BS, without any error, but nothing appeared on the console.
slobodan
 
Posts: 12
Joined: Sat May 08, 2021 8:50 pm
nuBuilder Version: 4.5

Re: Write message to console from After save(PHP)

Unread postby kev1n » Tue May 11, 2021 2:06 pm

nuAddJavascript can be used in Before Browse, Before Edit

Use nuDebug() instead.
kev1n
nuBuilder Team
 
Posts: 1771
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Write message to console from After save(PHP)

Unread postby slobodan » Tue May 11, 2021 9:51 pm

Thanks for your reply.

Slobodan
slobodan
 
Posts: 12
Joined: Sat May 08, 2021 8:50 pm
nuBuilder Version: 4.5


Return to General

Who is online

Users browsing this forum: No registered users and 16 guests