• vfdbg fvdsgvf
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 6
    Replies
Hello,

I am trying to fetch the cookies which has been set from a page before. I want access it, which is getting stored in browser. My page is written in Aura, hence, 
Map<String, System.Cookie> cookieMap = ApexPages.currentPage().getCookies();

Is not working in the apex class. Can anyone help me how to get the cookies from the browser?
  • February 23, 2022
  • Like
  • 0

i want to display quoteline records depending on family and under family dependign on charge type i need a seperate table , but below code is just getting the table on product family and subgrouping the records depending on charge type , but i needs a seperate table for the subgrouping of the charge type also . currently its display asExpected Display
VF code :
<apex:page showHeader="false" sidebar="false" cache="false" contentType="text/xml" controller="CustomLinesSectionController" >
    <!-- make sure to put /apex/c__CustomLinesSection in the Custom Source of the Template Content -->
    <apex:repeat var="family" value="{!linesByByProductCodeByProductFamily}">
        <table table-layout="fixed" width="100%">
            <table-column column-width="100%" />
            <table-body>
                <table-row>
                    <table-cell padding="2pt" background-color="#2B3263" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                        <block color="#FFFFFF" font-weight="bold" font-size="9pt" padding="2pt">{!HTMLENCODE(family)}</block>
                    </table-cell>
                </table-row>
            </table-body>
        </table>
        <table table-layout="fixed" width="100%">
            <table-column column-width="16.6%"/>
            <table-column column-width="16.6%"/>
            <table-column column-width="16.6%"/>
            <table-column column-width="16.6%"/>
            <table-column column-width="16.6%"/>
            <table-column column-width="10.6%"/>
            <table-column column-width="6.6%"/>
            <table-body>
                <table-row>
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                        <block color="#000000" font-weight="bold">
                            Product Name
                        </block>
                    </table-cell>
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                        <block color="#000000" font-weight="bold">
                            Service Category
                        </block>
                    </table-cell>
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                        <block color="#000000" font-weight="bold">
                            Charge Type
                        </block>
                    </table-cell>
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                        <block color="#000000" font-weight="bold">
                           Service Description
                        </block>
                    </table-cell>
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                        <block color="#000000" font-weight="bold">
                            Unit Of Measure
                        </block>
                    </table-cell>
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                        <block color="#000000" font-weight="bold">
                            Price Per Unit 
                        </block>
                    </table-cell>  
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                        <block color="#000000" font-weight="bold">
                            Minimum Monthly Commitement
                        </block>
                    </table-cell>  
                </table-row>
                <apex:repeat var="code" value="{!linesByByProductCodeByProductFamily[family]}">
                    <table-row>
                        <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                            <block >
                                {!HTMLENCODE(linesByByProductCodeByProductFamily[family][code].SBQQ__ProductName__c)}
                            </block>
                        </table-cell>
                        <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                            <block >
                                {!HTMLENCODE(linesByByProductCodeByProductFamily[family][code].SBQQ__ProductFamily__c)}
                            </block>
                        </table-cell>
                        <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                            <block >
                             {!HTMLENCODE(linesByByProductCodeByProductFamily[family][code].SBQQ__ChargeType__c)}  
                            </block>
                        </table-cell> 
                        <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                            <block >
                             {!HTMLENCODE(linesByByProductCodeByProductFamily[family][code].SBQQ__Description__c)}  
                            </block>
                        </table-cell> 
                        <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                            <block text-align="right">
                                {!HTMLENCODE(linesByByProductCodeByProductFamily[family][code].Quantity_Unit_Of_Measure__c)} 
                            </block>
                        </table-cell>
                        <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                            <block text-align="right">
                             <!-- {!HTMLENCODE(linesByByProductCodeByProductFamily[family][code].MMC__c)} -->
                                 <apex:outputText value="{0, number, $###,###,###,##0.00}">
                                    <apex:param value="{!netTotalByChargeType[code]}"/>
                                </apex:outputText>
                            </block>
                        </table-cell>
                        <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                            <block text-align="right">
                             <!-- {!HTMLENCODE(linesByByProductCodeByProductFamily[family][code].MMC__c)} -->
                                 <apex:outputText value="{0, number, $###,###,###,##0.00}">
                                    <apex:param value="{!nettotalMMC[code]}"/>
                                </apex:outputText>
                            </block>
                        </table-cell>
                    </table-row>
                </apex:repeat>
                <table-row>
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="0px" border-color="#000000" border-style="solid">
                        <block >
                            &nbsp;
                        </block>
                    </table-cell>
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="0px" border-color="#000000" border-style="solid">
                        <block >
                            &nbsp;
                        </block>
                    </table-cell>
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                        <block text-align="right" font-weight="bold">
                            Total of one Time product
                        </block>
                    </table-cell>
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                        <block text-align="right">
                            <apex:outputText value="{0, number, $###,###,###,##0.00}">
                                <apex:param value="{!netTotalByFamily[family]}"/>
                            </apex:outputText>
                        </block>
                    </table-cell>
                </table-row>
                <table-row>
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="0px" border-color="#000000" border-style="solid">
                        <block >
                            &nbsp;
                        </block>
                    </table-cell>
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="0px" border-color="#000000" border-style="solid">
                        <block >
                            &nbsp;
                        </block>
                    </table-cell>
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                        <block text-align="right" font-weight="bold">
                            Total of Recurring product
                        </block>
                    </table-cell>
                    <table-cell padding="2pt" background-color="#FFFFFF" font-size="9pt" border-width="1px" border-color="#000000" border-style="solid">
                        <block text-align="right">
                            <apex:outputText value="{0, number, $###,###,###,##0.00}">
                                <apex:param value="{!netTotalByFamily[family]}"/>
                            </apex:outputText>
                        </block>
                    </table-cell>
                </table-row>
            </table-body>
        </table>
        <block>&nbsp;</block>
    </apex:repeat>
