Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- .NET Development
- :
- Web service help needed. Salesforce and asp.net
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Web service help needed. Salesforce and asp.net
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-25-2012 08:43 AM
Hello guys,
I am totaly new in Salesforce and in programming in general.
I have to create a webservice between salesforce and asp.net. Asp.net has a <List> of license kies, a user who has expirational date for the key.
I need to make a apex class which will grab info from asp.net, will compair data with existing Accounts in salesforce and then send a email template with notification that in 3 months the license will be expired.
Have no ideas how to make a List in asp.net and then bring rows to salesforce. Also confused with date formation in both asp.net and salesforce and just in general would like to understand the right logic to make it in Apex, as I learn it just for 2 month.
Would be really great guys if you could help me with some ideas about coding. Thanks in advance.
Here is my Apex class, first scetch.
global class NotificationForLicences {
Webservice static void SendNotificationReminder(String ReceivableAccount, List<String>licence, Date ExpirationDate ){
Account acc = [Select Account_ID_Number__c, name, Account_Email__c from Account where Account_ID_Number__c =:ReceivableAccount];
NotificationLog__c nl = new NotificationLog__c();
nl.ReceivableAccount__c = ReceivableAccount;
nl.ExpirationDate__c = ExpirationDate;
nl.licence__c = Licence;
insert nl;
messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTargetObjectId(nl.ReceivableAccount__c);
mail.setSenderDisplayName('Abbyy Salesforce Development');
EmailTemplate et = [Select id from EmailTemplate where name='WebService Confirmation mail'];
mail.setTemplateId(et.id);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
}
here is C sharp code
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Drawing;
using System.Text;
using Enterprise;
using NotificationReminder;
using System.Web.Services.Protocols;
public partial class LicenceNotification : System.Web.UI.Page
{
private SforceService enterpriseBinding = new SforceService();
private NotificationForLicencesService myBinding = new NotificationForLicencesService();
protected void Page_Load(object sender, EventArgs e)
{
LoginResult lr = enterpriseBinding.login("username", "password");
myBinding.SessionHeaderValue = new NotificationReminder.SessionHeader();
myBinding.SessionHeaderValue.sessionId = lr.sessionId;
myBinding.SendNotificationReminder("001P0XJEO3", "HXKMXXMMPKU", "2011-10-10");
}

