• Richard Blake
  • NEWBIE
  • 20 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 8
    Replies
Hi Guys,

I have list of Contacts, i need to add accountId to these contacts and then insert. How we can do it.

I tried the below way but getting some error.

Account account = new Account([select Id from Account Limit 1]);

List<Contact> cons = new List<Contacts>();

for(List<Contact> c:cons){
      c.add(account.Id);
  }
  insert cons;

Thanks,
Bujji
  • August 14, 2014
  • Like
  • 0
Dear All,

I am new to Salesforce Apex coding, please provide me sample code for updating related entity details. While updating an Oppurtunity, I need to update the Account details of that Oppurtunity.

Thanks In Advance
Suresh N
Hey,

I am trying to integrate Angular in my VF pages.
For testing reasons, I started with the very first example of the page https://angularjs.org.

<apex:page sidebar="false" showHeader="false" >
    <html ng-app="">
   <head>
        <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js"/>
   </head>
   <body>
        <div>
          <label>Name:</label>
            <input type="text" ng-model="yourName" placeholder="Enter a name here"/>
            <hr/>
          <h1>Hello {{yourName}}!</h1>
        </div>
   </body>
</html>
   
</apex:page>


But It won't work. I really cannot see where the problem is.
Best regards

I have a VF page with a controller. The controller executes a SOQL query and renders the result in the VF page. Straightforward.
I certainly want to respect sharing rules and FLS. This article http://wiki.developerforce.com/page/Enforcing_CRUD_and_FLS describes the FLS part using the isAccessible() method. Another article states that using "with sharing" in the class definition will automatically respect the sharing rules when a SOQL query is executed in the class. Now here comes the surprise:
When I have sharing rules set up for opportunities, I first have to make the opportunities Private in the sharing settings of my org (see http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_bulk_sharing_understanding.htm). Surprisingly as soon as I do that, the isAccessible() method returns false for every field on the opportunity even if a certain profile actually has access to the fields. Does that make any sense? So as soon as a user actually has access to a record according to the sharing settings, the FLS check in my code would not allow access to any field of the object. How can I solve that?

Any ideas? Thanks
Alex

Hi,

 

I am experimenting with generating APEX classes from WSDL, and I ran into an error when SF parse the WSDL. I am new to SF, can some guru please shed some enlightenments on what this error is about? Very much appreciated. Thanks in advance.

 

Error: Failed to parse wsdl: Unsupported Schema element found http://www.w3.org/2001/XMLSchema:attributeGroup.