Skip to main content
Premawati . (Deloitte USI) a posé une question dans #Apex

Account IT = new Account();

String integrationtransactionId= '0016F00001y5mQW';

List<String> fields = new List<String>(Account.SObjectType.getDescribe().fields.getMap().keySet());

String soql='';

soql=soql+' select ';

soql=soql+String.join(fields, ',');

System.debug('checking'+soql);

soql=soql+' from Account where id=:integrationtransactionid';

System.debug('soqq'+soql);

IT=database.query(soql);

System.debug('itt'+IT);

String ack=IT.Request__c;

System.debug('acksss--'+ack);

 
18 réponses
  1. 17 oct. 2019, 10:00
    Hi Simmy,

    I understand your problem and I have gone through this also. The same code I tried in my org and I found its working fine in my org.Although this problem is not a org problem.This is syntax error.Please try my code once also that is given below.

    public class testJoin {

        public static void test(){

        Account IT = new Account();

        String integrationtransactionId= '0016F00001y5mQW';

        List<String> fields = new List<String>(Account.SObjectType.getDescribe().fields.getMap().keySet());

        String soql='';

        soql=soql+' select ';

        soql=soql+String.join(fields, ',');

        System.debug('-->'+soql);

        soql=soql+' from Account where id=:integrationtransactionid';

        System.debug('-->'+soql);

        IT=database.query(soql);

        System.debug('itt'+IT);

       // String ack=IT.Request__c;         //I did comment this because this field is not exist in Account obj in my                                              org.

       // System.debug('acksss--'+ack);

        }

    }

    I am sharing two snaps of code and its output also for you better help.

    Hi Simmy,I understand your problem and I have gone through this also. The same code I tried in my org and I found its working fine in my org.Although this problem is not a org problem.

    User-added image

    I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

    Thanks and Regards,

    Ajay Dubedi

    www.ajaydubedi.com