• Zuinglio Lopes Ribeiro Júnior
  • PRO
  • 2455 Points
  • Member since 2014
  • Mr
  • VASS


  • Chatter
    Feed
  • 75
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 342
    Replies
Hi,

I am trying to show the data on jquery data table through js remoting. I am using this because i want to show more than 1k records in table. but my data is not going. one or the other error is coming. 

This is my code:
function rebuildTable_applyFilterTable() {
             
            j$('[id$="applyFilterTable"]').DataTable({
                "data" : JSON.parse('{!JSENCODE(payload)}'),
                "scrollY": "260px",
                "scrollCollapse": true,
                "paging": true,
                "searching": true,
                "ordering": true,
                "info": true,
                "dom": 'Bfrtip',
                "buttons": [
                    'copy',
                    {extend: 'csvHtml5',title: 'Criteria export'},
                    {extend: 'excelHtml5',title: 'Criteria export'},
                    {extend: 'pdfHtml5',title: 'Criteria export'},
                    'print'
                ],
                "columns": [
                            { title: "SID" },
                            { title: "FirstName" },
                            { title: "LastName" },
                            { title: "StudentLog" },
                            { title: "ConsoleView" },
                            { title: "ListOfMajors" },
                            { title: "ListOfMinors" },
                            { title: "GPA" },
                            { title: "CreditHours" },
                            { title: "CurrentCreditHours" },
                            { title: "Privacy" },
                            { title: "CurrentlyEnrolled" }
                        ]
            } );
        }

 Visualforce.remoting.Manager.invokeAction(
                '{!$RemoteAction.adv_CriteriaCreateController.getContacts}',
                 rateOverrideArray[0],
                '{!sortExpression}',
                '{!sortDirection}',
                function(result, event){
                    if (event.status) {
                       
                        // var html = $("#contactTableRowTmpl").render(result);
                        //document.getElementById("#contactTableRowTmpl").innerHTML = result;
                      
                        //replace the table body with rendered html
                        //$("#contactTableBody").html(document.getElementById("#contactTableRowTmpl").innerHTML);
                       
                        rebuildTable_applyFilterTable();
                        
                        
                    } else if (event.type === 'exception') {
                        document.getElementById("responseErrors").innerHTML = 
                            event.message + "<br/>\n<pre>" + event.where + "</pre>";
                    } else {
                        document.getElementById("responseErrors").innerHTML = event.message;
                    }
                }, 
                {escape: true}
            );

This result is getting data , i checked about it.

how do i push it to table?​ I am not saying use the below table but i even tried the js script as well. can you make it work?
<table id="applyFilterTable" />

 
Help on passing test class.  I just need 5 lines more.  it's at 67%  The class is long I only added what's red and not passing.
 
public void send() {
        try {
            DM_Public_Page_URL__c siteCS = DM_Public_Page_URL__c.getValues('Default');
            String siteURL = siteCS.Site_URL__c;
            String logo = siteCS.Logo__c;
            
            List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
            EmailTemplate emailT = [select Subject, HtmlValue from EmailTemplate where DeveloperName = 'Contact_Form' limit 1];
            
            for(Contact primaryContact : primaryContactList) {
                String body = emailT.HtmlValue.replace('{account_form}', siteURL + '/apex/AccountFormPage?id=' + accountId);
                body = body.replace('{primary_contact_name}', primaryContact.FirstName);
                body = body.replace('{account_name}', accountName);
               body = body.replace('{account_logo}', '<img src="'+siteURL + Logo+'"alt="Logo" height="225px" width="74px"');
                
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                mail.setToAddresses(new String[]{primaryContact.Email});
                mail.setSubject(emailT.Subject);
                mail.setHtmlBody(body);
                mails.add(mail);
            }
            
            List<Messaging.SendEmailResult> results = Messaging.sendEmail(mails);
            if(results[0].isSuccess()) {
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.CONFIRM, 'Contact email successfully sent'));
            } else {
                System.debug('------------------- errors: ' + results[0].getErrors());
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Error while sending the contact update email: ' + results[0].getErrors()));
            }
        } catch(Exception e) {
            System.debug('------------------- ERROR: ' + e.getStackTraceString());
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Error while sending the contact update email: ' + e.getStackTraceString()));
            
        }
    }
    
    public PageReference cancel() {
        PageReference pref = new PageReference('/' + accountId);
        return pref;
    }
}


