• ANJALIRAJI
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hi,

I need to update the document id to user object by matching document name and empolyeeNumber.

 

When I execute the below code, it should get the document id and update the same to the Signature_DocumentID__c by matching the document name and employeeNumber. This code is working for single operation. But not working for bulk operation. It’s crossing the SOQL query limitation.

 

Please give me some guidance to correct this problem.

 

List<Document> data=[select id,Name from Document where FOLDERID = '00lL0000000TB89'];
for (integer i=0;i<data.size();i++) { 
List<User> userdata = [select Signature_DocumentID__c from User where EmployeeNumber=:data[i].name ]; 
    if(userdata.size()>0) { 
        
            userdata[0].Signature_DocumentID__c = data[i].id; 
           update userdata;
}
}

Hi,

I am using picklist field ,by selecting its values some fields are hidden.The code is working fine.

But the problem is with the design.

The Code is:

Output Label = Incident Type

Object Name=Incident_Record__c

Field Name(picklist)=Incident_Type__c}"

 

 

<apex:outputLabel value="Incident Type" for="incident"  />
<apex:actionRegion >
<apex:inputField value="{!Incident_Record__c.Incident_Type__c}" style=""  required="true" id="incident" >
<apex:actionsupport event="onchange" rerender="sec1"/>
</apex:inputfield>
</apex:actionRegion>

 

 

The Output  is:

 

 

Here there is a huge space between Incident Type and the picklist.How to reduce this space ?

Hi,

I am using a picklist value in the input field based on its values some fields are hidden .

The code is working fine.But the problem is with the design.

The Code is:

Output Label = Incident Type

filed name(picklist)=Incident_Type__c

object name=Incident_Record__c

 

<apex:outputLabel value="Incident Type" for="incident"  />
<apex:actionRegion >
<apex:inputField value="{!Incident_Record__c.Incident_Type__c}" style=""  required="true" id="incident" >
<apex:actionsupport event="onchange" rerender="sec1"/>
</apex:inputfield>
</apex:actionRegion>

 

the output is like:

 

Here Between the label and picklist there is a huge space.How to remove these space?

 

 

 

The Trigger class is:

trigger FAAsettingCurrentLimit on Request__c(before update) {
    for( Request__cparent: Trigger.new)
    {
        if((parent.Request_Status__c=='Approved') && (Trigger.new[0].Request_Status__c != Trigger.old[0].Request_Status__c)){
            List<Limit__c> children = [ SELECT Id,Name,FAA_Request__c,Current_US_Dollar_Limit__c,Desired_US_Dollar_Limit__c from
            Limit__c where Request__c= :parent.Id];
        
            List<Limit__c> childrenToUpdate = new List<Limit__c>();
        
            for(Limit__c thischild: children )
            {
                thischild.Current_US_Dollar_Limit__c =thischild.Desired_US_Dollar_Limit__c  ;
           
                childrenToUpdate.add(thischild);
        
            }
            update childrenToUpdate;
        }
    }
}

There are two objects ,object 1-Request__c and object 2-Limit__c

 

The test class for this trigger class is

 

@isTest
private class FAACurrentLimitTest {

static testMethod void myUnitTest() {
Request__c[] faalist=[select id,Request_Status__c,Agent_Redelegate__c,Delegator_Approval_Status__c,
Delegator_Name__c,Delegator_Status_Date__c from Request__c limit 1];

Limit__c CategoryLimit=new Limit__c (Category__c = 'Treasury',
Desired_US_Dollar_Limit__c=100.00,Current_US_Dollar_Limit__c=120.00,Request__c=faalist[0].Id);
insert CategoryLimit;
Limit__c[] clist=[select id,Category__c ,Desired_US_Dollar_Limit__c,Current_US_Dollar_Limit__c,
Request__c where id=:CategoryLimit.id];
clist[0].Desired_US_Dollar_Limit__c=120.00;
update clist;


}
}

 

But its Showing error in (:CategoryLimit.id) and

if i remove that line the trigger name itself not displayed after running the  test class.

 

Hi,

I am using picklist field ,by selecting its values some fields are hidden.The code is working fine.

But the problem is with the design.

The Code is:

Output Label = Incident Type

Object Name=Incident_Record__c

Field Name(picklist)=Incident_Type__c}"

 

 

<apex:outputLabel value="Incident Type" for="incident"  />
<apex:actionRegion >
<apex:inputField value="{!Incident_Record__c.Incident_Type__c}" style=""  required="true" id="incident" >
<apex:actionsupport event="onchange" rerender="sec1"/>
</apex:inputfield>
</apex:actionRegion>

 

 

The Output  is:

 

 

Here there is a huge space between Incident Type and the picklist.How to reduce this space ?

Hi,

I am using a picklist value in the input field based on its values some fields are hidden .

The code is working fine.But the problem is with the design.

The Code is:

Output Label = Incident Type

filed name(picklist)=Incident_Type__c

object name=Incident_Record__c

 

<apex:outputLabel value="Incident Type" for="incident"  />
<apex:actionRegion >
<apex:inputField value="{!Incident_Record__c.Incident_Type__c}" style=""  required="true" id="incident" >
<apex:actionsupport event="onchange" rerender="sec1"/>
</apex:inputfield>
</apex:actionRegion>

 

the output is like:

 

Here Between the label and picklist there is a huge space.How to remove these space?