• BODDH PRAKASH 15
  • NEWBIE
  • 35 Points
  • Member since 2018

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 8
    Replies
Hello 
I cant solve this, maybe someone can help me

System.DmlException: Update failed. First exception on row 0 with id 0066E000004pfWbQAI; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, In the stage Demo, you need to fill in the fields "Scope Test Determined", Testperiod In Salesforce" and Order Task Sent to Salesforce".: []

static testMethod void testClosedWonUpdate_positive_03(){
List<Opportunity> oppList = [SELECT Id, StageName,End_Date_Test_Phase__c FROM Opportunity WHERE Name LIKE 'Test%' LIMIT 1];
Opportunity opp = oppList.get(0);
opp.StageName = 'Test';
Date d = date.today();
opp.End_Date_Test_Phase__c = d.addDays(40);
update opp;
System.debug(' 632 ====> ' + opp);
List<Account> aList = [SELECT Id, Name FROM Account WHERE Name LIKE 'Test%' LIMIT 1];
Account a = aList.get(0);
System.debug(' 636 ====> ' + a);
List<Asset> assets = [SELECT Id, Price_Agreements__c, Price, Status, Product2Id, Test_Asset__c, IsCompetitorProduct
FROM Asset WHERE AccountId = :a.Id];
System.debug(' 640 ====> ' + assets);
System.assertEquals('In test', assets[0].Status);
Test.startTest();
opp.StageName = 'Closed Won';
update opp;
Test.stopTest();
OpportunityLineItem ol = [SELECT OpportunityId FROM OpportunityLineItem WHERE Name LIKE 'Test%'];
List<Asset> assets1 = [SELECT Id, Price_Agreements__c, Price, Product2Id, Test_Asset__c, IsCompetitorProduct
FROM Asset WHERE AccountId = :a.Id];
List<OpportunityLineItem> oliList = [select Id, Asset__c from OpportunityLineItem where Id =: ol.Id LIMIT 1];
System.assertEquals(1, assets1.size());
System.debug(' 657 ====> ' + assets1);
System.assertEquals(false, assets1[0].Test_Asset__c);
System.assertEquals(false, assets1[0].IsCompetitorProduct);
System.assertEquals(oliList[0].Asset__c, assets1[0].Id);
}

Let me know

 
Hi All,

I  am getting this @Remote Function Exception while uploading the attachment file 3.9 MB.
Hi everybody, I'm a beginner in coding and I'm looking for some help please.

I have two problems :

1) I found on a website a visualforce page file in order to create a button to upload files (see photo 1) but when I upload a picture I can't open it the file is broken (see photo 2). What I would like is that it does as in the picture 3 with the possibility to see it directly on salesforce

2) The last problem is that when I upload a picture with the app salesforce on mobile I receive usually this following message --> file size is too large to handle salesforce (see photo 4).

Thank you in advance for your assistance.

User-added imageUser-added imageUser-added imageUser-added image

Visual force page (code) :

<apex:page standardController="Case" extensions="AttachmentActionFunction">
<script type='text/javascript'>
var maxStringSize = 6000000;
var attachmentList;
var j;
function uploadFiles()
{
    input = document.getElementById('fileinput');
    attachmentList = input.files;
    if(j == undefined) 
    j = 0;   
    var file;
    if(j < attachmentList.length)
    {
        file = attachmentList[j];
     var name = file.name;
        var reader = new FileReader();  
        reader.onload = function(e) {  
         var attachmentbodybase64 = window.btoa(reader.result)
            console.log(attachmentbodybase64.length);
            if(attachmentbodybase64.length > maxStringSize )
            alert("File size is too large to handle");
            else
            {
                j++;
                saveFileAF(attachmentbodybase64, name);
            }
        }
         reader.readAsDataURL(file);
    }
    else
    {
        console.log('this is end');
        var url = window.location.origin + '/'+"{!$CurrentPage.parameters.Id}";
        console.log(url);
        window.location.href = url;
    }
    
 }
</script>

<apex:form >
  <input type= "file" Id= "fileinput"  multiple="multiple" />
    <apex:commandButton onclick="uploadFiles(); return false;" value="Upload"/>
    <apex:actionFunction name="saveFileAF" 
         action="{!saveFile}" oncomplete="uploadFiles()" rerender="form"  status="uploading">
        <apex:param name="base64File" value="" assignTo="{!base64}"/>
        <apex:param name="fileName" value="" assignTo="{!fileName}"/>
    </apex:actionFunction>
    <apex:actionStatus id="uploading" >
        <apex:facet name="start" >
            <img src="/img/loading.gif" />                    
  </apex:facet>
 </apex:actionStatus>    
</apex:form>
</apex:page>

Apex class (code) :

