Modification to Services to process Datetime and add error toast

This commit is contained in:
Christopher Gary committed 2021-04-14 21:46:10 -04:00
1 parent a33604b498
commit 26423a7f33
5 files changed
+77 -28

No files matched your search

@@ -32,7 +32,7 @@ public with sharing class OpportunityCloneService {
for(Schema.ChildRelationship childRel:childRelationshipList) {
if(String.isNotBlank(childRel.getRelationshipName())){
Schema.DescribeSObjectResult childObjRes = childRel.getChildSObject().getDescribe();
if(!restrictedRelationshipList.isEmpty()){
if(!restrictedRelationshipList.isEmpty() && restrictedRelationshipList[0] != 'N/A'){
if(restrictedRelationshipList.contains(childObjRes.getName())){
opportunityChildrenMap.put(childRel.getRelationshipName(),childObjRes);
}
@@ -207,7 +207,7 @@ public with sharing class OpportunityCloneService {
returnObj = Date.valueOf(fieldValue);
}
when DATETIME {
returnObj = Datetime.parse(fieldValue);
returnObj = Datetime.valueOf(fieldValue);
}
when ID {
returnObj = Id.valueOf(fieldValue);