• PMPR72
  • NEWBIE
  • 25 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 11
    Replies

Hi.I'm working on Lightning.I want a table based on productCode I select and months I enter in Rev Rec in months box.If I enter 9 I will get 9 months and if I enter 30 I will get 30 like M+1,M+2.....
boolean isMultiCurrencyOrganization = userinfo.isMultiCurrencyOrganization();
      string DefaultCurrency = userinfo.getDefaultCurrency();
          System.debug('DefaultCurrency:'+DefaultCurrency);
       if(DefaultCurrency == 'USD')userCurrencySign = '$';
        else if(DefaultCurrency == 'EUR')userCurrencySign = '€';
      else if(DefaultCurrency == 'INR')userCurrencySign = 'INR';
         else if(DefaultCurrency == 'CAD')userCurrencySign = '$';
       map<Id,string> mapcurrency = new map<Id,string>();
      if(isMultiCurrencyOrganization){
     System.debug('isMultiCurrencyOrganization'+isMultiCurrencyOrganization);
                                                                   CurrencyConversion.Initialization();
                                                               }
trigger PopulateStandardPrice2 on Product2 (before insert,before update,after insert,after update) {
    list<Id> Idlist = new list<Id>();
    list<product2> ProdsToUpdate = new list<Product2>();
    for(Product2 pr:trigger.new){
        Idlist.add(pr.Id);
    }
    pricebook2 pb = [select Id from pricebook2 where IsStandard = TRUE][0];
    Id stPrId = pb.Id;
    for(product2 p:[select Product_Price_Unit__c,Id from product2 where Id IN :Idlist]){
        for(pricebookentry pbe:[select Product2Id,UnitPrice from pricebookentry where pricebook2Id = :stPrId and product2Id IN :Idlist]){
            If((pbe.Product2Id == p.Id)&&(p.Product_Price_Unit__c!=pbe.UnitPrice)){
                p.Product_Price_Unit__c = pbe.UnitPrice;
                system.debug('this is it '+pbe.UnitPrice);
                system.debug('this is that '+p.Product_Price_Unit__c);
                ProdsToUpdate.add(p);
            }
        }
    }
    system.debug('ProdsToUpdate>>>'+ProdsToUpdate.size());
    If(ProdsToUpdate.size()>0&&trigger.isafter){
            update ProdsToUpdate;
    }
}
I have a requirement that I have to fetch all the Account Lookup fields.I'm using Schema.DisplayType for fetching Text,Picklistlist fields.But for lookup fields I don't know how to fetch.Can anyone help me?
I have One Object HDS which is self lookup. It has records and 
    if record 1 is checked all the records below of record record 1 is checked automatically , and if record 2 is checked all the records below record 2 is checked automatically.
  • April 30, 2019
  • Like
  • 0
public string amtStrData(string rstr){
        string strg = rstr;
        if(rstr.contains(' " ')){
            try{
            integer index1= rstr.indexOf('"')+1;
            string p1= rstr.substring(index1);
            integer index2= p1.indexOf('"')+index1;         
            string amount = rowstr.substring(index1,index2);
            amount = amount.replace(',','');
            strg = rstr.substring(0,index1-1)+amount+rstr.substring(index2+1);
            }catch(Exception e){}
        }
  • April 09, 2019
  • Like
  • 0
 Type__c theRec = Type__c.getInstance(op);  // Custom Setting
            if(theRec != null && theRec .Duration__c == true){
                 map<String,Product__c> mapData = new Map<String,Product__c>();
                 for(Product__c lstRev:Database.query(strFinalQuery)){ 
                   mapData.put( lstRev.Period__c, lstRev);
                }
  • March 29, 2019
  • Like
  • 0
I used Schema DisplayType but there is no AutoNumer dataTypes.We can't dislplay AutoNumber datatypes using DisplayType Schema
  • March 27, 2019
  • Like
  • 0
Select Account.Owner.Id,Type__c,Id,Name,Account.Id,Account.Name,Owner.Id from Opportunity where Id<>null  
  • March 27, 2019
  • Like
  • 0

String strAccount ;
String StrVersant;
String accQuery = 'Select Id,Name from Account where Id =:AccountId and Id IN(Select Account__c from Pd_Mod__c where Plng_session__r.Name=:strVersant) ORDER BY Name LIMIT 15000';
            accountList= Database.query(accQuery);
            if(accountList!=null && accountList.size()>0){
               for(Account accObj:accountList){
                  strAccount = accObj.name;
               }
            }
  • March 25, 2019
  • Like
  • 0
          String pvd = apexpages.currentpage().getparameters().get('pv');

         Pl_target_c target =[Select Name from Pl_target_c where Id=:Id.valueOf(pvd) LIMIT 1];
 
  • March 25, 2019
  • Like
  • 0
I have one dropdown with values"text,radio,multiselect,numeric".
My question is when I select text from dropdown  I should get text and when radio selected radio button should appear.How can i achieve this?
  • August 05, 2018
  • Like
  • 0
List<OpenActivity> openList=  new List<OpenActivity>();
for(OpenActivity oA :OpenActivitieslist){
                                oA.OwnerId=''012200000000MqA';
                                openList.add(oA);
                        } 

    Update openList;

While I am trying to upade it is showing error as "Field is not writeable: OpenActivity.OwnerId"

Any help is highly appreciated:)

Thanks,
Jay
Background : I need access account records in the apex class where name contains %

For example, the query should return below accounts
abcd10%
cdcd40%abcd
10%volume

When i execute below query i am getting results in the workbench
select id,name from Account where Name LIKE '%\%%'


the same query If I execute in Anonymous window/apex execute getting no results

 

need to devlope query on Opportunity for  id,name,stage & Oppounitylineitem for id,name & OpportunityContactRole for phone,email in a single query for this objects and this fields to be inserted in other custom object

i have devlope this query 
select id,name, (select id,name from OpportunityLineItems), (Select id from OpportunityContactRoles) from Opportunity 

but unale to insert records in my custom object:-
my cutstom obejct Name :- myobject__c
fields in that :- Oppid__c,Oppname__c,Productid__c,ProductName__c,Phone__c,Email__c need to insert in this object

can anyone please help me for to achive this requiremnt

I have a requirement that I have to fetch all the Account Lookup fields.I'm using Schema.DisplayType for fetching Text,Picklistlist fields.But for lookup fields I don't know how to fetch.Can anyone help me?
Hi All,
I am trying to identify field access of an object and used SELECT Id, Field, SObjectType, PermissionsRead, PermissionsEdit FROM FieldPermissions where SObjectType='Contact' this SOQL query. But Name field is missing in the result.
Can somebody help me to identify root cause for the above issue?

Thanks,
Sachin
          String pvd = apexpages.currentpage().getparameters().get('pv');

         Pl_target_c target =[Select Name from Pl_target_c where Id=:Id.valueOf(pvd) LIMIT 1];
 
  • March 25, 2019
  • Like
  • 0
Hi,
I have a scenario where i have a batch class. Once batch job is done I need to send an email to specific email id with excel file. This excel file should contain all the records that got failed in the batch job along with error message. Please suggest.
I have one dropdown with values"text,radio,multiselect,numeric".
My question is when I select text from dropdown  I should get text and when radio selected radio button should appear.How can i achieve this?
  • August 05, 2018
  • Like
  • 0