• Somesh_11
  • NEWBIE
  • 25 Points
  • Member since 2020
  • Devloper

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 6
    Replies
Hi all, 
While creating comunity if we choose build our own template, Did we get option to add Navigation menu. I cant see any option, Can anyone help on this.
If we select Partner Central Template by default we will get Navigation Menu,
Likewise can we add in our Own template.
Hi all,

Can we upload an app exchange product, If we are an Consulting partner to Salesforce.
Hi all,

I am trying to create new page for approval notification in partner community, But not able to find a way.
My scenario is, the approval notification will come to partner user and once he clicks on notification it will navigate to approval page there I want to add new page or Customize it. But in builder I am not able to find Or add/Modify the page for Aprroval.

User-added image
Can anyone suggest me.
Hi all, I getting Constructor not defined: [CreditMeterGraphic].<Constructor>() error for below controller class.  Can anyone help on this.

Controller class is : 
public with sharing class CreditMeterGraphic {
    public String currentRecordId {get;set;}
    public Account acc{get;set;}
    public CreditMeterGraphic(ApexPages.StandardController controller){
        currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');
        if (Schema.sObjectType.Account.fields.Credit_Limit__c.isAccessible()) {
        acc = [Select Credit_Limit__c From Account Where Id =: currentRecordId];
        }
    }
    public List<gaugeData> getData(){
        double npsscore = 0;
        Account creditusage = [Select Id, Name, Credit_Usage__c, Credit_Limit__c From Account Where Id =: currentRecordId];
        Account creditlimit = [Select Id, Name, Credit_Limit__c From Account LIMIT 1];
       
        List<gaugeData> data = new List<gaugeData>();
        data.add(new gaugeData('Credit', creditusage.Credit_Usage__c));
        data.add(new gaugeData('Credit', creditusage.Credit_Limit__c));
       return data;   
    }
    public class GaugeData{
        public String name{get; set;}
        public decimal credit{get; set;}
        public gaugeData(String name, decimal npsScore){
            this.name = name;
            this.credit = npsScore;
        }
    }
}

Test Class is : 
@isTest
public class TestCreditMeterGraphic {

    @isTest Public static void creditMeterGraphicMethod(){
         
        //Getting Dealer Account
        Account dealerAccnt = TestDataFactory.createDealerAccount();
        
       Test.StartTest(); 
            ApexPages.currentPage().getParameters().put('id', String.valueOf(dealerAccnt.Id));
            CreditMeterGraphic  testCreditMeterGraphic = new CreditMeterGraphic();
            testCreditMeterGraphic.getData();
        Test.StopTest();        
    }    
}
Hi all,
When I am hard coding the record type value its working fine. But I am trying like in below picture then its not working.
Like : <aura:attribute name="PriceBookId" type="String" default="$CustomMetadata.Pricebook_Setting__mdt.RetailerPBRT.PBRecordTypeId__c" access="global"/>

How to get the value from metadata over here.User-added image
What is the best practice to write test classes where we need to add product for OrderItem. Should we create an New product as part of test data as we are creating account.
Hi all,
Getting an error for flexipage while pushing the code to scratch Org. Can anyone help.User-added image Error is : Account_Record_Page.flexipage-meta.xml  Component [flexipage:visualforcePage] attribute [pageName]: Visualforce page [CreditMeterGraphicVF] not available for use on mobile devices. The Error Screen shot is attached.
 
Hi all, I am getting an error Id and Pricebook2Id not found. Can anyone help please.
I am doing devlopment in Scratch Org. Below is the code and Error snippet.
User-added image
Hi all, How to write a test class method for future post callout.
I have the code attached in picture.
Can any one give example please.User-added image

 
Hi all, For my test class getting this error..
My test class is

@isTest(seeAllData = true)
public class Test_ApplyOrderLineOffers {
    @isTest Public static void lineOffers(){
        //Distributor Account Insertion
        RecordType AccDistRecId = [SELECT Id FROM RecordType WHERE sObjectType = 'Account' AND Name = 'Distributor'];
        Account DistAcc=new Account(Name='DistrbAccnt',recordTypeId=AccDistRecId.id,icxdms__Credit_Limit__c=20000);
        insert DistAcc;
        //Retailer Account Insertion
        RecordType AccRTRetailer = [SELECT Id FROM RecordType WHERE sObjectType = 'Account' AND Name = 'Retailer'];
        Account RetAcc=new Account(Name='RetailerAccnt',ParentId=DistAcc.Id,recordTypeId=AccRTRetailer.id);
        insert RetAcc;
        
        // Adding Products
        Product2 p1=new Product2(Name='Fruitnik 50ml',Family='Beverages',IsActive=true,productCode='BEV');
        insert p1;
        
        Product2 p2=new Product2(Name='Fruitnik 200ml',Family='Beverages',IsActive=true,productCode='BEV');
        insert p2;
   
        Pricebook2  standardPb = [select id, name, isActive from Pricebook2 where IsStandard = true limit 1];
        
        PricebookEntry standardPrice = new PricebookEntry();
        standardPrice.Pricebook2Id = standardPb.Id;
        standardPrice.Product2Id = p2.Id;
        standardPrice.UnitPrice = 100;
        standardPrice.IsActive = true;
        standardPrice.UseStandardPrice = false;
        insert standardPrice ;
        

        RecordType OrderRTRetlr = [SELECT Id FROM RecordType WHERE sObjectType = 'Order' AND Name = 'Retailer'];
        Order Retailerorder=new Order(AccountId=RetAcc.Id,recordTypeId=OrderRTRetlr.Id,Status='Draft',EffectiveDate=system.today()-5,Pricebook2Id =standardPb.Id);//dist order
        insert Retailerorder;
        
        OrderItem i=new OrderItem(Product2Id=p2.Id,Quantity=100,OrderId=Retailerorder.Id,UnitPrice=100,PricebookEntryId=standardPrice.id);
        insert i;
        

    }
}
Hi all, I getting Constructor not defined: [CreditMeterGraphic].<Constructor>() error for below controller class.  Can anyone help on this.

