• mayur
  • NEWBIE
  • 84 Points
  • Member since 2013

  • Chatter
    Feed
  • 3
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 9
    Replies
Order Billing City/State/Province/Zip Code:<apex:outputText value="relatedTo.Renewal_Opportunity__r.Order_Billing_City__c + ' ' +relatedTo.Renewal_Opportunity__r.Order_Billing_State_Province__c+ ' ' +relatedTo.Renewal_Opportunity__r.Order_Billing_Zip_Code__c"></apex:outputText> <br/> 
I want to concatenate the above fields and display.
But its not working.
Any assistance will be of great help
 

Hii 
I can't find PicklistValueInfo sObject in tooling API . I found this in enterprise developer guide written as :---
Some objects used by the Tooling API are included in the Enterprise and Partner WSDL. Use the objects from these WSDLs instead of the Tooling WSDL if you need field-level security.
The following Tooling API objects are exposed in the Enterprise and Partner WSDL.DataType
EntityDefinition
EntityParticle
FieldDefinition
PicklistValueInfo
Publisher
SearchLayout
Service
ServiceDataType (Reserved for future use.)
ServiceFieldDataType (Unavailable in version 35.0 and later. Do not use.)
RelationshipDomain
RelationshipInfo
UserEntityAccess
UserFieldAccess
WsdlDataType (Reserved for future use.)
XmlSchema (Reserved for future use.)

As you can see there they have mentioned about "PicklistValueInfo" but i can't find this sObject any where nither in Enterpirse nor in Tooling API.
Help ?
 

I have time based Workflow on opportunity Object. As per our workflow criteria when 'Reservation End date and closed date equals today's date and Reservation Flag is true' the workflow fires and updates 2 fields namely 'Stage Name' and 'Close Date'. Aftre this before update Trigger Fires- updates field on opportunity. Workflow is working for some records but for some records geting below error • "Closed/Lost opportunity stage should match with Omitted forecast category". Not able to understand reason for this error.

Can any one help?

Thanks in advance.
  • March 03, 2015
  • Like
  • 0
Hi, Please any one can help me with a solution, i create a geolocation Visualforce page for showing account under 5 km in Geolocation Map,
when i open this page in salesforce1 app, it's working fine and comes in full screen in android salesforce1 and Iphone IOS 6.0 salesforce1, but when i open this visualforce page in Iphone IOS 8.0 Salesforce1 ,then it comes in small screen.
 

 
  • December 05, 2014
  • Like
  • 1
Hi, Please any one can help me with a solution, i create a geolocation Visualforce page for showing account under 5 km in Geolocation Map,
when i open this page in salesforce1 app, it's working fine and comes in full screen in android salesforce1 and Iphone IOS 6.0 salesforce1, but when i open this visualforce page in Iphone IOS 8.0 Salesforce1 ,then it comes in small screen.
 

 
  • December 05, 2014
  • Like
  • 1
Hi all,

Below is my code.

If(leadList[0].Sector__c=='Salaried'){
            If(mbd.Score__c >=600 && mbd.Score__c<650){
                leadList[0].Interest_Rate__c = 12.00;
            }else if(mbd.Score__c >=650 && mbd.Score__c<700){
                leadList[0].Interest_Rate__c =11.25;
            }else if(mbd.Score__c>=700 && mbd.Score__c<750){
                leadList[0].Interest_Rate__c = 10.25;
            }else if(mbd.Score__c>=750){
                leadList[0].Interest_Rate__c = 8.25;
            }else if(mbd.Score__c==-1){
                leadList[0].Interest_Rate__c = 12.75;
            }else if(mbd.Score__c==4){
                leadList[0].Interest_Rate__c = 11.25;
            }else if(mbd.Score__c == 5){
                leadList[0].Interest_Rate__c = 11.25;
            } 
        }else if(leadList[0].Sector__c=='SENP' && leadList[0].Sector__c=='SEP'){
            if(mbd.Score__c >=700 && mbd.Score__c<750){
                leadList[0].Interest_Rate__c = 10.25;
            }else if(mbd.Score__c >=750){
                leadList[0].Interest_Rate__c = 9.25;
            }else if(mbd.Score__c==4){
                leadList[0].Interest_Rate__c = 12.00;
            }else if(mbd.Score__c==5){
                leadList[0].Interest_Rate__c = 12.00;
            }
        }              
    }
    // Calculating Proposed EMI
 leadList[0].Proposed_EMI__c = (leadList[0].Amount_in_Rs__c+(leadList[0].Amount_in_Rs__c*leadList[0].Interest_Rate__c*leadList[0].Loan_Tenor_in_Month__c)/12)/leadList[0].Loan_Tenor_in_Month__c;
    system.debug('proposed emi--'+leadList[0].Proposed_EMI__c);

At Proposed EMI am getting Zero(0) even i have all the field values. What is the problem please let me know.

