• Avinash Vellala
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
I am trying to write an Apex class that could be run on a schedule. The aim is to iterate through objects and identify NULLs on a particular field and populate that field. So far I've written the below code but it is throwing the "Error: Compile Error: Variable does not exist: Auto_ID__c at line 16 column 56"
 
public class fixPersistentID {


List<String> objs = new List<String>{'ICP__c','Invoice_Number__c'};

        void populate_NULL_PID(){
        
                for(String s : objs){
                
                   String query = 'Select Auto_ID__c FROM '+ s +' WHERE Persistent_ID__c = null';
                   
                   List <sObject> sObj = database.query(query);
                   
                       for(sObject x : sObj){

                                x.Persistent_ID__c = x.Auto_ID__c;

                     }
                     
                   update x;
                
                
                }
                
               
        }


}



 

Hi all,
After much struggle I had to resort to posting this question in the community. 
This is related to Conga  and I am trying to run a VF page from a List View button in Lightning Experience. Below is the code for Controller, VF Page and the button.

Controller

/**
* @description Builds list of sObject Ids from recordSetVar and constructs the Conductor URL
*/
public class GenericConductorFromListViewController {

    

  private String urlFieldName;
  private String partnerServerUrl;
  private ApexPages.StandardSetController controller;
  private List<Id> recordIds = new List<Id>();
  

  public GenericConductorFromListViewController(ApexPages.StandardSetController controller) {
    this.controller = controller;
    this.urlFieldName = ApexPages.currentPage().getParameters().get('paramURL');
    for (sObject sObj : controller.getSelected()){
      recordIds.add(sObj.Id);
    }
    partnerServerUrl = 'https://'+ApexPages.currentPage().getHeaders().get('Host')+'/services/Soap/u/26.0/'+UserInfo.getOrganizationId();
  } 

  public PageReference prepareConductorUrl() {
    PageReference conductorUrl = new PageReference('https://conductor.congamerge.com?');
    conductorUrl.getParameters().put('MOID', String.join(new List<Id>(recordIds),','));
    conductorUrl.getParameters().put('SessionId',  UserInfo.getSessionID());
    conductorUrl.getParameters().put('ServerUrl',  partnerServerUrl);
    conductorUrl.getParameters().put('UrlFieldName',  urlFieldName);

    return conductorUrl;
  }
}
 

 VF Page
 

<apex:page standardController="Invoice_Number__c" extensions="GenericConductorFromListViewController" recordSetVar="records" >
</apex:page>


Button (Type- List Button ,Display Checkboxes ticked, Contenct Source- URL, Behavior - Display in existing window with sidebar)

/apex/GenericCongaConductorListViewButton?paramURL=Generate_Invoice_URL__c
I am trying to pass a parameter to the Controller's constructor. When I select the button with a record selected, it goes to a blank page and is stuck there. I am not familiar with Apex nor Visualforce and I got to this point scraping knowledge here and there and I am unable go further. Any help is appreciated.

Thanks
Hi I am trying to Update the RecordType using a javascript button. The script is throwing an error whenever I press the button. Below is my code.

 
{!REQUIRESCRIPT("/soap/ajax/40.0/connection.js")} 

var ICJ = new sforce.SObject("ICP_Contract_Join__c"); 

ICJ.id = '{!ICP_Contract_Join__c.Id}'; 

var BussinessRT = '0126E0000000Kk7'; 
var DevRT = '0126E0000000KkC'; 

IF ( ICJ.RecordType == BusinessRT ) 
{ 
ICJ.RecordType = DevRT ; 

} 

else 
{ 
icjObj.RecordType = BusinessRT ; 

} 

sforce.connection.update([icjObj]);

Thanks,
Avinash
I am getting the below error whenever I click on the Inbound Change set.

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using salesforce.com! 

Error ID: 529623232-731 (-2010398762)


I reuploaded the changeset few times, also recreated it. Basically it has bunch of page layouts that im trying to get across from one Sandbox to another Sandbox.This is only happening with a particular change set. What is going wrong here?

Thanks ,
Avinash

Hi guys,

I am new to Apex and APIs. I am trying to retrieve Create Date and Modified date of all fields of a custom object. I have already tried the below

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_describe.htm

When I paste the below API request in the browser
https://xxxx.salesforce.com/services/data/v20.0/sobjects/Account/describe/ -H "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxx"
I get an error saying "This XML file does not appear to have any style information associated with it. The document tree is shown below.
<errorCode>INVALID_SESSION_ID</errorCode>
<message>Session expired or invalid</message>
"
Does this work for custom objects? Can someone point full material for this (how to include additional parameters in the API request etc)

 

Hi I am trying to Update the RecordType using a javascript button. The script is throwing an error whenever I press the button. Below is my code.

 
{!REQUIRESCRIPT("/soap/ajax/40.0/connection.js")} 

var ICJ = new sforce.SObject("ICP_Contract_Join__c"); 

ICJ.id = '{!ICP_Contract_Join__c.Id}'; 

var BussinessRT = '0126E0000000Kk7'; 
var DevRT = '0126E0000000KkC'; 

IF ( ICJ.RecordType == BusinessRT ) 
{ 
ICJ.RecordType = DevRT ; 

} 

else 
{ 
icjObj.RecordType = BusinessRT ; 

} 

sforce.connection.update([icjObj]);

Thanks,
Avinash
I am getting the below error whenever I click on the Inbound Change set.

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using salesforce.com! 

Error ID: 529623232-731 (-2010398762)


I reuploaded the changeset few times, also recreated it. Basically it has bunch of page layouts that im trying to get across from one Sandbox to another Sandbox.This is only happening with a particular change set. What is going wrong here?

Thanks ,
Avinash

Hi guys,

I am new to Apex and APIs. I am trying to retrieve Create Date and Modified date of all fields of a custom object. I have already tried the below

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_describe.htm

When I paste the below API request in the browser
https://xxxx.salesforce.com/services/data/v20.0/sobjects/Account/describe/ -H "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxx"
I get an error saying "This XML file does not appear to have any style information associated with it. The document tree is shown below.
<errorCode>INVALID_SESSION_ID</errorCode>
<message>Session expired or invalid</message>
"
Does this work for custom objects? Can someone point full material for this (how to include additional parameters in the API request etc)