• Ventils
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Hi,

 

      I have a requirement and the Scenario is like this:  On Account I have a field True/False True_false__c which is a pick list containing values "YES" and "NO"  In the related list of Account I have a field I have Location__c if the Location__c is empty and user tries to select Yes on Account then the error should be displayed in an alert pop-up.

 

How can I achieve this?

  • September 24, 2013
  • Like
  • 0

Hi,

 

I am a newbie Iknow nothing.. I am completely dumb.. The guy who knows nothing.

 

I have a Json which I got as a reply when I made a callout This JSON contains the access_token how can I write the code so as to store the value of this access_token in a string and so that I could move on.. Any Help here?

 

 

Regards

  • September 06, 2013
  • Like
  • 0

Hi,

 

 I wish to learn web services.. I have no Idea what it is and its used for. I have just heard about its name. So could anyone give me details. and how could I learn webservices and its usage.  and the flow to learn this very thing. and how and where can I implement it. a few scenarios. Please no technical jargons. 

Hi,

 

      I have a requirement and the Scenario is like this:  On Account I have a field True/False True_false__c which is a pick list containing values "YES" and "NO"  In the related list of Account I have a field I have Location__c if the Location__c is empty and user tries to select Yes on Account then the error should be displayed in an alert pop-up.

 

How can I achieve this?

  • September 24, 2013
  • Like
  • 0

Hi,

 

I am a newbie Iknow nothing.. I am completely dumb.. The guy who knows nothing.

 

I have a Json which I got as a reply when I made a callout This JSON contains the access_token how can I write the code so as to store the value of this access_token in a string and so that I could move on.. Any Help here?

 

 

Regards

  • September 06, 2013
  • Like
  • 0

Hi,

 

 I wish to learn web services.. I have no Idea what it is and its used for. I have just heard about its name. So could anyone give me details. and how could I learn webservices and its usage.  and the flow to learn this very thing. and how and where can I implement it. a few scenarios. Please no technical jargons. 

I'm sure I'm missing something obvious here.  I've developed a @RestResource class with an @HttpPost method.  Here's the method-

@HttpPost
	global static String ImportContact() {
		RestRequest req = RestContext.request;
		System.debug('req is---------------------- ' +req);
		RestResponse resp = RestContext.response;
		
		
		Contact impContact = new Contact();
		impContact.FirstName = req.params.get('firstname');
		impContact.LastName = req.params.get('lastname');
		impContact.FirstName = req.params.get('email');
		impContact.Website_Id__c = req.params.get('userid');
		impContact.Phone = req.params.get('phone');
		impContact.LinkedIn_Profile_URL__c = req.params.get('linkedin');
		impContact.Facebook_Profile_URL__c = req.params.get('facebook');
		impContact.Website__c = req.params.get('personalwebsite');
		impContact.Twitter__c = req.params.get('twitter');
		try{
			impContact.Startup_Administrator__c = Boolean.valueOf(req.params.get('startupadmin'));
		} Catch (Exception e){
			resp.statusCode = 400;
			return 'startupadmin parameter must equal true or false';
		}
		
		//Check for a matching Contact
		
		
		try{
			upsert impContact;
		} Catch (DMLException e){
			resp.statusCode = 400;
			return 'Error loading Contact into Salesforce- ' +e.getMessage(); 
		}
		
		/*Blob pic = req.requestBody;
		if (pic.size() > 0){
			
		}*/
		
		resp.statusCode = 201;
		return 'Contact created';
		
	}

 Using curl, I can connect to this and pass in a file of JSON parameters as below, but all of those req.params.get calls in the method return null so the post returns an error?  

{
"firstname": "Json",
"lastname": "test",
"email": "email@email.com",
"phone": "914-417-9780",
"startupadmin": "true"
}

 

What confuses me is that in the debug log, I examine the RestRequest and I see the parameter values there-

10:39:21.061 (61510000)|USER_DEBUG|[12]|DEBUG|req is---------------------- RestRequest:[headers={Accept=*/*, CipherSuite=RC4-MD5 TLSv1 128-bits, Content-Type=application/x-www-form-urlencoded, Host=cs14.salesforce.com, User-Agent=curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5, X-Salesforce-SIP=108.6.201.115}, httpMethod=POST, params={{"firstname": "Json","lastname": "test","email": "email@email.com","phone": "914-417-9780","startupadmin": "true"}=}, remoteAddress=108.6.201.115, requestBody=Blob[0], requestURI=/NewEntStartup/, resourcePath=/services/apexrest/NewEntStartup/*]

 

Anyone seeing what I'm clearly missing here?  

 

Hi:

 

I have an @future method (called from a trigger, makes a callout).  This method is invoked from the quotes page in a before update trigger, and updates a custom field on the quotes page under certain conditions.

 

I would like the method to refresh or reload the quote page when it is complete.  Is there a way to do this from Apex?

 

Thanks in advance for any tips, tricks, etc. 

  • September 11, 2011
  • Like
  • 0