• Kishore B T
  • NEWBIE
  • 20 Points
  • Member since 2014

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

The Below is the code for getting Multiselect picklist. Currently its returning null when i Run test class.
Page
<apex:pageBlockSectionItem > <b> Category </b>
 <apex:outputPanel > <div class="requiredInput">
<div class="requiredBlock"></div>
 <apex:selectList value="{!Category}" required="true" size="4" id="CatG" multiselect="true"style="width:120px;">
<apex:selectOptions value="{!listcategory}"/>
 </apex:selectList> </div> </apex:outputPanel>
</apex:pageBlockSectionItem>


Class
public List<string> Category{ get; set; }
public List < SelectOption > listcategory{ get; set; }
Schema.DescribeFieldResult fieldResult = MasterItem__c.Type__c.getDescribe();
List<Schema.picklistEntry> ple = fieldResult.getPicklistValues();
for(Schema.picklistEntry f:ple) {
listcategory.add(new selectOption(f.getLabel(),f.getValue()));
}
Where as the the MasterItem__c.Type__c contains the values like
Actives,Passives,Misc and others

My Complete Controller runs on this snippet if its covered then my class will cover 100%.
So some one can let me know how to Pass the Above values into the Category field.
I need that category field to have in this main query.
for (VendorItem__c v: [SELECT Id, BillTo__r.City__c, BillTo__r.Country__c, BillTo__r.PostalCode__c, BillTo__r.State__c, BillTo__r.Street__c, CurrencyIsoCode, DeliveryTerms__c, DeliveryTimeline__c, DocumentationRequirement__c, IsPrefferedVendor__c, IsRecentSupplier__c, Make__c, MasterItem__c, MasterItem__r.Stock__C, ModeofPayment__c, Name, PackagingType__c, Price__c, PriceType__c, Remarks__c, ShippingMode__c, ShipTo__r.City__c, ShipTo__r.Country__c, ShipTo__r.PostalCode__c, ShipTo__r.State__c, ShipTo__r.Street__c,SPQ__c, UnitofMeasurement__c, vendorname__c, Package__c, (SELECT id FROM BOM_Line_Items__r) FROMVendorItem__c WHERE IsRecentSupplier__c=true AND MasterItem__c=:mapProductItems.keyset() AND MasterItem__r.type__c=:Category


 
I am fetching all the approval comments from afterupdate trigger. But in my test class i dont know how to cover the process steps . My Approval Process has 2 step approvers.

List<Planner__c > listtp=[Select v.Id,v.name, v.Approved_Amount__c ,(Select Id, IsPending, ProcessInstanceId, TargetObjectId, StepStatus,OriginalActorId, ActorId, RemindersSent, Comments, IsDeleted, CreatedDate, CreatedById,SystemModstamp From ProcessSteps order by createdDate desc limit 1) From Planner__c v where id =: Trigger.new[0].id];

I am not able to cover inner sqol query (Processsteps)

for(vepl_TravelPlanner__c c : listtp) { for (ProcessInstanceHistory ps : c.ProcessSteps)
{ // Get the Comment section from approval Object
. If(ps.Comments!=null0)
{ //My logic. } }

so can someone guide me how to use ProcessSteps.
Batch class as exposed as interface implement by developer.it is helpful for handle large number of records.Please explain real time exmple why we need to use Batch class  in real time?
Hi,

My task is to integrate Salesforce with an external website. That is get account and contact data from external website to salesforce.
The Developer at the external end will push the data into salesforce in PHP Script format.

How do i use it in salesforce.. Will i able to access it directly or Should i do any coding to get that data into salesforce.

As i am new to integration.
Any help will be appriciated....!
  • March 23, 2016
  • Like
  • 0
Hi, 

  I need to get all the user role and sub roles within sub role that are associated to a parent role using soql query. Below is the code which i am using to get role and sub-roles data. 

 /* Here I pass user name get the userrole id */
 user gurs = [Select UserRoleId,Email,ForecastEnabled 
                     from user where id = :runningUserId LIMIT 1];

/*  Here I pass the userrole id to see parentroleid */
 List<User> UsrList = [Select FirstName, Id, LastName, UserRoleId, UserRole.Name 
                            from User 
                            Where UserRole.ParentRoleId = :gurs.UserRoleId];

I am able to see below roles when i run the above soql code. 

 Example : 
     EMEA - Level - 1
          EMEA- Sub Level -2 

My new requirement is 

 Example 
     EMEA - Level - 1
          EMEA- Sub Level -2 
              EMEA - Super Sub Level-3

If I pass user name I should be able to see all the 3 level hierarchy data if there are ever 4 I should be able to see all the 4 level 

Please suggest me apex experts how i can achive this requirement need you suggestion 

Thanks
Sudhir