• user10286
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 2
    Replies
I want to merge objects dynamically. I have tried it but I didn't get the expected result
let result = [
    {
        Month: 7,
        OLIQU: 10,
        Year: 2018,
        AccountName: "Account1",         
        OpportunityName: "Opportunity1",
        ProductName: "Product1"
    },
    {
        Month: 8,
        OLIQU: 30,
        Year: 2018,
        AccountName: "Account1",         
        OpportunityName: "Opportunity1",
        ProductName: "Product1"
    },
    {
        Month: 9,
        OLIQU: 40,
        Year: 2018,
        AccountName: "Account1",         
        OpportunityName: "Opportunity1",
        ProductName: "Product1"
    },
    {
        Month: 10,
        OLIQU: 50,
        Year: 2018,
        AccountName: "Account1",         
        OpportunityName: "Opportunity1",
        ProductName: "Product1"
    },
    {
        Month: 7,
        OLIQU: 20,
        Year: 2018,
        AccountName: "Account1",         
        OpportunityName: "Opportunity2",
        ProductName: "Product1"
    },
    {
        Month: 8,
        OLIQU: 40,
        Year: 2018,
        AccountName: "Account1",         
        OpportunityName: "Opportunity2",
        ProductName: "Product1"
    },
    {
        Month: 9,
        OLIQU: 60,
        Year: 2018,
        AccountName: "Account1",         
        OpportunityName: "Opportunity2",
        ProductName: "Product1"
    },
    {
        Month: 10,
        OLIQU: 80,
        Year: 2018,
        AccountName: "Account1",         
        OpportunityName: "Opportunity2",
        ProductName: "Product1"
    },

];


let reportData = [];
// console.log(reportData);
let resultArray = [];
for(let key in result){                    
    if(result.hasOwnProperty(key)){
        let obj = {}; 
        obj.MName=result[key].AccountName;
        obj.POpp=result[key].OpportunityName;
        obj.PName=result[key].ProductName;
        if(result[key].Month===7){
            obj.July=result[key].OLIQU;
        }                        
        if(result[key].Month===8){
            obj.Aug=result[key].OLIQU;
        }
        if(result[key].Month===9){
            obj.Sep=result[key].OLIQU;
        }
        if(result[key].Month===10){
            obj.Oct=result[key].OLIQU;
        }
        reportData.push(obj);  
        let val = Object.assign.apply(Object, reportData.concat(obj));
        // resultArray.push(Object.assign.apply(Object, reportData.concat(obj)));
        resultArray.push(val);
    }
}

console.log(resultArray);  
I got this output with 8 times
Output:
[
    {
        Aug: 40
        July: 20
        MName: "Account1"
        Oct: 80
        PName: "Product1"
        POpp: "Opportunity2"
        Sep: 60
    },
    {
        Aug: 40
        July: 20
        MName: "Account1"
        Oct: 80
        PName: "Product1"
        POpp: "Opportunity2"
        Sep: 60
    },


]

my expected output is 

[
    {
        MName: "Account1",       
        POpp: "Opportunity1",
        PName: "Product1",
        July:10,
        Aug:30,
        Sep:40,
        Oct:50
    },
    {
        MName: "Account1",       
        POpp: "Opportunity2",
        PName: "Product1",
        July:20,
        Aug:40,
        Sep:60,
        Oct:80
    },
]

 

Hi All,

Consider there are 3 custom fields A,B,C. A is the formula field, B is the currency field and C is the formula field which gets the output of either A or B based on user inputs. Guide me with the possibilities and formula syntax to generate the output for Field C.Im using PE.

 

 

 

 

 

 

 

 

 

 

Hi All,

 

      I have created a new VF for Opportunity, need to add(override) hover link in this page. In my new VF page how to add relatedlist, printadle view, Help for this page same as opportunity default page.For this kindly tell me any link or code for example. Also tell how to change the detail page view  to new created VF page also.Thanks in advance, waiting for your reply. 

Hi All,

when I save the below formula, it shows this error:

 

Error: Compiled formula is too big to execute (19,959 characters). Maximum size is 5,000 character

 

if the sum of Value_1__c to Value_13__c <= 10, then  display level 1

if the sum of Value_1__c to Value_13__c >10 and Value_1__c to Value_13__c <= 18, then  display level 2

if the sum of Value_1__c to Value_13__c >18 then level 3

 

 

formula value:

if((Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c) <= 10

&&
(Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c ) <> 0 , "Level 1",
if( AND((Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c + Value_10__c + Value_11__c + Value_12__c + Value_13__c) > 10
&&
(Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c) <= 18), "Level 2",
if((Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c) > 18,"Level 3",
"Level Not Calculated Yet" )))

 

 

All field Value_1__c to Value_13__c also formula field which get s the value from the picklist selected.

 

we tried this also:

 

total_risk_cal__cValue_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c


if((total_risk_cal__c) <= 10
&&
(total_risk_cal__c ) <> 0 , "Level 1",
if( AND((total_risk_cal__c) > 10
&&
(total_risk_cal__c) <= 18), "Level 2",
if((total_risk_cal__c) > 18,"Level 3",
"Level Not Calculated Yet" )))

 

but getting same error.

 

 

Kindly tell how resolve this

 

 

Hi All

   1. I have create custom user lookup field in Account ,field name"SalesRep"

    2.create custom Account lookup  field in Site custom object,field name "Main Builder"

   3.and also create custom user lookup  field in Site custom object,field name "Exo SalesRep"

when i select account in "Main Builder" ,the relevant account user name will be populate in "Exo SalesRep" field.

Plz anyone solve the issues

 Advance thanks

Hi All,

when I save the below formula, it shows this error:

 

Error: Compiled formula is too big to execute (19,959 characters). Maximum size is 5,000 character

 

if the sum of Value_1__c to Value_13__c <= 10, then  display level 1

if the sum of Value_1__c to Value_13__c >10 and Value_1__c to Value_13__c <= 18, then  display level 2

if the sum of Value_1__c to Value_13__c >18 then level 3

 

 

formula value:

if((Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c) <= 10

&&
(Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c ) <> 0 , "Level 1",
if( AND((Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c + Value_10__c + Value_11__c + Value_12__c + Value_13__c) > 10
&&
(Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c) <= 18), "Level 2",
if((Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c) > 18,"Level 3",
"Level Not Calculated Yet" )))

 

 

All field Value_1__c to Value_13__c also formula field which get s the value from the picklist selected.

 

we tried this also:

 

total_risk_cal__cValue_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c


if((total_risk_cal__c) <= 10
&&
(total_risk_cal__c ) <> 0 , "Level 1",
if( AND((total_risk_cal__c) > 10
&&
(total_risk_cal__c) <= 18), "Level 2",
if((total_risk_cal__c) > 18,"Level 3",
"Level Not Calculated Yet" )))

 

but getting same error.

 

 

Kindly tell how resolve this