• Ramanjaneya Reddy kalutla
  • NEWBIE
  • -1 Points
  • Member since 2017

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

I want to use  Microsoft Bing Map in a Lightning App.
I get CORS  issue :
Access to XMLHttpRequest at 'https://www.bing.com/rb/3x/cj,nj/0ba6db4b/2acb1961.js?bu=B-8EgQWfBaEF4QSkBfQE' from origin 'https://xxxxx.visual.force.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. 
 But  the I enter the Entpoint in CORS section.
So the structure I have is this:

Record of Custom Object Type A has a related list of multiple records of Custom Object Type B.


And this is what I'm looking to do:

Object Type B has a Currency field, and Object Type A has a field that is inteded to be the Sum of that Currency field for all records in the related list. Whenever any record of Object Type B is updated, I need the Sum field on Object Type A to calculate the new sum. (Essentially it is a rollup sum, but I cannot use a rollup field because these do not have a Master-Detail relationship.)


Example:

Initial State:
  • Object Type A Record SumField = 100
    • Related ObjectB Record 1 CurrencyField = 50
    • Related ObjectB Record 2 CurrencyField = 30
    • Related ObjectB Record 3 CurrencyField = 20
User Action:
  • Related ObjectB Record 2 CurrencyField is changed from 30 to 80
Desired End State:
  • Object Type A Record SumField = 150
    • Related ObjectB Record 1 CurrencyField = 50
    • Related ObjectB Record 2 CurrencyField = 80
    • Related ObjectB Record 3 CurrencyField = 20
Hi,

I'm stuck at this one. I'm trying to fetch fields from a related list but this ain't working for a custom object. This is my situation:
The Object Account has a related list that links to a child Custom Object named Account Locations. I want to fetch fields from this related list so I can show them in Google Maps as markers. This works for Contacts but for my custom object Account Locations this ain't working.
This is the controller:
public class AccountLocations {
    public Account AccountInformation {get; set;}

    public List<Account_Location__c> AllAccounts  {get; set;}
    
    public AccountLocations(ApexPages.StandardController controller) {

        AccountInformation = (Account)controller.getRecord();
    }
 
    public void fetchtAllRelatedAccountLocations(){

    AllAccounts =
            [
                SELECT Id, Location_Name__c, Location_Street__c, Location_Postal_Code__c, Location_City__c, Location_Country__c
                FROM Account_Location__c
                WHERE Id = :AccountInformation.Id
            ];
    }
}

Hope someone has a solution or idea for this. 

Kind regards!