• crikketlang
  • NEWBIE
  • 25 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 7
    Replies

I know these have been posted a million times and I'm sorry to post another one but I cant seem to wrap my head around where the loop is happening here. I know it's a bad idea to put the queries into the loop, but i dont feel the loop should even be looping on itself to cause the 101 error. 

I am posting the complete code for the trigger in hopes someone can point out the issue. As of now pretty much any batch update im doing is failing due to this little bugger. I know there is a better way to do this.

Any help is appreciated.

trigger relationshipHierarchyTrigger on Account (after update) {
  for(Account acct : Trigger.new){
    String recType = arupFunctions.getRecordTypeName(acct.recordtypeid);
    if( recType == 'Health System' || recType == 'Joint Venture' || recType == 'VISN' ){
          Account oldAcct = Trigger.oldMap.get(acct.ID);    
          Account newAcct = Trigger.newMap.get(acct.ID);
          
          //If the GPO has changed, change all the accounts that
          // are part of the health system to that GPO
          if(oldAcct.GPO_Primary__c != newAcct.GPO_Primary__c || oldAcct.Alliance__c != newAcct.Alliance__c){
        List<Account> accts = [SELECT a.Id, a.GPO_Primary__c, a.Name
                FROM Account a WHERE a.Health_System__c = :acct.ID];
        if(accts != null){
          for (Integer i = 0; i < accts.size(); i++){
            accts[i].GPO_Primary__c = acct.GPO_Primary__c;
            accts[i].Alliance__c = acct.Alliance__c;
          }
          update(accts);
        }
          }
    } else if( recType == 'Alliance' || recType == 'Group' ){
          Account oldAcct = Trigger.oldMap.get(acct.ID);    
          Account newAcct = Trigger.newMap.get(acct.ID);

          if(oldAcct.GPO_Primary__c != newAcct.GPO_Primary__c){
        List<Account> accts = [SELECT a.Id, a.GPO_Primary__c, a.Name
                FROM Account a WHERE a.Alliance__c = :acct.ID];
        if(accts != null){
          for (Integer i = 0; i < accts.size(); i++){
            accts[i].GPO_Primary__c = acct.GPO_Primary__c;
          }
          update(accts);
        }
          }
    }
  }    
}

 

I seem to be having an issue with the Encrypt or decrypt portion of the password process. From what i read on the return from command prompt, it knows the first two characters in my password and decrypts it properly ("Sh") but it seems to have a problem with something after this point??? Or i could be completely crazy...

 

Might anyone be able to shed some light? Did i encrypt wrong? Is it recquired to have a key file? If so, where am i supposed to place it?

 

Any help would be appreciated.

834 [main] FATAL com.salesforce.dataloader.process.ProcessRunner  - Unable to ru
n process UofUAccountExtractToCSV
java.lang.RuntimeException: com.salesforce.dataloader.exception.ParameterLoadExc
eption: Error loading parameter: sfdc.password of type: java.lang.String
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:136)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:74)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:226)
Caused by: com.salesforce.dataloader.exception.ParameterLoadException: Error loa
ding parameter: sfdc.password of type: java.lang.String
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:6
83)
        at com.salesforce.dataloader.config.Config.postLoad(Config.java:620)
        at com.salesforce.dataloader.config.Config.loadParameterOverrides(Config
.java:646)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:94)
        ... 2 more
Caused by: java.lang.NumberFormatException: For input string: "Sh"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
        at java.lang.Integer.parseInt(Integer.java:447)
        at java.lang.Integer.valueOf(Integer.java:526)
        at java.lang.Integer.decode(Integer.java:919)
        at com.salesforce.dataloader.security.EncryptionUtil.textToBytes(Encrypt
ionUtil.java:58)
        at com.salesforce.dataloader.security.EncryptionUtil.decryptString(Encry
ptionUtil.java:194)
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:6
68)

 process-conf.xml looks like this:

 

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>

    <bean id="UofUAccountExtractToCSV"
          class="com.salesforce.dataloader.process.ProcessRunner"
          singleton="false">
      <description>Gets the UofU accounts with clients and exports to CSV"</description>
        <property name="name" value="UofUAccountExtractToCSV"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.debugMessages" value="false"/>
                <entry key="sfdc.debugMessagesFile" value="c:\Salesforce\DataLoader\Resources\Logs\SFDCdebug.log"/>
                <entry key="sfdc.endpoint" value="https://login.salesforce.com"/>
                <entry key="sfdc.username" value="sfdcusername"/>
		<entry key="sfdc.password" value="value returned by encrypt.bat -e"/>
                <entry key="sfdc.timeoutSecs" value="600"/>
                <entry key="sfdc.loadBatchSize" value="200"/>
                <entry key="sfdc.entity" value="Client__c"/>
                <entry key="sfdc.extractionSOQL" value="SELECT c.LIS_Account_Name__c, c.Entity_Code__c,c.ClientID_Ext_Id__c, c.Phone_and_Extension__c, c.Secured_Fax__c, c.Comments__c,c.Street_Address__c, c.City__c, c.State__c, c.account__r.name from client__c c where c.account__r.recordtypeid ='012C0000000Q7lIIAS'"/>
                <entry key="process.operation" value="extract"/>
                <entry key="process.mappingFile" value="c:\Salesforce\DataLoader\Resources\Mapping\UofUAccountExtractMap.sdl"/>
                <entry key="process.outputError" value="c:\Salesforce\DataLoader\Resources\Logs\LastOperationError.csv"/>
    		<entry key="dataAccess.writeUTF8" value="true"/>            
		<entry key="dataAccess.type" value="csvWrite"/>
                <entry key="dataAccess.name" value="c:\Salesforce\DataLoader\Resources\Data\UofUSFDCExtract.csv"/>
            </map>
        </property>
    </bean>
