• sai dhana
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
HI,

can anyone plz help me out of this urgent requirement..

My requirement is updating the other records priority on priority field when we change any one of priority in the record in inline VF page using triggers(before/after update).

i have a custom custom object  called Deal__C on that  Global_priority__c is picklist fied contains 1-15 integer values. while creating the record user can select priority for the particular record or can update the priority in inline vf page also. when user updates the priority like user is updating his record priority "5" to "10" then 5 becomes 10 and 10 will become 9,9 becomes 8,8 becomes 7,7 becomes 6, 6 becomes 5. means between 5-10 values should be updated like this.(when we cahangin 5-10 , 5 to 10,then from 10 onwards should decrese -1 upto 6 ) we can have deplicate values also. and also if we change 9 th priorty to 4, 9 becomes 4, 4 becomes 5,5 becomes 6,6 becomes 7,7 becomes 8,8 becomes 9 means need to update values between 9-4. here we need to add +1 from 4 upto 8.

here is my sample code. its updating only one value but not other values.

if(trigger.isBefore && trigger.isUpdate){
        
        
        for(Deal__c dl : trigger.new){
            for(integer i = 0 ; i < DList.size();i++){
            if(dl.Global_Priority__c!=null && dl.Global_Priority__c < DList[i].Global_Priority__c){
            
            System.debug('=====fistif======>'+dl.Global_Priority__c);
               DList[i].Global_Priority__c = string.valueof(integer.valueof(dl.Global_Priority__c));
                DList[i].Global_Priority__c = string.valueof(integer.valueof(dl.Global_Priority__c + 1));
                 
             
                
        }
        }
        }   
        } 


Plz share the sample code for my requrement. this is very urget requrement.


Thanks In Advance
sai.
Hi i have a very urgent requirement. need to write trigger on cusom obj Delta_sceme__C:

on that obj we have two custom picklist fields(Priority1, Priority 2) with integer values start from 1 to 25.
now the requiremet is to give the priority for each and every record on that object. plz look below one.

User-added image
suppose the priority of the records like

        Old     new
         1       1
         2         9
         3       2
         4         3        
         5         4    
         6       5
         7       6
         8       7
         9       8
         10     10 
    Here i want to chage(Old) 2nd priority to 9(check in new) then the new priority should decrease from 9th rec should decrease the 8, from 8 to 7 .... and vice versa. 


Like when we update priority of one record remaining records priority need to be updated. and priority should be unique.


plz share any code samples and ur suggestions ASAP




Thanks in Advance

 
 
The challenge as follows:

For purposes of local regulation new customers must be approved by the legal team.

When an Account has the value of 'Prospect' in the Type field, a user will click the 'Submit for Approval' button to launch an approval process. The process will only happen if Type is 'Prospect' and there are more than 500 employees. Upon entry of the process, Type will become 'Pending' and be locked. If approved, Type will be set to 'Customer' and be unlocked. If not approved, Type will be set back to 'Prospect' and will be unlocked.

The Account object's Type field must have the following picklist values: Prospect, Customer, Pending. Before creating the approval process, verify the values in your Account object setup
The approval process name must be 'Approve New Account'.
When user click 'Submit for Approval', the approval must be processed if the Type field is set to 'Prospect' and the value of Employees is greater than 500.
Upon entering the approval process, set the Type field to 'Pending' and lock the record.
Normally the approver would be someone else. In this instance, assign yourself to be the approver.
If approved, set the Type field to 'Customer' and unlock the record.
If not approved, set the Type field back to 'Prospect', and unlock the record.

I am getting error message: 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: REQUIRED_FIELD_MISSING, missing required field: [nextApproverIds]: [nextApproverIds]

This are the steps I did:

Created approval process called Approve New Account
Criteria Account Type field equals Prospect and Account Employees field greater than 500
Final Approval Actions - Update Type field to Customer
Final Rejection Actions - Update Type field to Prospect

What am I missing that I received the error message?  Please help.

Thanks.

Hi,

 I am new in Salesforce...I want to design a pop up window. The window will appear after save button is hit which will show the values those an user has entered as input. After the pop up comes out then the user will click the ok in pop up and the page will be redirected to the object view page.

 

Now how can I implement it throgh java script or any other possible way.

Can u pls provide some sample coding for it.

 

Thanks in advance,

  • September 28, 2011
  • Like
  • 0