</apex:page>
 
Apex Class :
// make sure to put /apex/c__CustomLinesSection in the Custom Source of the Template Content
public class CustomLinesSectionController {
    public Map<String, Map<String, SBQQ__QuoteLine__c>> linesByByProductCodeByProductFamily {get;set;}
  //  public Map<String, Map<String, Map<String , SBQQ__QuoteLine__c >>> test{get;set;}
    public Map<String, Decimal> netTotalByChargeType {get;set;}
    public Map<String, Decimal> netTotalByFamily {get;set;}
    public Map<String, Decimal> nettotalMMC {get;set;}
    public CustomLinesSectionController() {
        Id quoteId = (Id)ApexPages.currentPage().getParameters().get('qid');
        linesByByProductCodeByProductFamily = new Map<String, Map<String, SBQQ__QuoteLine__c>>();
    //    test = new Map<String, Map<string , Map<String, SBQQ__QuoteLine__c >>>();
        netTotalByChargeType = new Map<String, Decimal>();
        netTotalByFamily = new Map<String, Decimal>();
        nettotalMMC = new Map<String , Decimal>();
        for (SBQQ__QuoteLine__c ql : [SELECT Id,SBQQ__ProductName__c, SBQQ__ProductFamily__c, Product_Category__c , SBQQ__Description__c , Quantity_Unit_Of_Measure__c, 
                                       MMC__c, SBQQ__NetPrice__c,SBQQ__ChargeType__c , SBQQ__ListPrice__c, SBQQ__NetTotal__c,SBQQ__ProductCode__c FROM SBQQ__QuoteLine__c 
                                              WHERE SBQQ__Quote__c = :quoteId ]) {
            system.debug('the Quoteline is ==>'+ql);
            system.debug('the Quoteline charge type is ==>'+ql.SBQQ__ChargeType__c);
            system.debug('the Quoteline line==>'+linesByByProductCodeByProductFamily);           
            // by product group.
           String family = ql.SBQQ__ProductFamily__c == null ? 'General' : ql.SBQQ__ProductFamily__c;
         
            system.debug('the Quoteline String Family ==>'+family);
            if (!linesByByProductCodeByProductFamily.containsKey(family)) {
                linesByByProductCodeByProductFamily.put(family, new Map<String, SBQQ__QuoteLine__c>());
            }
            system.debug('the Quoteline Family test Value inserted ==>'+linesByByProductCodeByProductFamily);                                               
            // by product code.
             String key1 = (ql.SBQQ__ProductCode__c == null || ql.SBQQ__ProductCode__c == '' ? 'null' : ql.SBQQ__ProductCode__c) + ql.SBQQ__ProductName__c;
            String key = (ql.SBQQ__ChargeType__c == null || ql.SBQQ__ChargeType__c == '' ? 'null' : ql.SBQQ__ChargeType__c)+ ql.SBQQ__ProductName__c;
             system.debug('the Quoteline Key1 ==>'+key1);
             system.debug('the Quoteline Key ==>'+key);
            if (!linesByByProductCodeByProductFamily.get(family).containsKey(key)) {
                linesByByProductCodeByProductFamily.get(family).put(key, ql);
                system.debug('the Quoteline Key inside 1 ==>'+linesByByProductCodeByProductFamily);
            } else {
                linesByByProductCodeByProductFamily.get(family).get(key).SBQQ__ChargeType__c += ql.SBQQ__ChargeType__c;
                system.debug('the Quoteline Key inside 2 ==>'+linesByByProductCodeByProductFamily);
            }
            system.debug('the net total before==>'+netTotalByChargeType);
            // net total By charge Type.
            if (!netTotalByChargeType.containsKey(key)) {
                netTotalByChargeType.put(key, 0);
                system.debug('the net total after==>'+netTotalByChargeType);
            }
            system.debug('the Quoteline net total ==>'+netTotalByChargeType);
            if (ql.SBQQ__NetTotal__c > 0) {
                netTotalByChargeType.put(key, netTotalByChargeType.get(key) + ql.SBQQ__NetTotal__c);
            }
             system.debug('the Quoteline net total after ==>'+netTotalByChargeType);
            // net total by group.
            if (!netTotalByFamily.containsKey(family)) {
                netTotalByFamily.put(family, ql.SBQQ__NetTotal__c);
                system.debug('the Quoteline family ==>'+netTotalByFamily);
            } else {
                netTotalByFamily.put(family, netTotalByFamily.get(family) + ql.SBQQ__NetTotal__c);
                system.debug('the Quoteline family ==>'+netTotalByFamily);
            }
             system.debug('the Quoteline MMC before ==>'+nettotalMMC);                                     
            if (!nettotalMMC.containsKey(key)) {
                nettotalMMC.put(key, 0);
            }
            
            system.debug('the Quoteline MMC After ==>'+nettotalMMC);       
            /*// Net MMC 
             system.debug('the Quoteline net total ==>'+netTotalByChargeType);
            if (ql.nettotalMMC > 0) {
                netTotalByChargeType.put(key, netTotalByChargeType.get(key) + ql.nettotalMMC);
            }
            if (!nettotalMMC.containsKey(family)) {
                nettotalMMC.put(family, ql.MMC__c);
                system.debug('the Quoteline MMC ==>'+nettotalMMC);               
            } else {
                nettotalMMC.put(family, nettotalMMC.get(family) + ql.MMC__c);
                system.debug('the Quoteline MMC ==>'+nettotalMMC);
            }*/
        }
    }
}