This is my test class

@isTest
private class AccountFormControllerTest {

    private static testMethod void test() {
        Account lender = new Account();
        lender.Name = 'Test Account';
        insert lender;
        System.debug('created account');
        
        Contact c = new contact();
        c.FirstName = 'JOhn';
        c.LastName = 'Doe';
        c.email='test@test.com';
        c.primary_contact__c = True;
        insert c;
        System.debug('created account');
                
        ApexPages.currentPage().getParameters().put('id', lender.Id);
        AccountFormController controller = new AccountFormController();
        controller.accountUpdate.Equity_Debt__c = 'Debt';
        controller.save();
        
        string options = controller.getOptions();
    }
    
    private static testMethod void test2() {
        Contact ca = new Contact();
            ca.FirstName = 'John';
            ca.LastName = 'Doe';
            ca.email='test@test.com';
            ca.Primary_Contact__c = true;
    
        ApexPages.currentPage().getParameters().put('id', 'some id');
        AccountFormController controller = new AccountFormController();
        controller.save();
        
        AccountFormController controller2 = new AccountFormController();
        controller2.save();
        
        ApexPages.currentPage().getParameters().put('id', '');
        AccountFormController controller3 = new AccountFormController();
        controller3.save();
        
        try{
        Insert ca;
        }
        catch(Exception ee){
        }   
    }
    
}
This is whats not passing...
 
String body = emailT.HtmlValue.replace('{account_form}', siteURL + '/apex/AccountFormPage?id=' + accountId);
                body = body.replace('{primary_contact_name}', primaryContact.FirstName);
                body = body.replace('{account_name}', accountName);
               body = body.replace('{account_logo}', '<img src="'+siteURL + Logo+'"alt="Logo" height="225px" width="74px"');
                
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                mail.setToAddresses(new String[]{primaryContact.Email});
                mail.setSubject(emailT.Subject);
                mail.setHtmlBody(body);
                mails.add(mail);
            }

 
The instructions given in the second unit of the Company-Wide Org Settings module appear to be inaccurate. To enable Advanced Currency Management I was unable to find Manage Currencies (or anything associated with currencies) on the Settings Quicklist. To get around this, I navigated to Company Information & clicked on Currency Setup (after activating multiple currencies.) Only from there could I enable Advanced Currency Management, and complete the instructions to set the Corporate Currency, and Update Currency Rates. Hopefully this helps someone else if they are stuck like I was!
Hello,

For some reason, all of the values inside my table are blue and clickable as if they had a hyperlink attached to them. But when you click on the values nothing happens

Does anyone know why this happening and how I can make the text black with no hyperlink type functionality?

Below is a photo of the table rendering the values and my code:

User-added image
 
<apex:page standardcontroller="X2067__c" showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">
<head>
  <!-- Import the Design System style sheet -->
  <apex:slds />
</head>
    <body class="slds-scope">        
        <div class="slds-grid slds-grid_vertical-align-end slds-grid_align-spread" style="height:100px">
            <div class="slds-col slds-p-horizontal_medium">
                <span><apex:image url="/servlet/servlet.FileDownload?file=0152F0000000YbI" width="256" height="150"/> </span>
            </div>
            <div class="slds-col slds-text-heading_large slds-text-align_center">
                <span>Case Information</span>
            </div>
            <div class="slds-col slds-p-horizontal_medium slds-text-heading_medium slds-text-align_right">
                <span>Form 2068<br></br>December 2012-E</span>
        </div>        
    </div>

  <!-- REQUIRED SLDS WRAPPER -->
  <div class="slds-scope" style="float:Left; position:absolute; width:100%">
    <!-- MASTHEAD -->
      <br></br>
    <p class="slds-text-heading--label slds-m-bottom--small">
      To:  
        </p>
        <apex:outputField value="{!X2067__c.Payer_Name__c}"/><br/>
    	<apex:outputField value="{!X2067__c.Payer_Fax_Number__c}"/>
      <br></br>  <br></br>  <br></br>
    <div class="slds-scope" style="float:Left; position:absolute; width:100%">  
