• CloudGeek
  • NEWBIE
  • 470 Points
  • Member since 2014
  • SFDC Consultant

  • Chatter
    Feed
  • 8
    Best Answers
  • 1
    Likes Received
  • 2
    Likes Given
  • 21
    Questions
  • 85
    Replies

Hi everyone can you please help me i am getting object object as return value.

 

js code :

import { LightningElement, wire, track } from 'lwc';
import mapDemo from '@salesforce/apex/Utility.mapDemo';
export default class LwcUtility extends LightningElement {
    @track name="Yogesh Upadhyay";
    @track message="Welcome";
    @track record;
    @track error;
    @track maps;
    @track conList= [
        {
            id:'12345678',
            name:'One two ka four',
            Phone:'100'
        },
        {
            id:'12345678',
            name:'One two ka five',
            Phone:'101'
        },
        {
            id:'12345678',
            name:'One two ka six',
            Phone:'102'
        }
    ];
    @wire(mapDemo)
     result({error,data}){
         if(data){
            this.record = data;
            console.log("return is "+this.record);
            JSON.stringify("hello",data);
         }
         if(error){
            this.error= error;
            console.log("retrun is "+this.error);
         }
     }
}

apex :
public with sharing class Utility {
    public Utility() {
    }
    @AuraEnabled 
    public static map<String,Integer> mapDemo(){
        map<String,Integer> testmap = new map<String,Integer>();
        testmap.put('avab',2);
        testmap.put('avab',2);
        testmap.put('avab',2);
        testmap.put('avab',2);
        return testmap;
    }
}
 

Hi All,

i want display the table as a vertical in visualforce page. pls demonstration this how to we can achive this.Give me example code 

Thanks,
Chanti
I am trying to chain job but the inner class code is not executing.
public class MyQueueable1 implements Queueable {

    Public Static list < Account > acclist = new list < Account > ();
    public MyQueueable1() {

    }
    public void execute(QueueableContext context) {

        System.enqueueJob(new MyQueueable2());
    }
    public class MyQueueable2 implements Queueable {

        public MyQueueable2() {

        }
        public void execute(QueueableContext context) {
            List < Account > a = [SELECT Id, Name
                                  FROM Account WHERE Id =: acclist];
        }
    }
}

 
I wa confused about the attribute "required" in field and field set.

If an field is defined as required, will it be required without any configure in field set?


 
I have a custom object called "Accounts."  When an account is created, it kicks off a task.  I want to copy some fields from the account into the task.  I have tried two approaches, and failed.  I need help.

Approach 1: Setup -> Customize -> Activities -> Activity Custom Fields.  Create New Field, select text, try to enter formula pointing to Account object's field.  I get an error: "Field does not exist."

Approach 2: Setup -> Create -> Workflow -> Field Updates.  Use "formula" to set up new value, but get same error: "Field does not exist."

How can I connect my custom Accounts object to tasks I create?  I'm sure it's obvious and I'm just missing something....
when i have use trigger.new and trigger.old please can any one explain indetailed with small scenarios please?
If in OWD I've given read/write access to account object and then in profile I revoke all access then what will happen?
I am new in salesforce Please Provide me a guidance where i am Study Test Classes of Apex Class and Trigger
Thanks & Regards
Jasveer Singh
what is the with sharing and without sharing in apex ?can any one provide small example with brief description???
Hi
My requirement is to bind recordtypes to an picklist and display in visual force page
I have the code show in this post.
public with sharing class recordtypepicklist
{
   public list<SelectOption> getRecordTypes()
   {
    list<SelectOption> options = new list<SelectOption>();
    
    for(RecordType sRecordType:[select ID,Name from RecordType where SObjectType='Contact'])
    {
     options.add(new SelectOption(sRecordType.ID,sRecordType.Name));
    }
     return options;
  }  
}
I am getting an error as Error: Compile Error: Variable does not exist: ID at line 9 column 38
Its coming from the statement inside the for loop.

Pls let me know how to resolve this.

pooja

 
Hi
I am understading the basics of metadata of fetching account info.
below is the code 
public class selectAllSOQLExampleController
{
    String SobjectApiName = 'Account';
   
    List<Account> accList=new List<Account>();
   
    public String query{get;set;}

    public List<Account> getAccList() 
    {
       Map<String,Schema.SObjectType> schemaMap=Schema.getGlobalDescribe();
          
       Map<String, Schema.SObjectField> fieldMap = schemaMap.get(SobjectApiName).getDescribe().fields.getMap();
     
       String commaSeparatedFields = '';
     
       for(String fieldName : fieldMap.keyset())
       {
            if(commaSeparatedFields == null || commaSeparatedFields == '')
            {
                commaSeparatedFields = fieldName;
            }
            else
            {
                commaSeparatedFields = commaSeparatedFields + ', ' + fieldName;
            }
       }
 
       query = 'select ' + commaSeparatedFields + ' from ' + SobjectApiName + ' Limit 10 ';
   
       accList = Database.query(query);
     
       return accList;
 
    }
}

<apex:page controller="selectAllSOQLExampleController">
  
   <apex:form>
        <apex:pageBlock>
                       
            <apex:pageBlockSection title="Account table" 
                                                     columns="1" 
                                                     collapsible="false">
                                   
                <apex:pageBlockTable value="{!accList}" 
                                                      var="acc">

                    <apex:column value="{!acc.name}"/>
                    <apex:column value="{!acc.phone}"/>
                    <apex:column value="{!acc.rating}"/>
                    <apex:column value="{!acc.industry}"/>
                    <apex:column value="{!acc.accountnumber}"/>
                    
                </apex:pageBlockTable>
 
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
My requirement is I want to display custom fields also.
Pls help me in tweeking my code.


pooja
Hi experts,
Very basic question and find difficult to understand. And please let me know, when to use what?

What is the difference between these 2 coding structures:
1.  public String name {
         get { return name;}
        set { name = value;}

2. public String name{get;set;}
In a test class, create an Account with a unique name.  Next, create an Id variable and attempt assigning the variable by selecting the Account by the unique name.  Error returns - list has no rows for assignment to sObject.
HI,
I want to override view button(Standard detail page) for certain profiles but not for all. What is the standard way to override? I am thinking to use nooverride=1 but not sure if it is a URL hack or standard way. Any help would be appreciated.

Thanks,
Hi All,
How do I display opportunity product related list on a visualforce page? I am trying to use <apex:relatedlist> markup but its not working. I guess its because both are standard objects. What is the best way to display opportunity product related list on visualforce page? How about using <apex:facet> markup. But Opportunity.Product2 gives me an error (invalid field).

Thanks,
Rick