I have an application with hundred of users created using the built-in Salesforce Identity and Access system.

 

This appears to have been a mistake.  These users and user accounts could have been configured to use the Active Directory (ADFS) via Azure AD.  If I configure my Salesforce instance to use Azure AD (ADFS) at this URL, https://docs.microsoft.com/en-us/azure/active-directory/saas-apps/salesforce-sandbox-tutorial  will it BREAK all my users in my Salesforce application?

 

Is there any way to easily migrate all of the existing using with a SF identity to match the email address for these hundreds of users that already have a username and password in Active Directory without breaking anything?

Hi, we are planning to embed the einstein bot in the webpage and we would like to pass the browser session details to einstein bot so that the Agent on the salesforce would be able to understand if the customer is already logged in to the webpage from where he initiated the chat. 

I'm doing a REST API call to get the global value set and trying to deserialize the JSON result to get the picklist values in a List<String>.

Here is the JSON:

{
  "size": 1,
  "totalSize": 1,
  "done": true,
  "queryLocator": null,
  "entityTypeName": "GlobalValueSet",
  "records": [
    {
      "attributes": {
        "type": "GlobalValueSet",
        "url": "/services/data/v53.0/tooling/sobjects/GlobalValueSet/0Nt59000000AAAAAAA"
      },
      "Metadata": {
        "customValue": [
          {
            "color": null,
            "default": false,
            "description": null,
            "isActive": null,
            "label": "USA",
            "urls": null,
            "valueName": "USA"
          },
          {
            "color": null,
            "default": false,
            "description": null,
            "isActive": null,
            "label": "Canada",
            "urls": null,
            "valueName": "Canada"
          }
        ],
        "description": null,
        "masterLabel": "US States & Territories",
        "sorted": false,
        "urls": null
      },
      "Id": "0Nt59000000AAAAAAA"
    }
  ]
}
I need help in fixing the error and also how to get valueNames in a List<String>

Error: System.JSONException: Malformed JSON: Expected '{' at the beginning of an object.

Here is what I have tried so far:

Wrapper:
    public class GlobalValueSetWrapper{
        Metadata metadata;

    public class Metadata {
        public List<CustomValue> customValue;
    }
    
    public class CustomValue {
        public String label;  
        public String valueName;
    }
    }


Class:
//calling API to get the JSON result
HttpResponse res = GlobalValueSetAPIHandler.getResponse('Countries');
GlobalValueSetWrapper wrapper = (GlobalValueSetWrapper) JSON.deserialize(res.getBody(), GlobalValueSetWrapper.class);
  • September 22, 2021
  • Like
  • 1
I have been looking at profiles in my organization and I notice that on some objects profiles have both read and view all permissions on a single object. Wouldn't having read and view all be redundanat and be the same as having just view all? Could someone help me to understand why a profile would need read and view all permissions on an object, instead of just having view all?