You need to sign in to do that
Don't have an account?
How to get user info in html conponent of home page?
I create html component on home page where someoen put text in textbox and hit go buttton,case will be created.
Issue: It says invalid session Id. (So I used login method nad gave my username and password) but when it create case ,it define my name for owner of case. I need owner who is logged in.
How to get logged in user info in html home component.
Here is my code.
<script src="/soap/ajax/14.0/connection.js"></script> <script language="JavaScript" type="text/javascript"> function submitSearchForm(){ var searchField = document.getElementById('advsearchfield'); var result = sforce.connection.login("myname@xxx.com.test", "password"); var newCase = new sforce.SObject("Case"); newCase.Description =searchField.value; newCase.Status="Closed"; newCase.Origin="Hot Button"; newCase.Subject="General Inquiry"; result = sforce.connection.create([newCase]);if (result[0].getBoolean("success")) {alert("new account created with id " + result[0].id);} else {alert("failed to create account " + result[0]);}} </script> <form name="advsrch" method="post" onsubmit="return submitSearchForm();"><input class="searchTextBox" id="advsearchfield" maxlength="80" size="18" name="sbstr"> <input class="btn" value=" Go! " type="submit"></form>
any suggestion?
Thanks
hmmm.. Nice question but sorry I don't have any idea for this... Anyway i'll be also waiting for the solution from other members.
Finaly I solved this problem.
I created html type s-control with ajax toolkit to retrive user info.
In html componenet I put this html type s-control in iframe and it worked.