When adding an event via the request URL, do I absolutely need the Contacts/Leads record ID or is there a way I can add the Contact to the event with just their email address?
I'm adding events to CRM and I am able to add the 'Event Owner' which is field type 'lookup' with email. I then try the same with Contact Name (Who Id), but the relationship is not made with the email. I need to use the record ID, but would love to end with email.
Event fields:
<Events>
<section name="Event Information" dv="Event Information">
<FL req="false" type="Lookup" isreadonly="false" maxlength="120" label="Event Owner" dv="Event Owner" customfield="false"/>
<FL req="true" type="Text" isreadonly="false" maxlength="255" label="Subject" dv="Subject" customfield="false"/>
<FL req="true" type="DateTime" isreadonly="false" maxlength="120" label="Start DateTime" dv="Start DateTime" customfield="false"/>
<FL req="true" type="DateTime" isreadonly="false" maxlength="120" label="End DateTime" dv="End DateTime" customfield="false"/>
<FL req="false" type="Lookup" isreadonly="false" maxlength="120" label="Who Id" dv="Contact Name" customfield="false"/>
<FL req="false" type="Text" isreadonly="false" maxlength="100" label="Remind At" dv="Remind At" customfield="false"/>
</section>
</Events>
Looks like you can only add the Contact to the event with the ID, so what I did was retrieved the contact ID from the submitted email, then added to event.
if(isset($formvars['user_email'])){
$url = "https://crm.zoho.com/crm/private/xml/Contacts/searchRecords?authtoken=TOKEN&scope=crmapi&criteria=((Email:". $formvars['user_email'] ."))&selectColumns=CONTACTID";
$xmlresponse = simplexml_load_file($url);
$client = (string) $xmlresponse->result->Contacts->row->FL;
}
Related
I need to take the username, email and password a user enters in an html form (in index.aspx) and use it in an asp.net code in another page (register.aspx in a folder called 'u').
This is the form:
<form action="u/register.aspx" method="post" id="regForm">
<input type="text" name="fname" id="fname" placeholder="Full Name (Optional)" maxlength="16" />
<input type="text" name="uname" id="uname" placeholder="Username" maxlength="16" />
<input type="email" name="email" id="email" placeholder="Email Address" maxlength="32" />
<input type="password" name="pwd" id="pwd" placeholder="Password" maxlength="16" />
<input type="password" name="repwd" id="repwd" placeholder="Repeat Password" maxlength="16" />
<input type="submit" value="Sign Up" id="signup" />
</form>
But, when I'm using Request.QueryString["fname"] for example, it doesn't take 'fname' from the form, it just takes a null.
What can I do to solve this? Is there a different method I can use to achieve the wanted result?
Thanks a lot!
You are doing it wrong.
Request.QueryString contains information related to data added after ? in the URL (ex. http://www.contoso.com?mydata=1¶m2=yy).
You have to use Request.Form to access "POST" data.
QueryString will only give the parameters on the query string of the url check here.
If you want all the parameters you will need to use the Params property.
As others have already said Request.QueryString contains data after the ? in url.
You can use Request.Form or if you want the data as part of the url, you can change your form element method attribute to "get"
I have a user registration aspx page(1st page) which saved user information(username, email address, full name etc) in database table with pending status and redirect user to another PaypalPayment.aspx page(2nd page) where i have paypal button to pay user registration fee.
When user pay via paypal i get user email address and user full name of paypal account and redirect it to PaypalRegistrationSuccessful.aspx (3rd page) with email address and full name of user paypal account.
as i have user email address and user full name from paypal account so i want to update database user registration table from pending to approved user status because user already paid via paypal.
I have tried to pass values from 1st page to 3rd page to update database table and user status from pending to approved but my 3rd page not getting values from 1st page.
Here is my code and query string etc
On my registration aspx page(1st page) :
protected void btnSaveRegistration_Click(object sender, EventArgs e)
{
oApicultureManager.CourseRegistrationPaypal(oCourseRegistrationPaypal);
Response.Redirect("PDT/PaypalPayment.aspx");
Response.Redirect("PDT/PaypalRegistrationSuccessful.aspx?UserName=" + this.txtUserName.Text + "&UserEmail=" + this.txtEmail.Text);
}
On my PaypalPayment.aspx page(2nd page) HTML :
<form action="<%= ConfigurationManager.AppSettings["PayPalSubmitUrl"] %>" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="<%= ConfigurationManager.AppSettings["PayPalUsername"] %>" />
<input type="hidden" name="item_name" value="course test fee" />
<input type="hidden" name="amount" value="172.46" />
<input type="hidden" name="return" value="http://localhost:59651/PDT/PaypalRegistrationSuccessful.aspx" />
<input type="hidden" name="custom" value="Registration started: <%= DateTime.Now.ToString() %>" />
<input type="image" src="https://www.sandbox.paypal.com/fr_CA/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - la solution de paiement en ligne la plus simple et la plus sécurisée !" />
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"/>
</form>
on my PaypalRegistrationSuccessful.aspx (3rd page) :
if (!Page.IsPostBack)
{
username = Request.QueryString["UserName"];
useremail = Request.QueryString["UserEmail"];
//other code etc
}
Can any one tell me why i am getting null values on 3rd page?
or other good way to do this ?
http://msdn.microsoft.com/en-us/library/vstudio/ms178581(v=vs.100).aspx
You might try saving the information in a session variable, e.g.
Session["UserName"] = userName;
Session["Email"] = email;
and then that will save those throughout the life of the session. On the last page you can grab them using
var userName = Session["UserName"].ToString();
var email = Session["Email"].ToString();
I have done an interswitch payment gateway in my regular asp.net webform and asp.net mvc.
But I have a requirement to do the same in dotnetnuke which i know i can through module.
In my pay now pay of my application i have a form to send data across to interswitch webservice the form is below
<form name="form1" action="https://stageserv.interswitchng.com/test_paydirect/pay"
method="post">
<input name="product_id" type="hidden" value="XX" />
<input name="pay_item_id" type="hidden" value="XX" />
<input name="amount" type="hidden" value="XXXXXXX" />
<input name="currency" type="hidden" value="566" />
<input name="site_redirect_url" type="hidden" value="http://abc.com /getresponse”/>
<input name="txn_ref" type="hidden" value=" XXXAFTXXX”" />
<input name="hash" type="hidden" value="BB292DF9268F05CB9CBBC5E0C13CC1B13ACA34DC" />
</form>
I need someone to help me out on how i can implement this in my dotnetnukes module.
I faced a similar problem and asked this question. The accepted answer here is how I ended up doing it.
I just added the input fields to the page and then changed the "Pay" buttons PostBackUrl
This way you don't need to add an additional form to the page, and when the user clicks the button, it will submit those fields, so obviously it will pick up the ones it's looking for.
So in your case it would be:
<%-- other page content before --%>
<input name="product_id" type="hidden" value="XX" />
<input name="pay_item_id" type="hidden" value="XX" />
<input name="amount" type="hidden" value="XXXXXXX" />
<input name="currency" type="hidden" value="566" />
<input name="site_redirect_url" type="hidden" value="http://ipsum.com/getresponse”/>
<input name="txn_ref" type="hidden" value=" XXXAFTXXX”" />
<input name="hash" type="hidden" value="BB292DF9268F05CB9CBBC5E0C13CC1B13ACA34DC" />
<%-- pay button would look like this --%>
<asp:Button ID="btnPayNow" runat="server" PostBackUrl="https://stageserv.interswitchng.com/test_paydirect/pay" Text="Pay Now!" />
<%-- other page content after --%>
Of course if you have multiple payment gateway options you can set the PostBackUrl programatically before you display the form: btnPayNow.PostBackUrl = "http://<url>.com"
If you are posting to another site, not even anything on your site then you don't need a module at all.
With DNN you cannot include another form on your site like that. But you could make that a .html page and include that on your site as an iframe or something like that.
That should post to that other service fine.
I am trying to incorporate a reservation widget within my wordpress install and I have everything working fine except sending the data or it not populating on the other sites form. The site I am trying to send data to is an online reservation software: http://www.directinn.com/demo/
Here is how I am doing my form:
<form name="bookingform" action="http://www.directinn.com/demo" method="get" target="_blank">
<input type="text" name="date1" id="Text1" class="ftxt MyDate three columns" maxlength="10" value="" placeholder="Arrival Date"/>
<input type="text" name="date2" id="Text2" class="ftxt MyDate three columns" maxlength="10" value="" placeholder="Departure Date" />
<input type="submit" name="bookingformsubmit" class="book-now" value="Book Now">
<input type="hidden" name="arrivalDay" value="" />
<input type="hidden" name="arrivalMonth" value="" />
<input type="hidden" name="arrivalYear" value="" />
<input type="hidden" name="departureDay" value="" />
<input type="hidden" name="departureMonth" value="" />
<input type="hidden" name="departureYear" value="" />
<input type="hidden" name="numAdults" value="1" />
Any help would be greatly appreciated ;)
So they are saying if you can iFrame in their Form on your page and if you add the USERNAME for example to the URL, your USERNAME will appear on the invoice. Like this I believe:
http://www.directinn.com/iframefull.html/BOB
I do not think you can make your own form and POST to their page. I see no indication that that is possible from the link you posted of the example.
The code you have will submit a load of Query String data to the receiving site.
The target site may implement some type of cross-site posting prevention which is causing the blockage - or they may ignore your query string parameters entirely.
public ActionResult DisplayCustomer()
{
Customer objCustomer = new Customer();
objCustomer.Id = Convert.ToInt16(Request.Form["Customerid"]);
objCustomer.CustomerCode = Request.Form["code"];
objCustomer.Amount = Convert.ToDouble(Request.Form["amount"]);
return View(objCustomer);
}
This is my action in controller(MVC 2 aspx):
<form action="DisplayCustomer" method="post">
Customer id:-
<input type="text" id="Customerid" /><br />
Customer Code:-
<input type="text" id="code" /><br />
Customer amount:-
<input type="text" id="amount" /><br />
<input type="submit" value="click here" />
</form>
This is the view. When someone hit the submit button it is directed to a new page:
<div>
<b> ID</b> <%= Model.Id %><br />
<b> Code </b><%=Model.CustomerCode %><br />
<b> Amount</b> <%=Model.Amount %><br />
</div>
I always get 0 in Id and Amount while blank in CustomerCode.
Any clue? Why this is happening? What is wrong?
Your issue here is that you set the id, and not the name. Set the name to get the post back value. Eg:
<input type="text" name="Customerid" />
read also: HTML input - name vs. id in the line "Used on form elements to submit information"