Thanks
Order Billing City/State/Province/Zip Code:<apex:outputText value="relatedTo.Renewal_Opportunity__r.Order_Billing_City__c + ' ' +relatedTo.Renewal_Opportunity__r.Order_Billing_State_Province__c+ ' ' +relatedTo.Renewal_Opportunity__r.Order_Billing_Zip_Code__c"></apex:outputText> <br/> 
I want to concatenate the above fields and display.
But its not working.
Any assistance will be of great help
 
expecting right curly bracket, found 'if'
 
<select id="MySelectMenu">
<option value="f">Demos On Demand Report</option>
<option value="s">Pointmarketing Report</option>
</select>
 
public   String MySelectMenu { get; set; }
    public   String SelectMenu { get; set; }
    if(MySelectMenu == 'Demos On Demand Report' ){
    SelectMenu = 'DemosOnDemandReport';
    }
    else(MySelectMenu == 'Pointmarketing Report' ){
    SelectMenu = 'PointmarketingReport';
      }




 
I get the following error: "Challenge Not yet complete... here's what's wrong: 
No tab named 'Vehicles' was found" I do not understad why. Who can help me out!
with regards,

​Karel

Hii 
I can't find PicklistValueInfo sObject in tooling API . I found this in enterprise developer guide written as :---
Some objects used by the Tooling API are included in the Enterprise and Partner WSDL. Use the objects from these WSDLs instead of the Tooling WSDL if you need field-level security.
The following Tooling API objects are exposed in the Enterprise and Partner WSDL.DataType
EntityDefinition
EntityParticle
FieldDefinition
PicklistValueInfo
Publisher
SearchLayout
Service
ServiceDataType (Reserved for future use.)
ServiceFieldDataType (Unavailable in version 35.0 and later. Do not use.)
RelationshipDomain
RelationshipInfo
UserEntityAccess
UserFieldAccess
WsdlDataType (Reserved for future use.)
XmlSchema (Reserved for future use.)

As you can see there they have mentioned about "PicklistValueInfo" but i can't find this sObject any where nither in Enterpirse nor in Tooling API.
Help ?
 

I have written a test class for trigger.the formulae fields is there in if condition.the problem is "Opsconca__c "formulae field in Opportunity_car_set__c.the Opsconca__c  = Opsconca__c   = (Model__r.Name) & (Rfleet_Country_Code__c) & TEXT(Opportunity__r.Total_Fleet_Size__c) ,the Rfleet_Country_Code__c is formulae field in Account object,the Total_Fleet_Size__c is formulae field in opportunity object related to account formulae field.how to cover the formulae field in IF condition of test class?
 
Test class:
@isTest
public class Rfleet_CheckDiscount_Test {
    static testMethod void Discountceck(){
        Account acc = new Account(Name='something',Montant__c=0.2);
       acc.Fleet_Size_Cars__c = 10;
        acc.Fleet_Size_LCV__c = 10;
        acc.RecordTypeId = '012m00000000QSU';
        insert acc;
        acc.Name = 'something2';
        update acc;
        
        Opportunity opp = new Opportunity();
        opp.Name = 'restful';
        opp.StageName = 'Draft';
        opp.CloseDate = system.today();
        opp.AccountId = acc.Id;
        //opp.Total_Fleet_Size__c = 20;
        insert opp;
        opp.Name = 'restfulll';
        update opp;
       
        Product2 pro = new Product2();
        pro.Name = 'Kiran prod1';
        pro.Country_code__c = 'DZ';
        pro.Brand__c = 'Dacia';
        pro.IsActive = true;
        pro.Family = 'X44';
        insert pro;
        
        Opportunity_car_set__c ocs = new Opportunity_car_set__c();
        ocs.Name = 'Discount Test12';
        ocs.Model__c = pro.id;
        //ocs.Rfleet_Country_Code__c ='DZ';
        ocs.Opportunity__c = opp.id;
        ocs.Discount__c = 11;
        ocs.Quantity__c = 4;
        insert ocs;
        Discount_Grid__c dgc = new Discount_Grid__c();
        dgc.Rfleet_Country_Code__c = 'DZ';
        dgc.Rfleet_AOC_Model_Code__c = pro.id;
        dgc.Rfleet_Threshold_Max__c = 10;
        dgc.Rfleet_Discount__c = 10;
        insert dgc;
      Rfleet_CheckDiscount.CheckDiscountobject();
   
    }
    static testMethod void Discountceck1(){
        Account acc = new Account(Name='something',Montant__c=0.2);
       acc.Fleet_Size_Cars__c = 10;
        acc.Fleet_Size_LCV__c = 10;
        acc.RecordTypeId = '012m00000000QSU';
        insert acc;
        acc.Name = 'something2';
        update acc;
        
        Opportunity opp = new Opportunity();
        opp.Name = 'restful';
        opp.StageName = 'Draft';
        opp.CloseDate = system.today();
        opp.AccountId = acc.Id;
        //opp.Total_Fleet_Size__c = 20;
        insert opp;
        opp.Name = 'restfulll';
        update opp;
       
        Product2 pro = new Product2();
        pro.Name = 'Kiran prod1';
        pro.Country_code__c = 'DZ';
        pro.Brand__c = 'Dacia';
        pro.IsActive = true;
        pro.Family = 'X44';
        insert pro;
        
        Opportunity_car_set__c ocs = new Opportunity_car_set__c();
        ocs.Name = 'Discount Test12';
        ocs.Model__c = pro.id;
        //ocs.Rfleet_Country_Code__c ='DZ';
        ocs.Opportunity__c = opp.id;
        ocs.Discount__c = 10;
        ocs.Quantity__c = 4;
        insert ocs;
        Discount_Grid__c dgc = new Discount_Grid__c();
        dgc.Rfleet_Country_Code__c = 'DZ';
        dgc.Rfleet_AOC_Model_Code__c = pro.id;
        dgc.Rfleet_Threshold_Max__c = 10;
        dgc.Rfleet_Discount__c = 20;
        insert dgc;
      Rfleet_CheckDiscount.CheckDiscountobject();
        
        
    }
 
}