</beans>

 

 

 

Ok so im back again with another question regarding autopopulating fields and am looking for some direction from others. We have a custom object called Requests that allows the user to select a type (page layout) and then launches a web form so to speak. At this point in time none of the requests are visualforce pages and are just all done native using page layout builders. The issue im running into now is that we have circumstances in some requests where we would like to have contact lookups, and then have other fields automatically populated with the corresponding fields of the selected contact(s) WITHOUT a formula. I know how to do autopopulating this way only by passing the values from the contact page to the end request through a url button but we cannot have a million buttons on the contact/account for every different request to do this. I belive there is a better way to do this.

 

Does anyone have any advice on the topic or would care to share how you guys do autopopulation to allow a lookup to populate fields and still leave them editable?

 

any help is much appreciated

So we have a visualforce page which has a standard Apex button which calls the native "Save" event. After the users save the "form" so to speak, they are taken to another page which is an overview of what they just did with the options to edit or submit (which triggers an email to an internal department)

 

 

Since our sales reps aren't the brightest bunch, they would like a "pop up" to remind them to submit after they have saved. So in actullity im just looking to attach a JavaScirpt listener to that button that when its clicked, the save event is still initiated but there is a pop up which just displays a message stating "Please do not forget to submit after saving". Its almost like a confirm popup but i dont know if i can attach an apex command to the confirmation.

 

 

Does anyone have any help or advice on this one? i can post a little bit of the Visualforce page if needed. Any help is appreciated.

 

Thanks,

Dan

I know these have been posted a million times and I'm sorry to post another one but I cant seem to wrap my head around where the loop is happening here. I know it's a bad idea to put the queries into the loop, but i dont feel the loop should even be looping on itself to cause the 101 error. 

I am posting the complete code for the trigger in hopes someone can point out the issue. As of now pretty much any batch update im doing is failing due to this little bugger. I know there is a better way to do this.

Any help is appreciated.

trigger relationshipHierarchyTrigger on Account (after update) {
  for(Account acct : Trigger.new){
    String recType = arupFunctions.getRecordTypeName(acct.recordtypeid);
    if( recType == 'Health System' || recType == 'Joint Venture' || recType == 'VISN' ){
          Account oldAcct = Trigger.oldMap.get(acct.ID);    
          Account newAcct = Trigger.newMap.get(acct.ID);
          
          //If the GPO has changed, change all the accounts that
          // are part of the health system to that GPO
          if(oldAcct.GPO_Primary__c != newAcct.GPO_Primary__c || oldAcct.Alliance__c != newAcct.Alliance__c){
        List<Account> accts = [SELECT a.Id, a.GPO_Primary__c, a.Name
                FROM Account a WHERE a.Health_System__c = :acct.ID];
        if(accts != null){
          for (Integer i = 0; i < accts.size(); i++){
            accts[i].GPO_Primary__c = acct.GPO_Primary__c;
            accts[i].Alliance__c = acct.Alliance__c;
          }
          update(accts);
        }
          }
    } else if( recType == 'Alliance' || recType == 'Group' ){
          Account oldAcct = Trigger.oldMap.get(acct.ID);    
          Account newAcct = Trigger.newMap.get(acct.ID);

          if(oldAcct.GPO_Primary__c != newAcct.GPO_Primary__c){
        List<Account> accts = [SELECT a.Id, a.GPO_Primary__c, a.Name
                FROM Account a WHERE a.Alliance__c = :acct.ID];
        if(accts != null){
          for (Integer i = 0; i < accts.size(); i++){
            accts[i].GPO_Primary__c = acct.GPO_Primary__c;
          }
          update(accts);
        }
          }
    }
  }    
}

 

Ok so im back again with another question regarding autopopulating fields and am looking for some direction from others. We have a custom object called Requests that allows the user to select a type (page layout) and then launches a web form so to speak. At this point in time none of the requests are visualforce pages and are just all done native using page layout builders. The issue im running into now is that we have circumstances in some requests where we would like to have contact lookups, and then have other fields automatically populated with the corresponding fields of the selected contact(s) WITHOUT a formula. I know how to do autopopulating this way only by passing the values from the contact page to the end request through a url button but we cannot have a million buttons on the contact/account for every different request to do this. I belive there is a better way to do this.

 

Does anyone have any advice on the topic or would care to share how you guys do autopopulation to allow a lookup to populate fields and still leave them editable?

 

any help is much appreciated

So we have a visualforce page which has a standard Apex button which calls the native "Save" event. After the users save the "form" so to speak, they are taken to another page which is an overview of what they just did with the options to edit or submit (which triggers an email to an internal department)

 

 

Since our sales reps aren't the brightest bunch, they would like a "pop up" to remind them to submit after they have saved. So in actullity im just looking to attach a JavaScirpt listener to that button that when its clicked, the save event is still initiated but there is a pop up which just displays a message stating "Please do not forget to submit after saving". Its almost like a confirm popup but i dont know if i can attach an apex command to the confirmation.

 

 

Does anyone have any help or advice on this one? i can post a little bit of the Visualforce page if needed. Any help is appreciated.

 

Thanks,

Dan