<table class="slds-table slds-table_bordered slds-table_cell-buffer">
  <thead>
    <tr class="slds-text-title_caps">
      <th scope="col">
        <div class="slds-truncate" title="Case Name">Case Name</div>
      </th>
      <th scope="col">
        <div class="slds-truncate" title="Category 1">Category</div>
      </th>
      <th scope="col">
        <div class="slds-truncate" title="Case Number 1">Case Number</div>
      </th>
      <th scope="col">
        <div class="slds-truncate" title="Category 2">Category</div>
      </th>
      <th scope="col">
        <div class="slds-truncate" title="Case Number 2">Case Number</div>
      </th>
    </tr>
  </thead>
    <tbody>
    <tr>
      <td scope="row" data-label="Case Name">
        <div class="slds-truncate" title="Current Case Name"><a>{!x2067__c.Case_Name__c}</a></div>
      </td>
      <td scope="row" data-label="Category 1">
        <div class="slds-truncate" title="Category 1"><a>PERS</a></div>
      </td>
        <td scope="row" data-label="Case Number 1">
        <div class="slds-truncate" title="Case Number 1"><a>1234567</a></div>
      </td>
      <td scope="row" data-label="Category 2">
        <div class="slds-truncate" title="Category 2"><a></a></div>
      </td>
        <td scope="row" data-label="Case Number 2">
        <div class="slds-truncate" title="Case Number 2"><a></a></div>
      </td>
        </tr>
  </tbody>
</table>
<table class="slds-table slds-table_bordered slds-table_cell-buffer">
  <thead>
    <tr class="slds-text-title_caps">
      <th scope="col">
        <div class="slds-truncate" title="Current Address">Adress(Street, City, Zip Code)</div>
      </th>
      <th scope="col">
        <div class="slds-truncate" title="Category 1">Area Code and Telephone No</div>
      </th>
    </tr>
  </thead>
    <tbody>
    <tr>
      <td scope="row" data-label="Current Address">
        <div class="slds-truncate" title="Current Adress"><a>{!x2067__c.Service_User_Address__c}</a></div>
      </td>
        <td scope="row" data-label="Area Code and Telephone No">
        <div class="slds-truncate" title="Area Code and Telephone No"><a>(480)7205699</a></div>
      </td>
        </tr>
  </tbody>
</table>
    <br></br><br></br>
<Div>
    <apex:outputLabel>Reason for 2067: </apex:outputLabel> <br></br>
    <apex:outputField  label="Reason for 2067" value="{!X2067__c.Reason_for_2067__c}"/>
</Div>
  <br></br>
<div>
    <span>
        <apex:outputLabel>Comments/Response: </apex:outputLabel> <br></br>
    <apex:outputField  label="Comments/Response" value="{!X2067__c.Comment_Response__c}"/>
</span>
</div>
</div>
    </div>
    <div class="slds-scope" style="float:Right;">
    <p class="slds-text-heading--label slds-m-bottom--small"> <br></br>
      From:  
        </p>
        Alex Waddell<br/>
    	1234 West East Street Tempe, AZ 85281

  </div>
<br></br>


  <!-- / REQUIRED SLDS WRAPPER -->
</body>
</apex:page>

 
Hello, 

Has anyone else been able to reduce these error messages through programmatic means? These errors seem to be coming from a managed package which, in my experience, have been very difficult to to intercept or interpret code wise. The npsp class is why I know this is the Non-Profit Success Pack at work. Does anyone have experience specifically with identifying the types of processes which would be causing this? I believe that it is mass data manipulation, or users uploading many records into the system.

Thank You,

Frances Allen 
Hello,

I currently have a Data table that is only taking up half the width of the page. I was wondering how I can extend the width of the table to cover the full width of the vf page

I have tried to add the "slds-size--1-of-1" to the table class but either that is wrong or i am doing something wrong

Below is a photo of the table(s) and my code 

User-added image
 
<apex:page standardcontroller="X2067__c" showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">
<head>
  <!-- Import the Design System style sheet -->
  <apex:slds />
