• SFDC Developer1
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 1
    Replies
I am trying to insert data through datra loader command line to production.I am getting above mentioned error for invalid object type.I am able to insert data in UAT with same XML but in production it is giving me invalid obj error.I have checked all the object access,permissions etc.Can you please help as I have my important deployment.


<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="InsertProcess"
          class="com.salesforce.dataloader.process.ProcessRunner"
          singleton="false">
        <property name="name" value="InsertProcess"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.endpoint" value="https://dsas.my.salesforce.com/"/>
<entry key="process.encryptionKeyFile" value="C:\Users\.dataloader\dataLoader.key"/>
                <entry key="sfdc.username" value="test@nj.us.uat"/>
                
                <entry key="sfdc.password" value="34569a1ebd537ba14b0030b573fe1930747eaeb4660c71382270b44b2f78c2f6d5121441977a2b25bdf02dac52636651d09de867fd5ffa2885c2a81edf61d4cc"/>                
                <entry key="sfdc.timeoutSecs" value="600"/>
                <entry key="sfdc.loadBatchSize" value="1000"/>                
                <entry key="sfdc.entity" value="Import_Data__c"/>
                <entry key="process.operation" value="insert"/>
                <entry key="process.mappingFile" value="C:\Users\nsangle\.dataloader\UpdateMap.sdl"/>
                <entry key="dataAccess.name" value="C:\Users\nsangle\.dataloader\Data.csv"/>
                <entry key="dataAccess.type" value="csvRead"/>
                <entry key="process.initialLastRunDate" value="2006-12-01T00:00:00.000-0800"/>
<entry key="process.enableExtractStatusOutput" value="true" />
            </map>
        </property>
    </bean>
</beans>
I have two object temp__c and NFSave___c. I am dumping all the data in temp object through data loader in rich text area field(Section__c).then i am sending the data with apex class from Section field to NFSave object fields as per the column position.I am not able to perform upsert as duplicate records are adding in NFSave object.I have mark SSN__c field from NFSave object as external id.Please help as i am stuck here from so long.


