• Guilherme Oliveira
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Greetings,

I am trying to configure Salesforce for Outlook plugin on my sandbox environment, but keep getting an error (can't connect to test.salesforce.com. Verify the URL and connection and try again). I've tried changing credentials, rolling back to old versions of the plugin, changing the URL to my sandbox instance (cs50.salesforce.com), among other suggestions from the community, but nothing seems to work.

Also, I can login to my DE normally, and configure it as expected. The problem is exclusive to my sandbox, and other people on my team have faced the same problem. 

Any ideas as to what the problem might be? Any help would be greatly appreciated.

Regards,
Guilherme
Hey all, I'm a pretty inexperienced Apex dev and was wondering about some best practices for looping through all object fields for their helptext metadata.

Our business case requires us to have more than 20 Lookups on a record.  Each of these lookups has their own set of fields on the record that pull in data from the lookup (Can't use formulas, otherwise cross object reference limit gets too high).  To mark which fields to put data in from the lookup, I added a search string in the help text "<<CODR" (I would put it in the description but you can't access description metadata?).  My apex class currently loops through all the object's fields and searches for the ones with the code string.  Once it grabs all of the strings, it performs the necessary steps to put in the data from the respective lookup into the field.

My biggest issue is scaling.  Our object has ~600 fields and this process takes a lot of CPU time (On average, around 75% before CPU Limit!).  I have this class activated on a before update trigger, which fires off anytime a user saves a record.  It's very slow and highly inefficient.

The data needs to be filled in only when
A. A specified Lookup is changed
B. A specified field is changed

Below is the method that is called when trigger is fired.  Every time the record is updated, this method loops through the entire object's field list.  I feel that if there was a way to only search on the criteria above, I would be able to cut down the CPU time by a large factor.  I don't know enough about Apex to figure it out though. 
-Search only lookups first, see if they're changed?
-Search only fields w/ <<CODR in helptext, see if they're changed?

Any advice?  If you need any additional information, please ask!  Thanks a ton!
 
/**
	*To be used with trigger
	*
	*/
	public void populateFieldsTrigger(Proposal__c p) {
		/*This loop goes through all fields and sees if the field is a CODR field 
		If the field is a CODR field, it gets sent to the fieldDataSorting method
		*/
		/*
		Sample search string format
		<<CODR,LookupSource,FieldSource,FieldTarget>>
		*/
		
		//Loop through all fields
		for(String key : fieldsMap.keySet()){
			String fieldName = fieldsMap.get(key).getDescribe().getLabel();
			//See if field has inlinehelptext to pull
			try{
				String fieldHelpText = fieldsMap.get(key).getDescribe().getInlineHelpText();
				//If field inlinehelptext has "CODR" in string, get substr numbers to split string
				if (fieldHelpText.contains(codeName)){
					Integer codeIndexStart = fieldHelpText.indexOf(codeName)+2;
					Integer codeIndexEnd = fieldHelpText.indexOf('>>');
					String codeStrOnly = fieldHelpText.substring(codeIndexStart,codeIndexEnd);
					//isProperCode checks string to make sure it's a valid format
					if(isProperCode(codeStrOnly)){
						fieldDataSorting(codeStrOnly, p);
					}
				}
			}
			catch (Exception e){
				//System.debug(e);
			}
		}
		//Once all fields are set up, call SOQL query to retrieve data and place it in targetFields
		queryLU(p);	
	}

 

Hello everyone,

Is there a way to get all the values from an aura:iteration element? Both output and input value? I have the following code in my component and I would like to get all the values in the inputNumber field, the {!subset} value and match them together.

<aura:iteration items="{!v.spaceSubsets}" var="subset">
      <p>{!subset}  <ui:inputNumber aura:id="detailRating" label='Rating'/></p>
</aura:iteration>

The end goal here would be to click on a button and have the component insert multiple records into the database.

Bonus point if you could help me figure out how to only create record when a value is entered for one of the iteration.

 

Thank you all.

It appears that if a user sets the IsPrivate field to true on an Opportunity record, all workflows are bypassed when saving the record.  I can't find any help text for this field and my best guess is that it would have something to do with a sharing model.  I would NOT have guessed that it bypasses workflow rules as that seems like a great way to get bad data into your org.  What other magic is tied to this field?