</head>
    <body class="slds-scope">        
        <div class="slds-grid slds-grid_vertical-align-end slds-grid_align-spread" style="height:100px">
            <div class="slds-col slds-p-horizontal_medium">
                <span><apex:image url="/servlet/servlet.FileDownload?file=0152F0000000YbI" width="256" height="150"/> </span>
            </div>
            <div class="slds-col slds-text-heading_large slds-text-align_center">
                <span>Case Information</span>
            </div>
            <div class="slds-col slds-p-horizontal_medium slds-text-heading_medium slds-text-align_right">
                <span>Form 2068<br></br>December 2012-E</span>
        </div>        
    </div>

  <!-- REQUIRED SLDS WRAPPER -->
  <div class="slds-scope" style="float:Left; position:absolute;">
    <!-- MASTHEAD -->
      <br></br>
    <p class="slds-text-heading--label slds-m-bottom--small">
      To:  
        </p>
        <apex:outputField value="{!X2067__c.Payer_Name__c}"/><br/>
    	<apex:outputField value="{!X2067__c.Payer_Fax_Number__c}"/>
      <br></br>  <br></br>  <br></br>
    <div class="slds-scope" style="float:Left; position:absolute;">  
<table class="slds-table slds-table_bordered slds-table_cell-buffer">
  <thead>
    <tr class="slds-text-title_caps">
      <th scope="col">
        <div class="slds-truncate" title="Case Name">Case Name</div>
      </th>
      <th scope="col">
        <div class="slds-truncate" title="Category 1">Category</div>
      </th>
      <th scope="col">
        <div class="slds-truncate" title="Case Number 1">Case Number</div>
      </th>
      <th scope="col">
        <div class="slds-truncate" title="Category 2">Category</div>
      </th>
      <th scope="col">
        <div class="slds-truncate" title="Case Number 2">Case Number</div>
      </th>
    </tr>
  </thead>
    <tbody>
    <tr>
      <td scope="row" data-label="Case Name">
        <div class="slds-truncate" title="Current Case Name"><a>{!x2067__c.Case_Name__c}</a></div>
      </td>
      <td scope="row" data-label="Category 1">
        <div class="slds-truncate" title="Category 1"><a>PERS</a></div>
      </td>
        <td scope="row" data-label="Case Number 1">
        <div class="slds-truncate" title="Case Number 1"><a>1234567</a></div>
      </td>
      <td scope="row" data-label="Category 2">
        <div class="slds-truncate" title="Category 2"><a></a></div>
      </td>
        <td scope="row" data-label="Case Number 2">
        <div class="slds-truncate" title="Case Number 2"><a></a></div>
      </td>
        </tr>
  </tbody>
</table>
<table class="slds-table slds-table_bordered slds-table_cell-buffer">
  <thead>
    <tr class="slds-text-title_caps">
      <th scope="col">
        <div class="slds-truncate" title="Current Address">Adress(Street, City, Zip Code)</div>
      </th>
      <th scope="col">
        <div class="slds-truncate" title="Category 1">Area Code and Telephone No</div>
      </th>
    </tr>
  </thead>
    <tbody>
    <tr>
      <td scope="row" data-label="Current Address">
        <div class="slds-truncate" title="Current Adress"><a>{!x2067__c.Service_User_Address__c}</a></div>
      </td>
        <td scope="row" data-label="Area Code and Telephone No">
        <div class="slds-truncate" title="Area Code and Telephone No"><a>(480)7205699</a></div>
      </td>
        </tr>
  </tbody>
</table>



</div>
    </div>
    <div class="slds-scope" style="float:Right;">
    <p class="slds-text-heading--label slds-m-bottom--small"> <br></br>
      From:  
        </p>
        Alex Waddell<br/>
    	1234 West East Street Tempe, AZ 85281

  </div>
<br></br>


  <!-- / REQUIRED SLDS WRAPPER -->
</body>
</apex:page>



 
Hi All,

I have created 3 Lightning Component Lets say

Component1
Component2
Component3

I am overriding New button of Lead Object and calling Component1.

From Component 1 I am navigating to Component 2 and from Component 2 to Component 3

My Problem is Once I navigate to Component 3 and abort my operation at Component 3 and next Time I click on New button it is directly Jumping to Component 3 with previous prefilled values. Ideally It should reinitate the process and Component 1 should load with blank fields.

Please help me in solving this issue.

Thanks in Advance.

Hi there,
Anyone know the best way to get multiple records using the same EXTERNAL_ID?
Our case is that we have more than one Salesforce contact using the same email (external_id) and the follow request is causing 300 Multiple Choices:

```

curl https://yourInstance.salesforce.com/services/data/v20.0/sobjects/Contact/Email/foo@example.com -H "Authorization: Bearer token"

```

 

Thanks for your time.

