• Himanshu Jasuja 9
  • NEWBIE
  • 40 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 15
    Replies
There is a lookup of opportunity on custom object 'Job Order' and I have process builder on job order as below:-

I choose Criteria for updating records [![enter image description here][1]][1]- No criteria—just update the records

joborder.Public_Description__c   formula   opportunity.Description.

When i insert job order in test class following error occurs 
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30140000000TTVx. Contact your administrator for help.


I know this error coming from process builder because i am not able to satisfy process builder conditions in my test class

Here is my test class code and process builder screenshot.

@isTest
  Public class test_updatePrimaryRecuriter{
        static testMethod void validate(){
        
          Profile p = [SELECT Id FROM Profile WHERE Name='Standard User']; 
          User u = new User(Alias = 'standt', Email='testporder@testorg.com', 
          EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
          LocaleSidKey='en_US', ProfileId = p.Id, 
          TimeZoneSidKey='America/Los_Angeles', UserName='testporder1@testorg.com');

          System.runAs(u){
         // The following code runs as user 'u' 
          System.debug('Current User: ' + UserInfo.getUserName());
          System.debug('Current Profile: ' + UserInfo.getProfileId()); 
        }  
           Account acc = new Account();
           acc.Name = 'Test';
           insert acc;
           
           Opportunity op = new Opportunity();
           op.name = 'Test opportunity';
           op.StageName = 'Closed Lost';
           op.CloseDate = System.Today();
           op.Opportunity_Source__c = 'Conference';
           op.AccountId = acc.Id;
           op.Public_Description__c = 'test';
           op.Public_SkillSet__c='test';
           op.Description='test';
           insert op;
           system.debug('-----------------op'+op.Id);
           ts2__Job__c jobOrder = new ts2__Job__c();
           jobOrder.Name = 'Test';
           JobOrder.ts2__Status__c='Lost';
           jobOrder.ts2__Account__c = acc.Id;
           jobOrder.ts2__Recruiter__c = u.Id;
           
           jobOrder.Opportunity__c = op.Id;
           jobOrder.Public_Description__c = '';
           jobOrder.Public_SkillSet__c='';
           jobOrder.ts2__Job_Description__c='';
           jobOrder.OwnerId = u.Id;
           
           insert jobOrder;
          
        }
}

User-added image
<apex:page >
 <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"/>
     <div ng-app="myapp" ng-controller="mycntrl">
     <ul>
     <li ng-repeat="x in names">
         {{ x | myFormat}}
     </li>
     </ul>
     </div>
 
   <script>
   var myapp = angular.module('myapp', []);
   myapp.filter('myFormat',function(){
   return function(x){
       var i, c, txt = "";
       x=x.split("")
       for(i = 0;i <=x.length; i++){
           c= x[i];
           if(i % 2 == 0){
            c= c.toUpperCase();   
          } 
          txt += c;
        }
        return txt;
     };   
   });
     myapp.controller('mycntrl', function($scope) {
           $scope.names= [
        'Jani',
        'Carl',
        'Margareth',
        'Hege',
        'Joe',
        'Gustav',
        'Birgit',
        'Mary',
        'Kai'
        ];
});   
   </script>
   
   </apex:page>
 
I have a reuirement like i need to scan the barcode with i-pad and the related barcode comes in the input field in apex and then i will do further modifications based on this.ANY IDEAS?
Hi All,
I have a Requirement that i have to show account hierarchy in a VF page and its corresponding contacts in a hierarchy form like Accounts->Account1->Contact1,Contact2
Account2->Contact1,Contact2 like Role hierrachy means in a tree form but not finding exact solution that how can i get tree strcuture in a VF page of Accounts and Contacts.Could any one help me on this?
 
<apex:page >
 <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"/>
     <div ng-app="myapp" ng-controller="mycntrl">
     <ul>
     <li ng-repeat="x in names">
         {{ x | myFormat}}
     </li>
     </ul>
     </div>
 
   <script>
   var myapp = angular.module('myapp', []);
   myapp.filter('myFormat',function(){
   return function(x){
       var i, c, txt = "";
       x=x.split("")
       for(i = 0;i <=x.length; i++){
           c= x[i];
           if(i % 2 == 0){
            c= c.toUpperCase();   
          } 
          txt += c;
        }
        return txt;
     };   
   });
     myapp.controller('mycntrl', function($scope) {
           $scope.names= [
        'Jani',
        'Carl',
        'Margareth',
        'Hege',
        'Joe',
        'Gustav',
        'Birgit',
        'Mary',
        'Kai'
        ];
});   
   </script>
   
   </apex:page>
 
Hi.

Another post..
I need 2page block button,while working o one theotherhas to be disabled.. How to achieve this?
Please help.
Thanks, 
Sujan
Hi all,
How to createatabbed view in Visualforce page..Please help

Thanks in advance,
Sujan
Dear Team,

I need help to buid a SOql query.
I would like to retrieve some fields of opportunity and Contract object related to TargetObjectId :

SELECT TargetObjectid,(select actor.name from Workitems),
(SELECT StepStatus, Actor.Name FROM Steps),
(Select RecordType.Name, Status from Opportunities where Id in ProcessInstance.TargetObjectId)
​(Select RecordType.Name, Status from Contracts where Id in ProcessInstance.TargetObjectId)
FROM ProcessInstance where Status = 'Pending'

Unfortunatly it gives me an error : Unknown error parsing query
Can you help me to build this query properly?
Hi,

When a new record is inserted in an object, is the generated ID of the the new record guarenteed to be greater than a older record? 

Thanks!
I am not a developer.

I am trying to create a simple VF page which would be used with a Tab so that when you click the tab it takes you to the detail page of the Account.

I am Sys Admin and it is the Account object and I get . . . insufficient permission . . .and yes I have checked the permissions for the tab and the VF page and all seem to be okay hence I think the issue must be with the code

I used this:
<apex:page >
  <apex:enhancedList listID="00B4B000000PuG8" height="600"/>
</apex:page>

I even used
<apex:enhancedList type="Account" height="600"/>

 . . . this takes me to the listview but I want to go to the detail page of the account.

 
  • April 06, 2016
  • Like
  • 0