• Ken Brill
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

We are moving from SugarCRM to Salesforce, For another month we are going to work Cases on SugarCRM so I need Salesforce to keep Account data synced up. I want new and updated Accounts sent to SugarCRM. So I have this APEX that I am calling from a flow.

public class httpSugarCRM {
@InvocableMethod(label ='Update Account on SugarCRM' description='Sends the Account as an update to SugarCRM')
    public static List<String> sugarAccountUpdate(List<String> sfid) {
        String data = '';
        List<String> returnVarList = new List<String>();
        //Load the Account Object
        Account account = [Select Id,OwnerId,Name,Description,ExternalSystemID__c,BillingStreet,BillingCity,BillingState,BillingPostalCode,ShippingStreet,ShippingCity,
                                    ShippingState,ShippingPostalCode,Shipping_Email__c,DealerID__c,Billing_ID__c,Dealer_Type__c,AuthorizedContactPhone__c,AuthorizedContactEmail__c,
                                    AuthorizedContactName__c,AuthorizedContactTitle__c,AuthorizedContactFax__c,dba__c,Organizational_Country__c,OrganizationalState__c,
                                    Full_Legal_Entity_Name__c,CoveredByALS__c,IsSuspended__c,Billing_Phone__c,Billing_Email__c,Billing_Contact__c,BillingContactID__c,
                                    Tax_Exemption__c,UcaaSMode__c,AssignedTerritory__c,SubAgentSubResellerof__c,PartnerLeadSource__c,SalesArea__c,Website,Abnormal_Commissions__c,
                                    Industry,AnnualRevenue,Fax,Phone,Alternate_Phone__c,ConfigurationCertification__c,OnlineSalesTraining__c,OwnerCertified__c,OwnerRecertification__c,
                                    Closing_Estimate__c,Dead_Updated__c,Ignore_Dealer_in_Report__c,Inactive__c,InvoicedOn__c,PaidforDemoKitOn__c,PaidforTrainingOn__c,
                                    Partner_Type__c,ShippedDemoKitOn__c,Signed_Agreement_On__c,Signed_NDA_On__c,Strategic_Partner__c,Timezone__c,Associated_RVP_ID__c,
                                    PartnerState__c,PaidInHouseSystemon__c,PaidMarketingPackageon__c
                                    from Account where id IN :sfid] ;
        System.debug(account.Name);
        data = JSON.serialize(account);
        System.debug(data);
        System.debug('Sending data');
        SendUpdateToSugarCRM(data);
        System.debug('Done sending data');
        returnVarList.add(account.name);
        return returnVarList;
      }
    
    @future(callout=true)
    public static void SendUpdateToSugarCRM(string data){
        System.debug('Sending data');
        //Initialize the URL
        String url='https://myserver.com/rest/v11_5/SalesforceAccounts';
        System.debug('url='+url);
        // Instantiate a new Http object
        Http h = new Http();
        // Instantiate a new HTTP request
        // Specify request properties such as the endpoint, the POST method, etc. 
        HttpRequest req = new HttpRequest();
        req.setEndpoint(url);
        req.setMethod('POST');
        req.setHeader('Content-Type', 'application/json');
        req.setBody(data);
    
        // Send the request, and return a response
        HttpResponse response = h.send(req);
        system.debug('response::'+response.getBody());
    }
}
I am told when it runs I should see 2 log entries but I only see 2 and I never see the call com in on the remote server.

We are moving from SugarCRM to Salesforce, For another month we are going to work Cases on SugarCRM so I need Salesforce to keep Account data synced up. I want new and updated Accounts sent to SugarCRM. So I have this APEX that I am calling from a flow.

public class httpSugarCRM {
@InvocableMethod(label ='Update Account on SugarCRM' description='Sends the Account as an update to SugarCRM')
    public static List<String> sugarAccountUpdate(List<String> sfid) {
        String data = '';
        List<String> returnVarList = new List<String>();
        //Load the Account Object
        Account account = [Select Id,OwnerId,Name,Description,ExternalSystemID__c,BillingStreet,BillingCity,BillingState,BillingPostalCode,ShippingStreet,ShippingCity,
                                    ShippingState,ShippingPostalCode,Shipping_Email__c,DealerID__c,Billing_ID__c,Dealer_Type__c,AuthorizedContactPhone__c,AuthorizedContactEmail__c,
                                    AuthorizedContactName__c,AuthorizedContactTitle__c,AuthorizedContactFax__c,dba__c,Organizational_Country__c,OrganizationalState__c,
                                    Full_Legal_Entity_Name__c,CoveredByALS__c,IsSuspended__c,Billing_Phone__c,Billing_Email__c,Billing_Contact__c,BillingContactID__c,
                                    Tax_Exemption__c,UcaaSMode__c,AssignedTerritory__c,SubAgentSubResellerof__c,PartnerLeadSource__c,SalesArea__c,Website,Abnormal_Commissions__c,
                                    Industry,AnnualRevenue,Fax,Phone,Alternate_Phone__c,ConfigurationCertification__c,OnlineSalesTraining__c,OwnerCertified__c,OwnerRecertification__c,
                                    Closing_Estimate__c,Dead_Updated__c,Ignore_Dealer_in_Report__c,Inactive__c,InvoicedOn__c,PaidforDemoKitOn__c,PaidforTrainingOn__c,
                                    Partner_Type__c,ShippedDemoKitOn__c,Signed_Agreement_On__c,Signed_NDA_On__c,Strategic_Partner__c,Timezone__c,Associated_RVP_ID__c,
                                    PartnerState__c,PaidInHouseSystemon__c,PaidMarketingPackageon__c
                                    from Account where id IN :sfid] ;
        System.debug(account.Name);
        data = JSON.serialize(account);
        System.debug(data);
        System.debug('Sending data');
        SendUpdateToSugarCRM(data);
        System.debug('Done sending data');
        returnVarList.add(account.name);
        return returnVarList;
      }
    
    @future(callout=true)
    public static void SendUpdateToSugarCRM(string data){
        System.debug('Sending data');
        //Initialize the URL
        String url='https://myserver.com/rest/v11_5/SalesforceAccounts';
        System.debug('url='+url);
        // Instantiate a new Http object
        Http h = new Http();
        // Instantiate a new HTTP request
        // Specify request properties such as the endpoint, the POST method, etc. 
        HttpRequest req = new HttpRequest();
        req.setEndpoint(url);
        req.setMethod('POST');
        req.setHeader('Content-Type', 'application/json');
        req.setBody(data);
    
        // Send the request, and return a response
        HttpResponse response = h.send(req);
        system.debug('response::'+response.getBody());
    }
}
I am told when it runs I should see 2 log entries but I only see 2 and I never see the call com in on the remote server.

Hi,

 

We have a set of dependent fields which SF nicely clusters by default into a pop-up window (below). The window size is very small and cumbersome to use.

 

Is there a way to make that window larger?

 

I tried posting an image but doesn't appear to work.

 

Thank you