Juan Ramon Cañizares Gomez.

I am new to the developer part of Salesforce and am not familiar with code, etc.  I have successfully deleted an Apex Class from my Sandbox environment but don't know how to now delete it from Production. Please can some help?
We are trying to do Bulk Upsert for Contacts and map all the new contacts that are are upserted with an existing Account Id. So while preparing the CSV we are using Account.Id and the value is the actual Id of the account for all CSV records. However I seem to get an error 
INVALID_FIELD:Field name provided, Id is not an External ID or indexed field for Account:--

As per the documentation https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_csv_rel_field_header_row.htm any indexed fields can be used. And Describe response for account clearly says idLookup property for Id field is set to true. Can anybody help why this is failing?
Hi,

I am facing a strange issue.
I am trying to create a record using lightning:frecordEditForm but not able to create a record.
I have a master detail relationship field "Account" on object "Book". When I have change the relation to lookup it is working. But for master detail relationship it is not working. Please help me.

Below is the code
<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes">
     <aura:attribute name="recordId" type="Id"/>
     
    <lightning:recordEditForm  objectApiName="Book__c">
        <lightning:messages />
        <lightning:inputField fieldName="Name" />
        <lightning:inputField fieldName="Account__c"/>
        
        <lightning:button class="slds-m-top_small" type="submit" label="Create" />
    </lightning:recordEditForm>

</aura:component>

This is the error I am getting
User-added image
 
 
It was my understanding after reading a few different posts and articles like this one that custom metadata types could have unlimited SOQL queries in a single Apex transaction. To give you an idea of the code that I'm using, it's designed to find a set of values (stored in custom metadata) to apply to an opportunity based off of some criteria pulled from the opp. When I tried to run this to update opps in bulk, it failed on the SOQL query error. My query:
List<Channel_Discount__mdt> chanSetting = [SELECT Direct__c,Fulfillment__c,Authorized__c,Certified__c,Regions__c,Excluded_Countries__c FROM Channel_Discount__mdt WHERE Discount__c = :w AND Distributor_Type__c = :distType AND Business_Type__c = :bisType];

Am I misunderstanding what is meant by "unlimited" queries?

I am having a really weird issue with apex:InputFile.  I hide it until the user clicks on a button.  When I show it the first time and do a save, nothing goes back to the controller.  The value of my Blobs are null.

If I show it again and pick a file it works fine.

I added a text field to my dialog for testing purposes.  The text box always works.  The inputFile never works on the first call, but works fine after that.  Any suggestions on what I need to change