Controller class is : 
public with sharing class CreditMeterGraphic {
    public String currentRecordId {get;set;}
    public Account acc{get;set;}
    public CreditMeterGraphic(ApexPages.StandardController controller){
        currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');
        if (Schema.sObjectType.Account.fields.Credit_Limit__c.isAccessible()) {
        acc = [Select Credit_Limit__c From Account Where Id =: currentRecordId];
        }
    }
    public List<gaugeData> getData(){
        double npsscore = 0;
        Account creditusage = [Select Id, Name, Credit_Usage__c, Credit_Limit__c From Account Where Id =: currentRecordId];
        Account creditlimit = [Select Id, Name, Credit_Limit__c From Account LIMIT 1];
       
        List<gaugeData> data = new List<gaugeData>();
        data.add(new gaugeData('Credit', creditusage.Credit_Usage__c));
        data.add(new gaugeData('Credit', creditusage.Credit_Limit__c));
       return data;   
    }
    public class GaugeData{
        public String name{get; set;}
        public decimal credit{get; set;}
        public gaugeData(String name, decimal npsScore){
            this.name = name;
            this.credit = npsScore;
        }
    }
}

Test Class is : 
@isTest
public class TestCreditMeterGraphic {

    @isTest Public static void creditMeterGraphicMethod(){
         
        //Getting Dealer Account
        Account dealerAccnt = TestDataFactory.createDealerAccount();
        
       Test.StartTest(); 
            ApexPages.currentPage().getParameters().put('id', String.valueOf(dealerAccnt.Id));
            CreditMeterGraphic  testCreditMeterGraphic = new CreditMeterGraphic();
            testCreditMeterGraphic.getData();
        Test.StopTest();        
    }    
}
Hi all,
Getting an error for flexipage while pushing the code to scratch Org. Can anyone help.User-added image Error is : Account_Record_Page.flexipage-meta.xml  Component [flexipage:visualforcePage] attribute [pageName]: Visualforce page [CreditMeterGraphicVF] not available for use on mobile devices. The Error Screen shot is attached.
 
Hi all, I am getting an error Id and Pricebook2Id not found. Can anyone help please.
I am doing devlopment in Scratch Org. Below is the code and Error snippet.
User-added image
Hi all, For my test class getting this error..
My test class is

@isTest(seeAllData = true)
public class Test_ApplyOrderLineOffers {
    @isTest Public static void lineOffers(){
        //Distributor Account Insertion
        RecordType AccDistRecId = [SELECT Id FROM RecordType WHERE sObjectType = 'Account' AND Name = 'Distributor'];
        Account DistAcc=new Account(Name='DistrbAccnt',recordTypeId=AccDistRecId.id,icxdms__Credit_Limit__c=20000);
        insert DistAcc;
        //Retailer Account Insertion
        RecordType AccRTRetailer = [SELECT Id FROM RecordType WHERE sObjectType = 'Account' AND Name = 'Retailer'];
        Account RetAcc=new Account(Name='RetailerAccnt',ParentId=DistAcc.Id,recordTypeId=AccRTRetailer.id);
        insert RetAcc;
        
        // Adding Products
        Product2 p1=new Product2(Name='Fruitnik 50ml',Family='Beverages',IsActive=true,productCode='BEV');
        insert p1;
        
        Product2 p2=new Product2(Name='Fruitnik 200ml',Family='Beverages',IsActive=true,productCode='BEV');
        insert p2;
   
        Pricebook2  standardPb = [select id, name, isActive from Pricebook2 where IsStandard = true limit 1];
        
        PricebookEntry standardPrice = new PricebookEntry();
        standardPrice.Pricebook2Id = standardPb.Id;
        standardPrice.Product2Id = p2.Id;
        standardPrice.UnitPrice = 100;
        standardPrice.IsActive = true;
        standardPrice.UseStandardPrice = false;
        insert standardPrice ;
        

        RecordType OrderRTRetlr = [SELECT Id FROM RecordType WHERE sObjectType = 'Order' AND Name = 'Retailer'];
        Order Retailerorder=new Order(AccountId=RetAcc.Id,recordTypeId=OrderRTRetlr.Id,Status='Draft',EffectiveDate=system.today()-5,Pricebook2Id =standardPb.Id);//dist order
        insert Retailerorder;
        
        OrderItem i=new OrderItem(Product2Id=p2.Id,Quantity=100,OrderId=Retailerorder.Id,UnitPrice=100,PricebookEntryId=standardPrice.id);
        insert i;
        

    }
}