• Lucas Wright 12
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hello, I have a JSON2Apex Class to parse the JSON response for a web service but my REST Update class isn't working with it, i'm getting a variable does not exist error on id. It's probably something really simple but I've barely gotten my head around Hello World so far, if anyone has any suggestions?

Here's my PUT Class:
 
@httpput
      global Static string fetchAccount(){
      RestRequest req = RestContext.request;
      RestResponse res = Restcontext.response;
      string jsonString=req.requestBody.tostring();
      JSON2Apex wResp=(JSON2Apex) JSON.deserialize(jsonString,JSON2Apex.class);    
          Patient__c obj=new Patient__c();
      obj=[select id from Patient where Id=:wResp.id];
      update obj;
      return 'Success';
      }
       global class JSON2Apex{
       global string EMPI;
      }

I can post the JSON2Apex if that's necessary but it's quite lengthy so didn't want to include if it wasn't necessary!
Hello,

I have a wrapper extension class that's intended to bring back grandchild records for a pageblock table within a Visualforce page. However, I keep getting errors when trying to save the Visualforce page referencing the extension controller. I'm not sure if there's a problem with the extension controller or the Visualforce page? Please see code below, any help is greatly appreciated!

VF Page:

<apex:page standardController="Consolidated_Invoicing__c" extensions="WrapperSarah"  renderas="pdf">

Extension Controller:

public class WrapperSarah{ 
private final Consolidated_Invoicing__c consinvs;
    public WrapperSarah(ApexPages.StandardController stdController) {
this.consinvs = (Consolidated_Invoicing__c)stdController.getRecord();
    }

Can provide the full code if needed but only getting errors after this has been added in following a salesforce guide.

Thanks!