Forum Discussion

PerBonomi's avatar
11 years ago

Not writing to database

Hi there. I have some jquery in the community header that writes values to every user. But, for about half our users it's not writing anything and I can't figure out why.

 

This is the code that writes the value:

$.post('/restapi/vc/users/id/${user.id}/profiles/name/field1/set', {value: '' + arLastLoginDate});

 

Has anyone run into a similar issue?

  • It may just be an error from when you pasted the code into your message, but you seem to be missing some quotes.

     

    Have you verified that the data you are posting is correct for all users?

    • PerBonomi's avatar
      PerBonomi
      Boss

      Those are actually two single quotes. For some reason it won't write if I just say {value: arLastLoginDate});

      • NicoB's avatar
        NicoB
        Lithium Alumni (Retired)

        HI PerBonomi 

        is your $.post surrounded by some sort of <#if condition or you're certain that the post is performed but no data is actually modified on the server?

         

        Nico