global class NJImport implements Database.Batchable<sObject>{
    
global Database.QueryLocator start(Database.BatchableContext BC) {

String query = 'select Section__c from temp__c';

return Database.getQueryLocator(query);

}


global void execute(Database.BatchableContext BC, List<temp__c> accList){

     String textImportSection;

    
     List< NFSave___c > list = new List< NFSave___c>();
     for(NFSave___c Import : accList){
         
     textImportSection =  Import.Section__c;
     if(textImportSection !=null && textImportSection !=''){
     NFSave___c Obj = new NFSave___c();
     Obj.PAAD_SSN__c = textImportSection.mid(0,9);
     list.add(Obj); 
    }
}

upsert list;

}
I have one custom object abc__c which has one text field number__c and i have another object temp__c which have one picklist field.

I want to check if the value of number__c field from first object present in temp__c picklist field of second object.

I am using getDescribe() but I am not able to do the comparison.
If the value is present, I want to perform few actions and if not present then I want to perform another action. Kindly help as i am new to the development.
Hi All,
I am using data loader through command line to connect to salesforce.It was working fine until friday evening but today when I tried to login I am geting error as Failed to get next element(only whitespace content allowed before start tag and not T (position: START_DOCUMENT seen T... @1:1))
I have not changed my password from so many days and my data loader and org version is same i.e 49
Kindly help!!
Requirement - I want my image to get download or open after clicking on link and I have 2 additional column in my table which should get updated with name of person who click on the image and time.For the two column to get update I have method in my controller which get called after clicking on the image.

Problem facing - with outputlink I am able to open/download image but it is not passing value to controller hence my two column on my VF page is not updating.

Outputlink
apex:outputlink target="_BLANK"
value="/servlet/servlet.FileDownload?file={!AttachVar.attachmentID}"  {!AttachVar.attachmentName}

<apex:actionSupport event="oncomplete" action="{!DORESupdateHistory1}">
<apex:param value="{!AttachVar.attachmentID}" name="DORESSelectedId1" assignTo="{!DORESSelectedId1}"/>
</apex:actionSupport>

</apex:outputlink >

with commandLink, It is passing value to my controller and my columns on vf page is also updating but I am not able to open/download image.
<apex:commandLink action="{!DORESupdateHistory1}"
value="{!AttachVar.attachmentName}" >
<apex:param value="{!AttachVar.attachmentID}" name="DORESupdateHistory1" assignTo="{!DORESSelectedId1}"/>
</apex:commandLink>




Controller method

public String DORESSelectedId1{get;set;}

    public PageReference DORESupdateHistory1(){
        system.debug('--DORESSelectedId1---' + DORESSelectedId1);
        system.debug('--DORESSelectedId1---' + SelectedAttachmentId);
        List<Profile> Profile= [Select Name from Profile where Id =:UserInfo.getProfileId() LIMIT 1];
        list<attachment> relatedPaadAttachment = [select ID,parentID,name from attachment where ID=:DORESSelectedId1 limit 1];
        system.debug('--DORESSelectedId1---' + DORESSelectedId1);
        List<PAAD_Application_Attachment__c> ClickedAttachList1 = [Select id,Name,Type__c,CreatedDate,PAAD_Applicant__r.Name,Dores_Viewer_Name__c,Dores_Viewed_Time__c,Dores_Viewing_Status__c from PAAD_Application_Attachment__c where id = :relatedPaadAttachment[0].parentID]; //To get the clicked attachment Id
        if(ClickedAttachList1[0].Dores_Viewing_Status__c == 'Not Viewed'){
            ClickedAttachList1[0].Dores_Viewing_Status__c = 'Viewed';
            ClickedAttachList1[0].Dores_Viewed_Time__c = system.now();
            ClickedAttachList1[0].Dores_Viewer_Name__c = UserInfo.getName();
            update ClickedAttachList1;
            List<PAAD_Application_Attachment__c> viewedattach1= [SELECT Id,Dores_Viewing_Status__c FROM PAAD_Application_Attachment__c where Dores_Viewing_Status__c != 'Viewed' and PAAD_Applicant__c=:app.ID];
            List<PAAD_Application_Attachment__c> attach1 = [SELECT Id FROM PAAD_Application_Attachment__c where PAAD_Applicant__c=:app.ID];
           if(viewedattach1.size() == attach1.size()){
               List<PAAD_Applicant__c> attachcheck1= [SELECT Id,New_Dores_Attachment_Checker__c FROM PAAD_Applicant__c where ID=:app.ID];
               if(attachcheck1[0].New_Dores_Attachment_Checker__c == 'Y') {
                   attachcheck1[0].New_Dores_Attachment_Checker__c = '';
                   update attachcheck1;
               } 
           }
           List<AttachmentWrapper>  dummyWrapperList = new List<AttachmentWrapper>(); 
           for(AttachmentWrapper wrap : DORESAttachmentsWrapperList){
               if(DORESSelectedId1 !=  wrap.attachmentID){
                   dummyWrapperList.add(wrap);
               }else{
                   dummyWrapperList.add(new AttachmentWrapper(ClickedAttachList1[0].Type__c,ClickedAttachList1[0].Member__c,ClickedAttachList1[0].Description_Final__c, relatedPaadAttachment[0].ID,relatedPaadAttachment[0].name, ClickedAttachList1[0].CreatedDate,'Attached', ClickedAttachList1[0].Dores_Viewed_Time__c, ClickedAttachList1[0].Dores_Viewer_Name__c, ClickedAttachList1[0].Dores_Viewing_Status__c));    
               }
           }
           DORESAttachmentsWrapperList.clear();
           DORESAttachmentsWrapperList.addAll(dummyWrapperList);
        }  
        return null;
    }


I am able to achieve 50%-50% from each of the functionality. Is there any way to combine both the functionality like downloading image and calling method in the controller.

 
Requirement - I want my image to get download or open after clicking on link and I have 2 additional column in my table which should get updated with name of person who click on the image and time.For the two column to get update I have method in my controller which get called after clicking on the image.
Problem facing - with outputlink I am able to open/download image but it is not passing value to controller hence my two column on my VF page is not updating.
with commandLink, It is passing value to my controller and my columns on vf page is also updating but I am not able to open/download image.
I am able to achieve 50%-50% from each of the functionality. Is there any way to combine both the functionality like downloading image and calling method in the controller.
Outputlink
apex:outputlink target="_BLANK"
value="/servlet/servlet.FileDownload?file={!AttachVar.attachmentID}"  {!AttachVar.attachmentName}

<apex:actionSupport event="oncomplete" action="{!DORESupdateHistory1}">
<apex:param value="{!AttachVar.attachmentID}" name="DORESSelectedId1" assignTo="{!DORESSelectedId1}"/>
</apex:actionSupport>

</apex:outputlink >

with commandLink, It is passing value to my controller and my columns on vf page is also updating but I am not able to open/download image.
<apex:commandLink action="{!DORESupdateHistory1}"
value="{!AttachVar.attachmentName}" >
<apex:param value="{!AttachVar.attachmentID}" name="DORESupdateHistory1" assignTo="{!DORESSelectedId1}"/>
</apex:commandLink>

Controller method

public String DORESSelectedId1{get;set;}

    public PageReference DORESupdateHistory1(){
        system.debug('--DORESSelectedId1---' + DORESSelectedId1);
        system.debug('--DORESSelectedId1---' + SelectedAttachmentId);
        List<Profile> Profile= [Select Name from Profile where Id =:UserInfo.getProfileId() LIMIT 1];
        list<attachment> relatedPaadAttachment = [select ID,parentID,name from attachment where ID=:DORESSelectedId1 limit 1];
        system.debug('--DORESSelectedId1---' + DORESSelectedId1);
        List<PAAD_Application_Attachment__c> ClickedAttachList1 = [Select id,Name,Type__c,CreatedDate,PAAD_Applicant__r.Name,Dores_Viewer_Name__c,Dores_Viewed_Time__c,Dores_Viewing_Status__c from PAAD_Application_Attachment__c where id = :relatedPaadAttachment[0].parentID]; //To get the clicked attachment Id
        if(ClickedAttachList1[0].Dores_Viewing_Status__c == 'Not Viewed'){
            ClickedAttachList1[0].Dores_Viewing_Status__c = 'Viewed';
            ClickedAttachList1[0].Dores_Viewed_Time__c = system.now();
            ClickedAttachList1[0].Dores_Viewer_Name__c = UserInfo.getName();
            update ClickedAttachList1;
            List<PAAD_Application_Attachment__c> viewedattach1= [SELECT Id,Dores_Viewing_Status__c FROM PAAD_Application_Attachment__c where Dores_Viewing_Status__c != 'Viewed' and PAAD_Applicant__c=:app.ID];
            List<PAAD_Application_Attachment__c> attach1 = [SELECT Id FROM PAAD_Application_Attachment__c where PAAD_Applicant__c=:app.ID];
           if(viewedattach1.size() == attach1.size()){
               List<PAAD_Applicant__c> attachcheck1= [SELECT Id,New_Dores_Attachment_Checker__c FROM PAAD_Applicant__c where ID=:app.ID];
               if(attachcheck1[0].New_Dores_Attachment_Checker__c == 'Y') {
                   attachcheck1[0].New_Dores_Attachment_Checker__c = '';
                   update attachcheck1;
               } 
           }
           List<AttachmentWrapper>  dummyWrapperList = new List<AttachmentWrapper>(); 
           for(AttachmentWrapper wrap : DORESAttachmentsWrapperList){
               if(DORESSelectedId1 !=  wrap.attachmentID){
                   dummyWrapperList.add(wrap);
               }else{
                   dummyWrapperList.add(new AttachmentWrapper(ClickedAttachList1[0].Type__c,ClickedAttachList1[0].Member__c,ClickedAttachList1[0].Description_Final__c, relatedPaadAttachment[0].ID,relatedPaadAttachment[0].name, ClickedAttachList1[0].CreatedDate,'Attached', ClickedAttachList1[0].Dores_Viewed_Time__c, ClickedAttachList1[0].Dores_Viewer_Name__c, ClickedAttachList1[0].Dores_Viewing_Status__c));    
               }
           }
           DORESAttachmentsWrapperList.clear();
           DORESAttachmentsWrapperList.addAll(dummyWrapperList);
        }  
        return null;
    }


 
I want to import images to a custom object using command line interface.I have a custom object so I want to add those images in attachment of that custom object.I have a process-conf file and mapping file ready and I am also giving parent id of my custom object in my csv file but still i am getting errors.If i try to do this using data loader with same mapping then all the images are adding successfully. Please help.

Process-config file

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans> 
    <bean id="InsertAttachmentProcess"
          class="com.salesforce.dataloader.process.ProcessRunner"
          singleton="false">
        <description>Insert process for images</description>
        <property name="name" value="InsertAttachmentProcess"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.endpoint" value="https://--nsalasDev.cs32.my.salesforce.com"/> 
                <entry key="process.encryptionKeyFile" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\dataLoader.key"/>
                <entry key="sfdc.username" value="test@abc.com"/>
                <!-- password below has been encrypted using key file, therefore it will not work without the key setting: process.encryptionKeyFile
                the password is not a valid encrypted value, please generate the real value using encrypt.bat utility -->
                <entry key="sfdc.password" value="9d41a00cca60d364b0960b9e8970c34a46a2d1d08992306082bd0d249d4e74122d6526e"/>                
                <entry key="sfdc.timeoutSecs" value="600"/>
                <entry key="sfdc.loadBatchSize" value="200"/>                
                <entry key="sfdc.entity" value="Attachment"/>
                <entry key="process.operation" value="insert"/>
                <entry key="process.mappingFile" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\Attachments.sdl"/>
                <entry key="dataAccess.name" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\ImportFile.csv"/>
                <entry key="dataAccess.type" value="csvRead"/>
                <entry key="process.initialLastRunDate" value="2006-12-01T00:00:00.000-0800"/>
                <entry key="process.enableExtractStatusOutput" value="true" />
                <entry key="process.outputSuccess" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\InsertSuccess.csv"/>
                <entry key="process.outputError" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\InsertError.csv"/>
            </map>
        </property>
    </bean>
</beans>

Mapping file-

Parent ID=ParentId
Name=Name
Path=Body
Description=Description

Error I am getting-

Mapping for field Parent ID will be ignored since destination column is empty

Error message:Required fields are missing: [ParentId]
I want to import images to a custom object using command line interface.I have a custom object so I want to add those images in attachment of that custom object.I have a process-conf file and mapping file ready and I am also giving parent id of my custom object in my csv file but still i am getting errors.If i try to do this using data loader with same mapping then all the images are adding successfully. Please help.

Process-config file 
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans> 
    <bean id="InsertAttachmentProcess"
          class="com.salesforce.dataloader.process.ProcessRunner"
          singleton="false">
        <description>Insert process for images</description>
        <property name="name" value="InsertAttachmentProcess"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.endpoint" value="https://--nsalasDev.cs32.my.salesforce.com"/> 
                <entry key="process.encryptionKeyFile" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\dataLoader.key"/>
                <entry key="sfdc.username" value="test@abc.com"/>
                <!-- password below has been encrypted using key file, therefore it will not work without the key setting: process.encryptionKeyFile
                the password is not a valid encrypted value, please generate the real value using encrypt.bat utility -->
                <entry key="sfdc.password" value="9d41a00cca60d364b0960b9e8970c34a46a2d1d08992306082bd0d249d4e74122d6526e"/>                
                <entry key="sfdc.timeoutSecs" value="600"/>
                <entry key="sfdc.loadBatchSize" value="200"/>                
                <entry key="sfdc.entity" value="Attachment"/>
                <entry key="process.operation" value="insert"/>
                <entry key="process.mappingFile" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\Attachments.sdl"/>
                <entry key="dataAccess.name" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\ImportFile.csv"/>
                <entry key="dataAccess.type" value="csvRead"/>
                <entry key="process.initialLastRunDate" value="2006-12-01T00:00:00.000-0800"/>
                <entry key="process.enableExtractStatusOutput" value="true" />
                <entry key="process.outputSuccess" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\InsertSuccess.csv"/>
                <entry key="process.outputError" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\InsertError.csv"/>
            </map>
        </property>
    </bean>
</beans>

Mapping file-

Parent ID=ParentId
Name=Name
Path=Body
Description=Description

Error I am getting-

Mapping for field Parent ID will be ignored since destination column is empty

Error message:Required fields are missing: [ParentId]
I have one custom object abc__c which has one text field number__c and i have another object temp__c which have one picklist field.

I want to check if the value of number__c field from first object present in temp__c picklist field of second object.

I am using getDescribe() but I am not able to do the comparison.
If the value is present, I want to perform few actions and if not present then I want to perform another action. Kindly help as i am new to the development.