• Wendy Miller
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies

Hello i am james from chicago and I am a website owner business man (http://howisland.com).
The Case object is used by two of our integrations. Only one requires the addition of APEX triggers for proper syncing, and when we only have that one active integration, everything functions as it should. Since the second integration isn't a component of the App the trigger refers to, as soon as we enable it the sync immediately throws errors:

Hello folks,

As im not CRM analytics developer its hard for me to set this up, maybe you can help!  This is TCRM our of the box leaderboard component. I just want to set a dynamic reference line with TODAY() date. Can you help? it can be done only with JSON editing. Attached how it should look like User-added image

{
"parameters": {
"totalValue": "computeTotal",
"showPoints": true,
"legend": {
"descOrder": false,
"showHeader": true,
"show": false,
"customSize": "auto",
"position": "right-top",
"inside": false
},
"axisMode": "sync",
"tooltip": {
"content": {
"legend": {
"showBinLabel": true,
"measures": [],
"showNullValues": true,
"customizeLegend": false,
"showPercentage": true,
"showDimensions": true,
"showMeasures": true,
"dimensions": []
}
}
},
"visualizationType": "time",
"missingValue": "connect",
"dashLine": {
"measures": "",
"showDashLine": false
},
"exploreLink": false,
"timeAxis": {
"showTitle": false,
"predictiveLine": {
"color": "#9271E8",
"label": "TODAY"
},
"showAxis": true,
"title": ""
},
"title": {
"fontSize": 14,
"subtitleFontSize": 11,
"label": "",
"align": "center",
"subtitleLabel": ""
},
"trellis": {
"flipLabels": false,
"showGridLines": true,
"size": [
100,
100
],
"enable": false,
"type": "x",
"parameters": {},
"chartsPerLine": 4
},
"totalLabel": "",
"fillArea": true,
"showActionMenu": true,
"showZero": true,
"measureAxis2": {
"sqrtScale": false,
"showTitle": true,
"showAxis": true,
"title": "",
"customDomain": {
"showDomain": false
}
},
"measureAxis1": {
"sqrtScale": false,
"showTitle": false,
"showAxis": true,
"referenceLines": [
{
"color": "#2EC2BA",
"label": {
"data": "Quota - $ {{coalesce(cell(kpi_quota.result, 0, \"sum_quota\"),0).asObject()}}",
"type": "static"
},
"value": {
"data": "{{coalesce(cell(kpi_quota.result, 0, \"sum_quota\"), 0).asObject()}}",
"type": "static"
}
}
],
"title": "",
"customDomain": {
"showDomain": false
}
},
"valueType": "none",
"step": "time_chart_forecast_NEW",
"theme": "dark",
"applyConditionalFormatting": false,
"drawArea": {
"measure": "",
"showDrawArea": false,
"bounding1": "",
"bounding2": ""
}
},
"type": "chart"
}

Hi Experts,
 
I have a requirement where I need to delete Manually assigned territories for the accounts.
On Account, we have checkboxes like AccountManager__c, and InsideSales__c when I uncheck these checkboxes I need to delete related Assigned territories. I have written code that is working perfectly for the one checkbox, however, when I included the next condition that is InsideSales__c problem started, even if I uncheck one checkbox it is removing both the territories. can anyone help me out?
public class Accounthandler
{
    public static void manualTerritory(list<account>newAccounts,Map<id,Account>oldAccounts)
    {  
        list<Id>accountIds= new list<Id>();
        list<Id>accountuserterritaryIds=new list<Id>();
        list<Id>territoryIds= New list<Id>();
        list<Id>userterritaryAsication= new list<Id>();
        list<Id>deletedterrirotarIds= new list<Id>();
        
        for(Account acc: newAccounts)
        {
            Account oldAcc=oldAccounts.get(acc.id);
            
            if((acc.AccountManager__c==False && acc.AccountManager__c !=oldAcc.AccountManager__c)
			||(acc.InsideSales__c==False && acc.InsideSales__c !=oldAcc.InsideSales__c))
            {
                accountIds.add(acc.id);
                
            }
            
        }
        if(accountIds.size()>0)
        {
            list<AccountUserTerritory2View>accuserTerrtrView=[select id,RoleInTerritory2,Territory2Id,AccountId from AccountUserTerritory2View where accountid in: accountIds];
            if(accuserTerrtrView.size()>0)
            {
                For(AccountUserTerritory2View accuserview: accuserTerrtrView)
                {
                    if((accuserview.RoleInTerritory2=='Z2' && accuserview.account.AccountManager__c==False && accuserview.account.AccountManager__c !=oldAcc.AccountManager__c)
					||(accuserview.RoleInTerritory2=='Z4' && accuserview.account.InsideSales__c==False && accuserview.account.InsideSales__c !=oldAcc.InsideSales__c))
                    {
                        accountuserterritaryIds.add(accuserview.AccountId);
                        territoryIds.add(accuserview.Territory2Id);
                    }
                }
                
                List<ObjectTerritory2Association> manualTerritoryAssignments = [SELECT Id,ObjectId,Territory2Id,SobjectType  FROM ObjectTerritory2Association WHERE AssociationCause = 'Territory2Manual' AND Territory2Id IN :territoryIds AND ObjectId in:accountuserterritaryIds ];
                
                if(manualTerritoryAssignments.size()>0)
                {
                    delete manualTerritoryAssignments;
                }
                
            }
        }
    } 
}

 
Hi Team,

Please let me know the solution to share the note created on Mobile and internal users to the admin to create the report for all the users. As of now the user who created the note and shared it with another user can only view it. Please let me know any OOB or trigger logic to achieve this. Please share if you have a snippet of the code.

Thanks

Nowshad