• Wolfy
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hi

I have a component in C# i'm using for SF integration which all works fine. I currently have a custom C# login screen which uses the entered values to retrieve the SessionID.

However, i'd like to set it up so that if the user is already logged on to Salesforce through a browser then i can retrieve the SessionId from that session and so skip the login process. Any ideas if this is possible and if so how i go about it?

Thanks for any suggestions
Paul
  • August 16, 2012
  • Like
  • 0

All -

 

I have coded the C# side of things and all compiles and runs well. I have no issues inserting 1 record at a time. I am now trying to insert multiple records and am running into an issue. I generated a WSDL off if my class. The following code is proving to be a strruggle for me. I am sure I am structuring this incorrectly somehow, but am at a loss as to how. Can I get some assisteance?

global class TrialSession {
		WebService String strPatientData;
		WebService String strOrderID;
		WebService Date dtmTestDate;
		WebService String strTypeofTest;
		WebService String strReviewerName;
		WebService String strReviewerComments;
		WebService Date dtmDateofBirth;
		WebService Decimal numHeight;
		WebService Decimal numWeight;
		WebService String strGender;
		WebService String strEthnicity;
		WebService String strAsthma;
		WebService String strCOPD;
		WebService String strSmoker;
		WebService Date dtmDateReviewed;
		WebService Decimal numLungAge;
		WebService String strQualityGrade;
		WebService String strQualityGradeOriginal;
		WebService String strSoftwareVersion;
	}
	
	webservice static Trial_Session__c LoadTrialSession(TrialSession TSInfo)
	{
		//Look for existing Order_ID__c being passed in
		List<Trial_Session__c> objTrialSession = new List<Trial_Session__c>();
         
         objTrialSession = [SELECT External_ID__c FROM Trial_Session__c WHERE External_ID__c = :TSInfo.strOrderID];
         
         if(objTrialSession.size() > 0)
         {
         	// Existing Session Check
         	
         	Trial_Session__c updateTrialSession = [SELECT Patient_Data__c, External_ID__c, Test_Date__c, Type_of_Test__c, Reviewer_Name__c, Reviewer_Comments__c, Date_of_Birth__c, Height__c, Weight__c, Gender__c, Ethnicity__c, Asthma__c, COPD__c, Smoker__c, Date_Reviewed__c, Lung_Age__c, Quality_Grade__c, Quality_Grade_Original__c, Software_Version__c FROM Trial_Session__c
         	WHERE External_ID__c = :TSInfo.strOrderID];
         	
         	updateTrialSession.External_ID__c = TSInfo.strOrderID;
         	updateTrialSession.Test_Date__c = TSInfo.dtmTestDate;
         	updateTrialSession.Type_of_Test__c = TSInfo.strTypeofTest;
         	updateTrialSession.Reviewer_Name__c = TSInfo.strReviewerName;
         	updateTrialSession.Reviewer_Comments__c = TSInfo.strReviewerComments;
         	updateTrialSession.Date_of_Birth__c = TSInfo.dtmDateofBirth;
         	updateTrialSession.Height__c = TSInfo.numHeight;
         	updateTrialSession.Weight__c = TSInfo.numWeight;
         	updateTrialSession.Gender__c = TSInfo.strGender;
         	updateTrialSession.Ethnicity__c = TSInfo.strEthnicity;
         	updateTrialSession.Asthma__c = TSInfo.strAsthma;
         	updateTrialSession.COPD__c = TSInfo.strCOPD;
         	updateTrialSession.Smoker__c = TSInfo.strSmoker;
         	updateTrialSession.Date_Reviewed__c = TSInfo.dtmDateReviewed;
         	updateTrialSession.Lung_Age__c = TSInfo.numLungAge;
         	updateTrialSession.Quality_Grade__c = TSInfo.strQualityGrade;
         	updateTrialSession.Quality_Grade_Original__c = TSInfo.strQualityGradeOriginal;
         	updateTrialSession.Software_Version__c = TSInfo.strSoftwareVersion;

			update updateTrialSession;

            return updateTrialSession;
         }
         else
         {
         	//Get List of Trial Sessions
         	
         	Trial_Session__c insertTrialSession = new Trial_Session__c();
         	
         	insertTrialSession.Patient_Data__c = TSInfo.strPatientData; 
         	insertTrialSession.External_ID__c = TSInfo.strOrderID;
         	insertTrialSession.Test_Date__c = TSInfo.dtmTestDate;
         	insertTrialSession.Type_of_Test__c = TSInfo.strTypeofTest;
         	insertTrialSession.Reviewer_Name__c = TSInfo.strReviewerName;
         	insertTrialSession.Reviewer_Comments__c = TSInfo.strReviewerComments;
         	insertTrialSession.Date_of_Birth__c = TSInfo.dtmDateofBirth;
         	insertTrialSession.Height__c = TSInfo.numHeight;
         	insertTrialSession.Weight__c = TSInfo.numWeight;
         	insertTrialSession.Gender__c = TSInfo.strGender;
         	insertTrialSession.Ethnicity__c = TSInfo.strEthnicity;
         	insertTrialSession.Asthma__c = TSInfo.strAsthma;
         	insertTrialSession.COPD__c = TSInfo.strCOPD;
         	insertTrialSession.Smoker__c = TSInfo.strSmoker;
         	insertTrialSession.Date_Reviewed__c = TSInfo.dtmDateReviewed;
         	insertTrialSession.Lung_Age__c = TSInfo.numLungAge;
         	insertTrialSession.Quality_Grade__c = TSInfo.strQualityGrade;
         	insertTrialSession.Quality_Grade_Original__c = TSInfo.strQualityGradeOriginal;
         	insertTrialSession.Software_Version__c = TSInfo.strSoftwareVersion;
         	
         	insert insertTrialSession;
        
            return insertTrialSession;   
         }
     }

 The class has multiple objects like this and I need to account for multiple children.

 

The error I am getting is: List has more than 1 row for assignment to SObject

 

Please help. I would need an example if that would work. The records being inserted will have parents and children as well.

 

Hi Friends, I have do net developer who is going to develop dot net web services which will be consumed in Salesforce. Which web services can be consumed in salesforce 1) SOAP Based 2) WCF web services I have heard WCF does not work with salesforce.Can somebody confirm? Thanks, Trick
  • August 02, 2012
  • Like
  • 0