User-added image
Trigger:
global with sharing class Rfleet_CheckDiscount{
 
 webservice static void CheckDiscountobject()  { 
 
 list<Opportunity_car_set__c>lsupdateKo=new list<Opportunity_car_set__c>();
  list<Opportunity>lsupdatoppko=new list<Opportunity>();
   
  list<Discount_Grid__c> listDisGrid=[select Rfleet_Status__c,Rfleet_Discountconca__c,Rfleet_Discount__c from Discount_Grid__c  where SystemModstamp =LAST_N_DAYS:31 and Rfleet_Status__c = 'Enabled' Limit 50000];
    system.debug('Discount_Grid list:::'+listDisGrid);
  list<Opportunity> lsoppty=[Select StageName,name,Rfleet_Granted_discount_KO__c,RFLEET_Status__c, Id,(Select id,Opsconca__c,Rfleet_Granted_discount_KO__c,Discount__c From Opportunity_car_sets__r) From Opportunity where StageName IN('Draft','Internal Approbation')order by SystemModstamp desc limit 100];
               
system.debug('Opportunity list:::'+lsoppty);
           
             for(Opportunity opp:lsoppty){
             
                 for(Opportunity_car_set__c ocs:opp.Opportunity_car_sets__r){
                 
                       for(Discount_Grid__c disGrid:listDisGrid){
                   system.debug('dis con:::'+disGrid.Rfleet_Discountconca__c);
                   system.debug('Opportunity OCS con:::'+ocs.Opsconca__c);
                           if(disGrid.Rfleet_Discountconca__c==ocs.Opsconca__c)  {
                           system.debug(' OCS con:::'+ocs.Discount__c);
                           system.debug('Discount grid con:::'+disGrid.Rfleet_Discount__c);
                                  if(ocs.Discount__c>disGrid.Rfleet_Discount__c){
                                    ocs.Rfleet_Granted_discount_KO__c = true;
                                     opp.Rfleet_Granted_discount_KO__c = true;
                                    lsupdateKo.add(ocs);
                                    lsupdatoppko.add(opp);
                                    }else{
                                     ocs.Rfleet_Granted_discount_KO__c = false;
                                      opp.Rfleet_Granted_discount_KO__c = false;
                                    lsupdateKo.add(ocs);
                                    lsupdatoppko.add(opp);
                                    }
                               
                               }
                       
                       }
                   }
               }
               
         update lsupdateKo;
         update lsupdatoppko;
   }
   
}

 
trigger partneracClone on account (after insert) {

// accounts ids to query
Account[] accToClone = new Account[]{};
Account [] accToSave = new Account[]{};

Set<Id> AccountIds = new Set<Id>();
For(account acc : trigger.new)
{
     AccountIds.add(acc.id);
accToClone.add(acc);
}

 // query accounts and store by there name to lookup it up quickly
    Map<Id,Account> accountMap = new Map<Id,Account>([
        select  Id  , Name,Description,Phone,Fax  from Account where Id IN: AccountIds]);

    // clone 

    for (Account acc :accToClone)
    {   Account theClone = new Account();


        
        theClone.Name =  accountMap.get(acc.id).Name;
        theClone.Type =  accountMap.get(acc.id).Type;
        theClone.Phone =  accountMap.get(acc.id).Phone;

        theClone.Fax =  accountMap.get(acc.id).Fax;
        theClone.Description =  accountMap.get(acc.id).Description;

        accToSave.add(theClone);
    }
  system.debug('******'+accToSave);
    insert accToSave;
}

error:
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger partneracClone caused an unexpected exception, contact your administrator: partneracClone: execution of AfterInsert caused by: System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Account.Type: Trigger.partneracClone: line 26, column 1


requirement wen i click save button i want a new account to be created with same name and other fields also same..but i get this error