Here is the markup for my dialog with the Apex:InputFiles 

         <apex:outputPanel id="UploadPicture">
            <apex:outputPanel rendered="{!ShowUploadPicture}" layout="block" styleClass="SaveModal">
                     <div class="dmodal"  id="pictureModal" tabindex="-1" role="dialog" >
                        <div class="modal-dialog modal-dialog-centered"  role="document">
                            <div class="modal-content opaque">
                                
                                <div class="modal-header">
                                    <h1 class="modal-title">Upload Files</h1>
                                  </div>
  
                                <div class="modal-body">
                                    <apex:actionRegion >
                                        <apex:inputText value="{!DummyText}" label="Dummy Text"/>
                                        <apex:outputPanel layout="block" styleclass="panel panel-default" style="margin:20px;" >
                                            <apex:outputpanel layout="block" styleclass="panel-body">
                                                <div class="col-xs-12 col-sm-12 col-md-12 text-center">
                                                    <H4>Inside Store Photo</H4>
                                                    <div class="row" style="height:120px;">
                                                        <apex:outputPanel styleclass="glyphicon glyphicon-ok-circle upOk" html-aria-hidden="true" rendered="{!NOT(ISNULL(InsideStorePhoto.Id))}"></apex:outputPanel>         
                                                        <apex:image url="{!URLFOR($Resource.rvie_img_place)}" height="100" alt="" rendered="{!ISNULL(InsideStorePhoto.Id)}" />
                                                        <apex:image url="{!URLFOR($Action.Attachment.Download, InsideStorePhoto.Id)}" height="100"
                                                                    html-onerror="this.src='{!$Resource.no_preview}'" alt="Preview not supported" rendered="{!NOT(ISNULL(InsideStorePhoto.Id))}"
                                                                    onclick="window.open('{!URLFOR($Action.Attachment.Download, InsideStorePhoto.Id)}','_blank','toolbar=yes, scrollbars=yes, resizable=yes');" />
                                                    </div>
                                                    <apex:outputPanel layout="block" styleclass="row" >
                                                        <label class="btn btn-default btn-file">
                                                             Select a Picture<apex:inputfile value="{!IBody}" contentType="image" filename="{!InsideStoreBody.Name}" onchange="previewFileAll(this)" style="display:none;"/><!----->
                                                           <br/>{!InsideStoreBody.Name}
                                                        </label>
                                                    </apex:outputPanel>
                                                </div>
                                            </apex:outputpanel>
                                        </apex:outputPanel>
                                        <apex:outputPanel layout="block" styleclass="panel panel-default" style="margin:20px;" >
                                            <apex:outputpanel layout="block" styleclass="panel-body">
                                                <div class="col-xs-12 col-sm-12 col-md-12 text-center">
                                                    <H4>Overall Photo</H4>
                                                    <div class="row" style="height:120px;">
                                                        <apex:outputPanel styleclass="glyphicon glyphicon-ok-circle upOk" html-aria-hidden="true" rendered="{!NOT(ISNULL(OverallPhoto.Id))}"></apex:outputPanel>         
                                                        <apex:image url="{!URLFOR($Resource.rvie_img_place)}" height="100" alt="" rendered="{!ISNULL(OverallPhoto.Id)}" />
                                                        <apex:image url="{!URLFOR($Action.Attachment.Download, OverallPhoto.Id)}" height="100"
                                                                    html-onerror="this.src='{!$Resource.no_preview}'" alt="Preview not supported" rendered="{!NOT(ISNULL(OverallPhoto.Id))}"
                                                                    onclick="window.open('{!URLFOR($Action.Attachment.Download, OverallPhoto.Id)}','_blank','toolbar=yes, scrollbars=yes, resizable=yes');" />
                                                    </div>
                                                    <apex:outputPanel layout="block" styleclass="row" >
                                                        <label class="btn btn-default btn-file">
                                                            Select a Picture<apex:inputfile value="{!OBody}" contentType="image" filename="{!OverallBody.Name}" onchange="previewFileAll(this)" style="display:none;" /><!----->
                                                            <br/>{!OverallBody.Name}
                                                       </label>
                                                    </apex:outputPanel>
                                                </div>
                                            </apex:outputpanel>
                                        </apex:outputPanel>
                                        <apex:outputPanel layout="block" styleclass="panel panel-default" style="margin:20px;" >
                                            <apex:outputpanel layout="block" styleclass="panel-body">
                                                <div class="col-xs-12 col-sm-12 col-md-12 text-center">
                                                     <H4>Restroom Photo</H4>
                                                   <div class="row" style="height:120px;">
                                                        <apex:outputPanel styleclass="glyphicon glyphicon-ok-circle upOk" html-aria-hidden="true" rendered="{!NOT(ISNULL(RestroomPhoto.Id))}"></apex:outputPanel>         
                                                        <apex:image url="{!URLFOR($Resource.rvie_img_place)}" height="100" alt="" rendered="{!ISNULL(RestroomPhoto.Id)}" />
                                                       <apex:image url="{!URLFOR($Action.Attachment.Download, RestroomPhoto.Id)}" height="100"
                                                                   html-onerror="this.src='{!$Resource.no_preview}'" alt="Preview not supported" rendered="{!NOT(ISNULL(RestroomPhoto.Id))}"
                                                                   onclick="window.open('{!URLFOR($Action.Attachment.Download, RestroomPhoto.Id)}','_blank','toolbar=yes, scrollbars=yes, resizable=yes');" />
                                                    </div>
                                                    <apex:outputPanel layout="block" styleclass="row" >
                                                        <label class="btn btn-default btn-file">
                                                            Select a Picture<apex:inputfile value="{!RBody}" contentType="image" filename="{!RestroomBody.Name}" onchange="previewFileAll(this)" style="display:none;"/><!----->
                                                            <br/>{!RestroomBody.Name}
                                                        </label>
                                                    </apex:outputPanel>
                                                </div>
                                            </apex:outputpanel>
                                        </apex:outputPanel>
                                    <!-->/div>
                                   <div class="modal-footer"-->
                                        <apex:commandbutton value="Save" action="{!SavePicture}" /> <!--reRender="UploadPicture, pbTable"/-->
                                        <apex:commandbutton immediate="true"  html-data-dismiss="modal" value="Cancel" action="{!HidePicture}"/> <!--reRender="UploadPicture, pbTable"/-->
                                    </apex:actionRegion>  
                                 </div>
 
                             </div>
                        </div>
                    </div>
             </apex:outputPanel>
        </apex:outputPanel>

