• Ankita Patel
  • NEWBIE
  • 10 Points
  • Member since 2016
  • Salesforce Developer
  • Confident Governance


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
I am working on Document Parsing / Content searching in salesforce but in salesforce, my documents are saved as an attachment.

Anyone, who worked on this kind of requirement please Help me out with this ?
while doing trailhead admin beginner challange getting below error

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Process failed. First exception on row 0; first error: ALREADY_IN_PROCESS, This record is currently in an approval process. A record can be in only one approval process at a time.: []

please help me out with this so i can complete my admin beginner trail.

Thanks in advance
I am working on Document Parsing / Content searching in salesforce but in salesforce, my documents are saved as an attachment.

Anyone, who worked on this kind of requirement please Help me out with this ?
I am on Step 6 and getting an error, does anyone have input on this. Thanks in advance!!

I chose the Opportunity Object to start my Process - when record is created or edited 

entry criteria {Opportunity}.StageName equals cancelled 

Immediate Actions 

Update Record - [Opportunity].Fullfillments_r 

Criteria for Updating 

Schedule Date Less than Reference [Opportunity.CreatedDate 
Status Equals Cancelled 

Set New fields

Adventure Package Cost reference [Opportunit].Amount 
 
I'm trying to get the step -2 and while running the supplied Apex Test, 
Getting below error 

ClassBeAwesome
Method NamehugYourMother
Pass/FailFail
Error MessageSystem.QueryException: List has no rows for assignment to SObject
Stack TraceClass.sb_security.BeAwesome.createUser: line 89, column 1
Class.sb_security.BeAwesome.setup: line 81, column 1


I have created the records owned by Samantha as mentioned and also created sharing rule for Project managers.
Can someone please help ?
 
Hi All,
We've just enabled the Middle Name and Suffix Fields feature and encountered the below issue.

SUMMERY : Just after enabling "Middle Name and Suffix Fields", Implementation of custom apex logic in a static method vs running similar code snippet separately in an anonymous apex gives different result;

Runing as a method : null pointer exception (no middleName field)
Runing as anonymous : works fine!

DESCRIPTION : Below code throws an error while trying to access the middle name field in a static method,
 
private static Map<String,String> compHistoryObjDevNameToFieldName; 
// this will hold field name to label in order to access as a cache
	/**
	 * Returns:   field label of the object
     * field label  name will  return  from  compHistoryObjDevNameToFieldName if the value 
     * is cached in compHistoryObjDevNameToFieldName map it will return the value directly
     * or if  the  value  does  not exsist the logic will  cache the  new value and return
     **/ 
    public static String getFieldLabel(Id objectId, String fieldName) {
        // prepare the key of the map ObjectId prefix+fieldname 
        String recordPrefix = objectId.getSobjectType().getDescribe().getKeyPrefix(); 
        String ObjDevNameKey = recordPrefix + fieldName;
        
        //1. initialse map
        //if the map is null initialize the instance
        if (compHistoryObjDevNameToFieldName == null) {
            compHistoryObjDevNameToFieldName = new Map<String,String>();
        }

        //if the key is not contains add the nmew field to the map
        if (!compHistoryObjDevNameToFieldName.containsKey(ObjDevNameKey)) {
			Schema.DescribeSobjectResult objDesc = objectId.getSobjectType().getDescribe();
			compHistoryObjDevNameToFieldName.put(ObjDevNameKey, 
                                    objDesc.fields.getMap().get(fieldName).getDescribe().getLabel());
        }

        // return the field label
        return compHistoryObjDevNameToFieldName.get(ObjDevNameKey);
    }

However while debugging this issue, we found that if we access the fields.getMap() directly in an
anonymous execution, this gives the expected result.


Please refer the code executed in an anonymous window;
 
//Id objectId = '0011900000ApDykAAF'; // Person Account
//Id objectId = '0011900000BvwU6'; // Organisation
Id objectId = '0031900000AvXtg'; // Contact

// Accessing the method which contains the similar logic
try{
    // System.NullPointerException: Attempt to de-reference a null object at this point
    system.debug('Result::' + LibUtil.getFieldLabel(objectId, 'MiddleName'));
} catch(Exception e) {
    system.debug('Exception::' + e);
}

// implementing the similar logic(same set of code contains inside the method 
// LibUtil.getFieldLabel()) in anonymous window
Schema.DescribeSobjectResult objDesc = objectId.getSobjectType().getDescribe();
Map<String,Schema.SObjectField> fieldMapForLabel = objDesc.fields.getMap();
for(String key : fieldMapForLabel.keySet()){
    system.debug('DEBUG :: '+objDesc.fields.getMap().get(key));
}

Thanks in advance