NetTalk Central

Author Topic: p_web.SetTheme('Metroblue') wont compile  (Read 1596 times)

Richard I

  • Sr. Member
  • ****
  • Posts: 381
    • View Profile
    • Email
p_web.SetTheme('Metroblue') wont compile
« on: June 22, 2023, 07:59:01 PM »
Hi All,
My app  doesn't like
 p_web.SetTheme('Metroblue')
unless I have it in the wrong embed?
I have placed it at the bottom of the login code in Validate Update
You said it could be called once the user had logged in?

Is there something else I need to do?
Thanks
Regards,
Richard
NT 12.62

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: p_web.SetTheme('Metroblue') wont compile
« Reply #1 on: June 23, 2023, 04:26:12 AM »
>> My app  doesn't like

define "doesn't like"

Richard I

  • Sr. Member
  • ****
  • Posts: 381
    • View Profile
    • Email
Re: p_web.SetTheme('Metroblue') wont compile
« Reply #2 on: June 23, 2023, 01:48:17 PM »
Apologies Bruce,
Following your earlier advise to include p_web.SetTheme('Themename')
I have , immediately following the User login Code in the login window embed-  Validate Update 3 Inside included  p_web.SetTheme('Metroblue')
The app wont compile- the compiler returns two errors "Unknown Procedure label" and "Field not Found:" SETTHEME

Thanks
Regards,
Richard
NT12.62

Jane

  • Sr. Member
  • ****
  • Posts: 350
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: p_web.SetTheme('Metroblue') wont compile
« Reply #3 on: June 23, 2023, 03:39:40 PM »
Try
p_web.ChangeTheme

Richard I

  • Sr. Member
  • ****
  • Posts: 381
    • View Profile
    • Email
Re: p_web.SetTheme('Metroblue') wont compile
« Reply #4 on: June 23, 2023, 06:05:14 PM »
 In the login Window  validate Update embed I have-

        User:password = Loc:Password
        IF Access:User.TryFetch(User:bypassword) = Level:Benign     
        p_web.SetSessionValue('ThemePreference',User:ThemePreference)
        _theme_ = p_web.GetSessionValue('ThemePreference')
        p_web.Trace(_theme_)
        p_web.Changetheme(_theme_)

The Trace statement is returning the desired theme as set in the user's profile, which is different from that theme set as the default.

 How can I get p_web.Changetheme(_theme_) to override the default theme during the session and thereby
 set the theme for the session to be User's theme choice on all subsquent forms

Thanks
Richard

Richard I

  • Sr. Member
  • ****
  • Posts: 381
    • View Profile
    • Email
Re: p_web.SetTheme('Metroblue') wont compile
« Reply #5 on: June 25, 2023, 04:58:19 PM »
Sorted !
Thanks for the help, Jane.
Regards
Richard

jking

  • Sr. Member
  • ****
  • Posts: 400
    • View Profile
    • Email
Re: p_web.SetTheme('Metroblue') wont compile
« Reply #6 on: June 29, 2023, 06:38:22 AM »
Richard,

     Can you share the final solution Jane helped you find?

Thanks,

Jeff

Richard I

  • Sr. Member
  • ****
  • Posts: 381
    • View Profile
    • Email
Re: p_web.SetTheme('Metroblue') wont compile
« Reply #7 on: June 29, 2023, 03:26:07 PM »
Hi Jeff
Happy to-
Attached as a text file.
Please let me know if anything is unclear to logtimer@yahoo.com
Cheers
Richard