public with sharing class AttachmentActionFunction {
    public transient String base64;
    public Case c;
    public String getBase64()
    {
        return base64;
    }
    public void setbase64(String base64)
    {
        this.base64 = base64;
    }
    public transient String fileName {get; set;}
    public AttachmentActionFunction(ApexPages.StandardController std)
    {
        c = (Case)std.getRecord();
    }
    public void saveFile()
    {
        Attachment a = new Attachment(parentId = c.Id, Body =  EncodingUtil.base64Decode(base64), name = fileName);
        insert a;
    }
}
Hello 
I cant solve this, maybe someone can help me

System.DmlException: Update failed. First exception on row 0 with id 0066E000004pfWbQAI; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, In the stage Demo, you need to fill in the fields &quot;Scope Test Determined&quot;, Testperiod In Salesforce&quot; and Order Task Sent to Salesforce&quot;.: []

static testMethod void testClosedWonUpdate_positive_03(){
List<Opportunity> oppList = [SELECT Id, StageName,End_Date_Test_Phase__c FROM Opportunity WHERE Name LIKE 'Test%' LIMIT 1];
Opportunity opp = oppList.get(0);
opp.StageName = 'Test';
Date d = date.today();
opp.End_Date_Test_Phase__c = d.addDays(40);
update opp;
System.debug(' 632 ====> ' + opp);
List<Account> aList = [SELECT Id, Name FROM Account WHERE Name LIKE 'Test%' LIMIT 1];
Account a = aList.get(0);
System.debug(' 636 ====> ' + a);
List<Asset> assets = [SELECT Id, Price_Agreements__c, Price, Status, Product2Id, Test_Asset__c, IsCompetitorProduct
FROM Asset WHERE AccountId = :a.Id];
System.debug(' 640 ====> ' + assets);
System.assertEquals('In test', assets[0].Status);
Test.startTest();
opp.StageName = 'Closed Won';
update opp;
Test.stopTest();
OpportunityLineItem ol = [SELECT OpportunityId FROM OpportunityLineItem WHERE Name LIKE 'Test%'];
List<Asset> assets1 = [SELECT Id, Price_Agreements__c, Price, Product2Id, Test_Asset__c, IsCompetitorProduct
FROM Asset WHERE AccountId = :a.Id];
List<OpportunityLineItem> oliList = [select Id, Asset__c from OpportunityLineItem where Id =: ol.Id LIMIT 1];
System.assertEquals(1, assets1.size());
System.debug(' 657 ====> ' + assets1);
System.assertEquals(false, assets1[0].Test_Asset__c);
System.assertEquals(false, assets1[0].IsCompetitorProduct);
System.assertEquals(oliList[0].Asset__c, assets1[0].Id);
}

Let me know

 
Generaly we use spinner like this 
<apex:CommandButton status ="loadingStatus" styleClass="slds-button slds-button_outline-brand" value="Report Missing Document" action="{!reportPopupOpen}" reRender="reportPopup"/>


<apex:actionStatus id="loadingStatus">
<apex:facet name="stop">
    <apex:outputPanel >
    </apex:outputPanel>
</apex:facet>
<apex:facet name="start">
    <apex:outputPanel >
        <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
            <span class="slds-assistive-text">Loading</span>
            <div class="slds-spinner__dot-a"></div>
            <div class="slds-spinner__dot-b"></div>
        </div>                                                  
    </apex:outputPanel>
</apex:facet>


How to use spinner with button why i need this is im using angular js function on button im not able to do spinner for that
                           <button id="buttonClr" status="loadingStatus" class="slds-button slds-button_brand" ng-show="myForm.myInput.$valid"    ng-click="vm.searchs(result, event); "><b>Search</b></button> 
 
We are looking for a part time Salesforce developer to participate in several adhoc projects. The ideal candidate will have the following attributes and qualifications:
  • Superior written and verbal communciation skills
  • Through knowledge of the salesforce platform
  • Experience writing Visualforce pages and developing Apex code
  • Familiar with process builder and visual flows
  • Well versed in the transition from classic experience to lightning
  • U.S. citizen
Hi everyone,
In our project ideally, a third party application is hosting Visualforce pages in a iframe. Is it failiing on all the browsers, saying unable to load the content or X-FRAME OPTIONS TO DENY.

Can someone please guide me over this.

Many thanks.

Hi,

 

     I have Service Level  object and it has fields like

 

 1. Monday  Start time and

 2. Monday End time

 

   like Up to Sunday Start Time and sunday end Time.

 

 Here i need to enter the Start time and End time. I am thinking instead of taking pick list I would like to take as Time picker.

 

how can we do this Please any one help me. 

  • December 14, 2012
  • Like
  • 1
We are looking for a part time Salesforce developer to participate in several adhoc projects. The ideal candidate will have the following attributes and qualifications:

    Superior written and verbal communciation skills
    Through knowledge of the salesforce platform
    Experience writing Visualforce pages and developing Apex code
    Familiar with process builder and visual flows
    Well versed in the transition from classic experience to lightning
    U.S. citizen