Is there anything I need to do with my Blob Variables before my first call to make this work on the first time.
 

I have a requirement where i need to merge all accounts if a particular field vendor_code__c value is duplicate.There is also a condition that the account of record type 'A' needs to be the master and record type 'B' needs to be the dupliacte. I have written  a batch code for this fucntionality.I am not getting any errors but the accounts are not getting merged either. Kindly help!

global class BatchVendorAccountMerge implements database.Batchable<sobject>   {

    global  database.QueryLocator start(Database.BatchableContext ctx){
        string query;
        query = 'SELECT Id, Type, RecordTypeId,Record_Type__c, Name, MasterRecordId, Vendor_Code__c FROM Account';
                   
        return database.getQuerylocator(query);
        
    }
    
    global void execute(Database.BatchableContext BC, list<account> scope ){
        
     //create a map with vendor code and its account        
            
        //to store all unique vendor codes
        Set<string> strVC = new Set<string>();
        
         //create a map with vendor code and its account        
        map<string,list<account>> vendoraccmap = new map<string,list<account>>();
        
        
        for(account a:scope){
            
            strVC.add(a.Vendor_Code__c);
                        
            if(vendoraccmap.containskey(a.Vendor_Code__c)) {
              vendoraccmap.get(a.Vendor_Code__c).add(a);
            } else {
                vendoraccmap.put(a.Vendor_Code__c, new List<account> {a});
           
        } 
        }
       system.debug('****Unique vendor codes***'+strVC);
        system.debug('****vendor and acc map***'+vendoraccmap);
        
       Account masteracc = new account();
        list<account> dupacc = new list<account>();
            
        for(string v:vendoraccmap.keySet()){
            if(vendoraccmap.get(v).size() > 1)               
                
            
                system.debug('**vendoraccmapsize**'+vendoraccmap.get(v).size());
            {  
          
                for(Account a:vendoraccmap.get(v)) 
                {
                    if(a.Record_Type__c == 'A'){
                        masteracc.id=a.id;
                    }
                     else  if (a.Record_Type__c == 'B') {
                        dupacc.add(a);
                    }
                    
                     
                }
                
                system.debug('***Master account***'+masteracc);
                system.debug('***Duplicate accounts***'+dupacc);
            }
        }
        
        
        Database.MergeResult[] results = Database.merge(masteracc, dupacc, false);
      
        
        
     system.debug('***results merged**'+results);
        
       for(Database.MergeResult res : results) {
          if (res.isSuccess()) {
              System.debug('Master record ID: ' + res.getId());
        System.assertEquals(masteracc.Id, res.getId());               
        
      
        List<Id> mergedIds = res.getMergedRecordIds();
        System.debug('IDs of merged records: ' + mergedIds);                
        
                   
    }
    else {
        for(Database.Error err : res.getErrors()) {
            
            System.debug(err.getMessage());
        }
       }
    
     }
    }
    
    
     global void finish(Database.BatchableContext BC){
         
    }

    
    
}
Hi,
I ma developing a personal application. In it, my code is doing the following:
- Create a debug log level, if it is not there. If it is there, fetch it
- Create a user trace flag with the above debug log level, if it is not for logged in user. If it is there, reset the start and end time
- use system.debug in many places

So, my expectation is that a user trace flag will be automatically created or reset, when this code is executed.
The first two steps are being executed successfully.

But...

For the first time, that is, when the user trace flag will be created, no debug log will be generated. But for the subsequent executions, debug logs will be created as the user trace flag is already there.

That, I observed that no debug logs will be generated in a transaction for a user trace flag, if that user trace flag is dynamically created in same transaction. Is there any way to overcome this issue?

Thanks in advance.
Shabu
I can use /services/data/v41.0/composite/tree/sObject/ successfully but not /services/data/v41.0/composite/I can use /services/data/v41.0/composite/tree/sObject/ but not /services/data/v41.0/composite/