• NeedHelp55
  • NEWBIE
  • 60 Points
  • Member since 2013

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 11
    Replies
I am using one lightning component with one lightning out and app referred in a visualforce component.

My goal is to update a record on a button click and if the operation is successfull then it will take the user to detail page of updated record[  with updated values].

Below are the componets. Redirection is working fine but the updated value are not reflecting on detail page after redirected from button click.
I am getting updated values after i am doing page refresh by myself.

Please help. I am stuck on this point from a long time.
Lightning Component
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" controller="RFID_varianceReportController">
    <ltng:require styles="/resource/LightningCSS/assets/styles/salesforce-lightning-design-system.css" />
    <aura:attribute name="recordId" type="Id" />
    <aura:attribute name="cycleLineItemSize" type="Integer" />
    <aura:attribute name="cycleCountLineItem" type="RFID_Cycle_Count_Variance_Reports__c[]" default="{ 'sobjectType' : 'RFID_Cycle_Count_Variance_Reports__c','Reconcilation_Action__c' : 'Bill Customer','Comments__c' : 'Comments'}"/>
    <aura:attribute name="errorMsgSave" type="string"/>
    <aura:attribute name="modalActive" type="Boolean" default="false"/>
    <aura:dependency resource="markup://force:*" type="EVENT"/>
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    <aura:if isTrue="{!v.modalActive == true}">    
        <c:ConfirmSubmission/>
    </aura:if>    
    <!--Use a data table from the Lightning Design System:https://www.lightningdesignsystem.com/components/data-tables/-->
    <div class="slds-theme_shade" aura:id="tableContainer">
    <section class="slds-card__body"> 
    
    <div class="slds-p-vertical--medium" align="center" id="errormessageSubmitSave"> 
        <ui:outputText value="{!v.errorMsgSave}" class="errormsg" aura:id="errormsgBlock"/> 
    </div>

    <aura:if isTrue="{!equals(v.cycleLineItemSize,0)}">
        <div>No Records available to display.</div>
    </aura:if>
        
    <ui:scrollerWrapper class="sWrapTest">    
    <aura:if isTrue="{!greaterthan(v.cycleLineItemSize,0)}">
    <table class="slds-table slds-table_bordered slds-table--cell-buffer slds-max-medium-table--stacked">
    <thead>
        <tr class="slds-text-title--caps">
            <th scope="col" class="slds-cell-wrap">
                <div class="slds-grid slds-wrap">
                    <div title="UPN" class="slds-col slds-size_1-of-8"><ui:outputText value="UPN"/></div>
                </div>
            </th>
            <th scope="col" class="slds-cell-wrap">
                <div class="slds-grid slds-wrap">
                    <div title="Batch" class="slds-col slds-size_1-of-8">Batch</div>
                </div>
            </th>
            <th scope="col" class="slds-cell-wrap">
                <div class="slds-grid slds-wrap">
                    <div title="Serial" class="slds-col slds-size_1-of-8">Serial</div>
                </div>
            </th>
            <th scope="col">
                <div class="slds-grid slds-wrap">
                    <div title="Var" class="slds-col slds-size_1-of-12 slds-cell-shrink">Var</div>
                </div>
            </th>
            <th scope="col">
                <div class="slds-grid slds-wrap">
                    <div title="UOM" class="slds-col slds-size_1-of-12 slds-cell-shrink">UOM</div>
                </div>
            </th>
            <th scope="col" class="slds-cell-wrap">
                <div class="slds-grid slds-wrap">
                    <div title="Reconcile Action" class="slds-col slds-size_2-of-8">Reconcile Action</div>
                </div>
            </th>
            <th scope="col">
                <div class="slds-grid slds-wrap">
                    <div title="Comments" class="slds-col slds-size_2-of-8">Comments</div>
                </div>
            </th>
      </tr> 
    </thead>
        <tbody>
        <aura:iteration items="{!v.cycleCountLineItem}" var="obj" indexVar="i" aura:id="inputCmp">
            <tr>
                <td data-label="UPN" class="slds-cell-wrap">
                    <div title="{!obj.UPN__c}" class="slds-grid slds-wrap">
                        <div class="slds-col slds-size_1-of-8"><ui:outputText value="{!obj.UPN__c}"/></div>
                    </div>
                </td>
                <td data-label="Batch" class="slds-cell-wrap">
                    <div title="{!obj.Batch_Number__c}" class="slds-grid slds-wrap">
                        <div class="slds-col slds-size_1-of-8"><ui:outputText value="{!obj.Batch_Number__c}"/></div>
                    </div>
                </td>
                <td data-label="Serial" class="slds-cell-wrap">
                    <div title="{!obj.Serial_Number__c}" class="slds-grid slds-wrap">
                        <div class="slds-col slds-size_1-of-8"><ui:outputText value="{!obj.Serial_Number__c}"/></div>
                    </div>
                </td>
                <td data-label="Var">
                    <div title="{!obj.Variance_quantity__c}" class="slds-grid slds-wrap">
                        <div class="slds-col slds-size_1-of-12 slds-cell-shrink"><ui:outputText value="{!obj.Variance_quantity__c}"/></div>
                    </div>    
                </td>
                <td data-label="UOM">
                    <div title="{!obj.No_of_sheets__c}" class="slds-grid slds-wrap">
                        <div class="slds-col slds-size_1-of-12 slds-cell-shrink"><ui:outputText value="{!obj.No_of_sheets__c}"/></div>
                    </div>
                </td>
                <td data-label="Reconcile Action">
                    <div title="{!obj.Reconcilation_Action__c}" class="slds-grid slds-wrap">
                        <div class="slds-col slds-size_2-of-8">
                        <ui:inputSelect value="{!obj.Reconcilation_Action__c}" required="true" aura:id="selAura" class="slds-select slds-lookup__search-input slds-input">
                            <ui:inputSelectOption text="" label=""/>
                            <ui:inputSelectOption text="Bill Customer" label="Bill Customer" value="true"/>
                            <ui:inputSelectOption text="In Transit" label="In Transit"/>    
                            <ui:inputSelectOption text="Loaned out (to be returned)" label="Loaned out (to be returned)"/>   
                            <ui:inputSelectOption text="Pending Bill" label="Pending Bill" value="true"/>
                            <ui:inputSelectOption text="Pending Transfer" label="Pending Transfer"/>
                            <ui:inputSelectOption text="Pending Return" label="Pending Return"/>
                            <ui:inputSelectOption text="Product Found (previously missing)" label="Product Found (previously missing)"/>                 
                            <ui:inputSelectOption text="Pending Bonus" label="Pending Bonus"/>                 
                            <ui:inputSelectOption text="Pending Performance" label="Pending Performance"/>                 
                            <ui:inputSelectOption text="Pending PO#" label="Pending PO#"/>                 
                            <ui:inputSelectOption text="Requires Investigation" label="Requires Investigation"/>
                            <ui:inputSelectOption text="Other" label="Other"/>                 
                        </ui:inputSelect>
                    </div>
                    </div>    
                </td>
                <td data-label="Comment">
                    <div class="slds-grid slds-wrap">
                        <div class="slds-col slds-size_2-of-8"><ui:inputTextarea aura:id="commentBox" value="{!obj.Comments__c}" class="slds-textarea"/></div>
                    </div>    
                </td>
            </tr>
        </aura:iteration>
        </tbody>
    
    </table>
        <div class="slds-align_absolute-center">
            <lightning:button label="Submit" class="slds-button_brand" onclick="{!c.updateHeader}"/>
            <lightning:button label="Save" class="slds-button_brand" onclick="{!c.save}"/>
            <lightning:button label="Cancel" class="slds-button_brand" onclick="{!c.cancel}"/>
        </div>
    </aura:if>    
    </ui:scrollerWrapper>   
    </section>    
    </div>
</aura:component>

Javascript Method : 
updateHeader : function(component, event, helper) {
        var confirmmsg = confirm("Are you sure you want to save?");
        var currecId = component.get("v.recordId");
        
        if(confirmmsg == true) {
        var action = component.get("c.submitVariance");
        //component.set('v.modalActive', true);
        
            
        action.setParams({
            "headerId": component.get("v.recordId")
        });
        action.setCallback(this, function(actionResult) {
            var a = actionResult.getState();
            var currecId = component.get("v.recordId");
            console.log(a); 
            if(a == 'SUCCESS') {
                component.set("v.errorMsgSave","Record successfully submitted");
                var event = $A.get("e.force:navigateToSObject");
        //var event = $A.get('e.force:navigateToObjectHome');

        event.setParams({
            "recordId": currecId,
            "slideDevName" : "detail",
            "isredirect" : true
        });   
        event.fire();
                //sforce.one.navigateToSObject(currecId,"detail");
            }
            else if(a == 'ERROR')
                component.set("v.errorMsgSave",a.getError()[0].message);
            else if(a == 'INCOMPLETE')
                component.set("v.errorMsgSave","User or Server is offline");
            
            //alert('Hi');
            //window.location.href = 'javascript:sforce.one.navigateToURL(\'' + '/'+currecId + '\')';
            
            //sforce.one.navigateToSObject(currecId,"detail");
        });
        $A.enqueueAction(action);
        }
    },

Associated Visualforce Page : 
<apex:page standardController="RFID_Cycle_Count__c" extensions="RFID_varianceReportController" standardStylesheets="false">
<apex:includeScript value="/canvas/sdk/js/publisher.js" />
<apex:includeLightning />
  <script>
      var headerId = '{!recordId}';
      $Lightning.use("c:VarianceReport", function() {
                      $Lightning.createComponent("c:Reconcile",
                      {recordId:headerId},
                      "LtngOutBsicInfo",
                      function(cmp) {
                         $A.eventService.addHandler({
                         event: 'force:navigateToSObject',
                         handler: function(event) {
                             if (sforce && sforce.one) {
                                 Sfdc.canvas.publisher.publish({ name : "publisher.close", payload : { refresh:"true" }});
sforce.one.navigateToSObject(event.getParams().recordId); 
                                 
                             }
                         }
                         }); 
                         console.log('component created');
                      });
                  });
    
  </script>
  <body>
  <div Id="LtngOutBsicInfo"></div>
  </body>
</apex:page>
 
Hi,
I am stuck with the width of modal window pos up when someone clicks on a quick action. I saw there is a option to adjust the height.
But i am not able to adjust the width of modal window at all. Tried all possibilities.

Kindly help me on this.
Hi,

My scenario is :

A email will be fired from SAP with one text attachment. Once salesforce receives the attachment it will traverse through the attachment and creates some record in salesforce. 

Now the issue is incoming attachment contains chinese charater. So in case the .txt file encoding format is unicode it's converting those chinese character as Nwm�m�l;S�uhV�h-N�. But the system works absolutely fine with UTF-8 format.

Any work around to process with this unicode format txt file?

Thanks in advance.
Hi,
I need to upload mutiple attachment at once by selecting them all. Is it possible in salesforce?
   <style>
    .bottom {
        border:thin solid;
        border-color:black;
     }

    </style>
   
    <script>
        function createActivity()
        {
             $( "#dialog-form" ).dialog({
                  autoOpen: open,
                  height: 400,
                  width: 900,
                  modal: true,
                  buttons: {
                   'Save' : function() {
                       var eventOwner = $('[id$=ownerId]').val();
                      
                       if(eventOwner==''){
                           alert('Owner Cannot be blank');   
                       }
                    },
                   'Cancel': function() {
                       $(this).dialog('close');
                    }
                  }
                });
        }
        function redirectToEvent(eventId){
            alert('Event Id:::'+eventId);
            window.top.location.href = '/'+eventId;
        }
        $( document ).ready(function() {
            alert('Hello');
         });
       
    </script>
   
    <apex:form id="theForm">
        <div id="dialog-form" style="display:none">
            <apex:pageBlock title="New Event" id="pbId">
                <apex:pageBlockSection title="Calendar Details" collapsible="false">
                    <apex:inputField value="{!eventObj.Ownerid}" required="false" id="ownerId"/>
                    <apex:inputField value="{!eventObj.Location}"/>
                    <apex:inputField value="{!eventObj.Subject}"/>
                    <apex:inputField value="{!eventObj.StartDateTime}"/>
                    <apex:inputField value="{!eventObj.WhoId}"/>
                    <apex:inputField value="{!eventObj.EndDateTime}"/>
                    <apex:inputField value="{!eventObj.IsAllDayEvent}"/>
                    <br/>
                    <apex:inputField value="{!eventObj.WhatId}"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection collapsible="false" title="Description Information">
                    <apex:inputField value="{!eventObj.Description}"/>
                </apex:pageBlockSection>
            </apex:pageBlock>

        </div>
       
        <apex:outputPanel id="theCalendar">
            <br/>
            <center>
            <apex:commandLink action="{!prev}" rerender="theCalendar">
                <apex:image url="/img/arrow2_picklist_left.gif" style="cursor:pointer;"/>
            </apex:commandLink>
           
            <b>&nbsp;&nbsp;{!month.monthname}&nbsp;&nbsp;{!month.yearname}&nbsp;&nbsp;</b>
           
            <apex:commandLink action="{!next}" rerender="theCalendar">
                <apex:image url="/img/arrow2_picklist_right.gif" style="cursor:pointer;"/>
            </apex:commandLink>
            </center>
            <br/>
            <table width="100%">
                <tr bgcolor="#CCCCCC">
                    <th class="bottom">Sunday</th>
                    <th class="bottom">Monday</th>
                    <th class="bottom">Tuesday</th>
                    <th class="bottom">Wednesday</th>
                    <th class="bottom">Thursday</th>
                    <th class="bottom">Friday</th>
                    <th class="bottom">Saturday</th>
                </tr>
               
                <apex:repeat value="{!weeks}" var="wk" id="foreachWeek">
                    <tr>
                        <apex:repeat value="{!wk.days}" var="day" id="foreachday">
                            <td height="90" valign="top" id="monthdays">
                                <div style="background-color:#E6F8E0;">
                                    {!day.dayofmonth}
                                    <apex:commandLink onclick="createActivity();return false;">
                                        <img src="/s.gif" class="addNewEventIcon"/>
                                    </apex:commandLink>
                                </div>
                              
                                <div>
                                    <apex:repeat value="{!day.eventstoday}" var="v" id="foreachevent">
                                        <span>{!v.formateddate}</span><br/>
                                        <apex:commandLink onclick="redirectToEvent('{!v.ev.Id}');">{!v.ev.subject}</apex:commandLink>
                                    </apex:repeat>
                                </div>
                            </td>
                        </apex:repeat>
                    </tr>
                </apex:repeat>
            </table>
         </apex:outputPanel>
    </apex:form>
--------------------------------------------------------------------------

public class Calendar{

    private List<Event> events;
    public Event eventObj{get;set;}
   
    public void prev() {
        system.debug('Hello');
        addMonth(-1);
    }
   
    public void next() {
        addMonth(1);
    }

    public Month month{get;set;}
   
    public Calendar(){
        Date d = System.Today();
        month = new Month(d);
    }
   
    public void addMonth(Integer addMonth) {
        Date d = month.getFirstDate();
        d = d.addMonths(addMonth);
        setMonth(d);
    }
   
    private void setMonth(Date d) {
        month = new Month(d);
        Date[] da = month.getValidDateRange(); // gather events that fall in this month
       
        events = [ select id,subject,description,activitydate,activitydatetime,DurationInMinutes
        from Event
        where activitydate >= :da[0] AND activityDate <= :da[1]
        order by activitydatetime];
       
        System.debug('Events:::::::::::::::::::::'+events);

        month.setEvents(events);  // merge those events into the month class
    }
   
    public List<Month.Week> getWeeks() {
    return month.getWeeks();
  }
}

hi i am trying to call a apex method from a command button but it's not woring.attached the class and page below.

 

Details: a output panel with id "panelId" is render when one clicks on Edit button. In the output panel i have written a command button Save which should call a apex method saveRec . but when i clicked the button the method is not getting called , i have debuged it. Please help!!

------------------------------------------------------page-------------------------------------------------------------

<apex:page controller="noteListView" tabStyle="Quick_Note__c" sidebar="false" id="pdId">

<script>
function deleteARow(recordId){
actionFunc1(recordId);
}
function editARow(recordId){
actionFunc2(recordId);

</script>

<apex:form id="formId">
<apex:pageMessages id="pgmsg"/>
<apex:actionfunction name="actionFunc1" action="{!deleteRec}" rerender="pb,proxy">
<apex:param name="recId" id="paramId" value=""/>
</apex:actionFunction>

<apex:actionfunction name="actionFunc2" action="{!editRec}" rerender="panelId,proxy">
<apex:param name="recId" id="param1Id" value=""/>
</apex:actionFunction>

<apex:sectionHeader title="Case Note" subtitle="Home"/>

<b>View: </b>

<apex:selectList value="{!timeSpan}" multiselect="false" size="1" >
<apex:selectOptions value="{!items}"/>
</apex:selectList>

<apex:commandButton value=" Go " action="{!fetchDataBase}" rerender="pb"/>

<apex:pageBlock id="pb">

<apex:pageBlockTable value="{!noteList}" var="perNote" id="pbt1" rendered="{!IF(noteList.size>0,True,False)}">
<apex:column style="width:80px">
<apex:facet name="header">Action</apex:facet>
<apex:commandLink value="Edit" onclick="editARow('{!perNote.id}');" rerender="proxy"/>
&nbsp; | &nbsp;
<apex:commandLink value="Del" onclick="deleteARow('{!perNote.id}');" rerender="proxy"/>
&nbsp; |
</apex:column>

<apex:column value="{!perNote.Name}"/>
<apex:column value="{!perNote.Notes__c}"/>
<apex:column value="{!perNote.Long_Note__c}"/>
</apex:pageBlockTable>

</apex:pageBlock>

<apex:outputpanel id="panelId">
<apex:pageBlock title="Case Note Edit" rendered="{!isEdit}">
<apex:pageBlockButtons >
<apex:commandButton value="save" action="{!saveRec}" rerender="proxy,pb,panelId"/>
</apex:pageBlockButtons> 
<apex:pageBlockSection >
<apex:inputField value="{!noteRec.Notes__c}"/>
<apex:inputField value="{!noteRec.Long_Note__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:outputpanel>

</apex:form>

</apex:page>

------------------------------------------------------------class----------------------------------------------------------

public class noteListView {

public List<Quick_Note__c> noteList{get;set;}
public String soqlQuery{get;set;}
public String timeSpan{get;set;}
//public String selectedRecordId
public Quick_Note__c noteRec{get;set;}
//public Quick_Note__c toUpdate{get;set;}
public Boolean isEdit{get;set;}

public noteListView(){
noteList = new List<Quick_Note__c>();
fetchDataBase();
isEdit = false;
}

public List<SelectOption> getItems() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('Top 50 Notes','Top 50 Notes'));
options.add(new SelectOption('Notes Last Week','Notes Last Week'));
options.add(new SelectOption('Notes Last Month','Notes Last Month'));
return options;
}

public void fetchDataBase(){

System.debug('Method called');

if(timeSpan == 'Top 50 Notes'){
soqlQuery = 'Select Id,Name,Notes__c,Long_Note__c from Quick_Note__c Limit 50 OFFSET 0';
}else if(timeSpan == 'Notes Last Week'){
soqlQuery = 'Select Id,Name,Notes__c,Long_Note__c from Quick_Note__c WHERE LastModifiedDate = LAST_N_DAYS:7';
}else{
soqlQuery = 'Select Id,Name,Notes__c,Long_Note__c from Quick_Note__c WHERE LastModifiedDate = LAST_N_DAYS:30';
}

noteList = DataBase.Query(soqlQuery);

system.debug('List Size'+noteList.Size());

}

public void deleteRec(){
String recordId = Apexpages.currentPage().getParameters().get('recId');
system.debug('Delete Id:::'+recordId);
List<Quick_Note__c> deleteId = [select Id from Quick_Note__c where Id =:recordId];
system.debug('Size::'+deleteId.size());
delete deleteId[0];
fetchDataBase();
}

public void editRec(){
system.debug('Method Called');
String recordId = Apexpages.currentPage().getParameters().get('recId');
noteRec = [Select Id,Name,Notes__c,Long_Note__c from Quick_Note__c where Id =:recordId];
isEdit = true;
system.debug('value ::::::::'+noteRec.Id);
Apexpages.currentPage().getParameters().put('recId',noteRec.Id);
}

public void saveRec(){
System.debug('Method Called - Save ::');
/*try{
upsert noteRec;
}catch(DMLException e){
ApexPages.addMessages(e);
}*/
isEdit = false;
}

}

 

-----------------------------------page-----------------------------------

<apex:page sidebar="false" showheader="false" controller="QuestionAnswers">

<script>

function selectedAnswer(){
actionFunc1();
}

</script>

<div style="height:620px;width:1346px;padding:5px;overflow:auto;background-color:#E6F8E0;border:1px solid gray;">
<h><center><font size="6"><u>Examination Page</u></font></center></h><br/>
<apex:form >

<apex:actionFunction name="actionFunc1" action="{!calculateResult}" rerender="proxy"/>

<apex:outputPanel id="radionButton" >
<h1 style="margin-left:100px;"><font size="3">Question Number : {!count+1} </font><br/></h1><br/>
<h2 style="margin-left:100px;"><font size="3">Question : </font></h2>&nbsp;

<apex:outputtext value="{!question}"/>
<apex:selectRadio value="{!selectedValue}" layout="pageDirection" style="margin-left:100px;" onclick="selectedAnswer();">
<br/><apex:selectOptions value="{!options}"/>
</apex:selectRadio>

</apex:outputPanel>
<apex:outputPanel id="buttons">
<br/><apex:commandButton action="{!next}" rerender="proxy,radionButton,buttons" value="next" style="margin-left:100px;" rendered="{!IF(count<examQuestion.size-1,True,False)}"/>
<apex:commandButton action="{!previous}" rerender="proxy,radionButton,buttons" value="previous" rendered="{!IF(count>0,True,false)}"/>
</apex:outputPanel>


</apex:form>
</div>
</apex:page>

 

------------------------------------------------------class--------------------------------------------------------

 

 

public class QuestionAnswers {

public String question{get;set;}
public List<SelectOption> options{get;set;}

public Map<String,String> junctionMap{get;set;}//2nd way to implement
public String selectedValue = null;//2nd way to implement

public Map<String,String> resultCal{get;set;}
public List<Online_Examination__c> examQuestion{get;set;}
public List<Answer__c> answers{get;set;}
public Integer count{get;set;}

public QuestionAnswers(){
count = 0;
resultCal = new Map<String,String>();
options = new List<SelectOption>(); 
junctionMap = new Map<String,String>();//2nd way to implement
examQuestion = [select Question__c,Type__c,Id from Online_Examination__c];
prepareMap();
}

public void next(){
count = count+1;
prepareMap();
}

public void previous() {
count = count-1;
prepareMap();
}

public void prepareMap(){
question = examQuestion[count].Question__c;
answers = [select Id,Choice__c,CorrectAnswer__c from Answer__c where Online_Examination__c=:examQuestion[count].Id];

options.clear();
for(Answer__c listAns : answers){
options.add(new SelectOption(listAns.Choice__c,listAns.Choice__c)); 
}
}

public void calculateResult() {
junctionMap.put(examQuestion[count].Question__c,selectedValue);
}

public String getselectedValue() {
for(String s : junctionMap.keyset()){
system.debug('Key is'+s);
system.debug('Value is'+junctionMap.get(s));
}
if(junctionMap.get(examQuestion[count].Question__c) == NULL){
return selectedValue;
}else { return junctionMap.get(examQuestion[count].Question__c);}
}

public void setselectedValue(String selectedValue){ 
this.selectedValue = selectedValue;
system.debug('set Selected Value:::'+selectedValue); 
}
}

 

 

Hi,i have pasted the page and class here. Here i am fetching first all the question records from Online_Examination__c object then later on i searched corresponding option from child object . at last when user selects values for a specific question a map stores the values against question . which i used to return the selected option when the user come back previous question .But the problem is that it's working soemtimes i mean not for all questions. Please help. 

 

I want to show alert whenever progressbar reaches to the max value.

 

Here is my code---------

<script>
var width=0;
var timer;
$(document).ready(function(){
if(width<100){
timer=setInterval("CallMeInterval()", 2000);
}
});

function CallMeInterval()
{

$( "#progressbar" ).progressbar({
value: width+=10
});
}
</script>
<apex:form >
</apex:form>
<div id="progressbar"></div>

 

I have tried it through lots of way but not working perfectly.Please Help.

I am trying to build a report wizard. What i am doing is that dragging a field form one table & dropping it to a div. I want  actionfunc() to be called when a field is dropped to droppable section. I have defined that in my page.But it is not working.

 

///////////////////////////////////////////////visualforce page///////////////////////////////////////////////

 

<apex:page id="page" sidebar="false" controller="describe">
<apex:includeScript value="{!URLFOR($Resource.jqueryStable, '/js/jquery-1.7.2.min.js')}" />
<apex:includeScript value="{!URLFOR($Resource.jqueryStable, '/js/jquery-ui-1.8.20.custom.min.js')}" />
<apex:stylesheet value="{!URLFOR($Resource.jqueryStable, '/css/cupertino/jquery-ui-1.8.20.custom.css')}"/>

<style>
p{
text-transform:uppercase;
font-family:"Times New Roman", Times, serif;
color:#61210B;
}


.insertImage{background-image:url(http://www.wbsonline.com/images/icon-search-small.gif);
text-align:center;
background-repeat:no-repeat;
padding:10px;
height:0.1px;
width:170px;
font-family:Tahoma;
font-size:14px;
color:#000000;
}
</style>

<script type="text/javascript">

$(function() {
$(".account-Field").draggable({
helper: "clone",
revert: "invalid"
});

$("#content").droppable({
accept: ".account-Field",
drop: function( event, ui ) {
var fieldName = j$(ui.draggable).text();

rerenderPb1();
alert('Hello all');
}
});
//***************************************************//
// modal show //
//***************************************************//

function pleaseWait() {
j$('#content').modal('show');
}


});



</script>

<apex:form id="formid">

<apex:actionFunction name="rerenderPb1" action="{!actionfunc}" status="loadingstatus">
<!--apex:param id="param1" name="node1" value=""/-->
</apex:actionFunction>

<apex:actionStatus id="loadingstatus" onstart="pleaseWait();"/>

<apex:pageBlock title="Report Wizard" id="pb1">
<apex:pageBlockSection columns="3">

<apex:outputPanel >
<p>Search:</p>
<apex:inputText value="{!fieldName}" id="theInputText" styleClass="insertImage" onkeyup="ItemSearch()"/>
<div style="overflow-y:scroll; width:200px; height:400px">
<apex:pageBlocktable value="{!lstOfLabel}" var="da" id="pbt1" title="MY TABLE" >
<apex:column styleClass="account-Field" value="{!da.labelValue}"/>
</apex:pageBlocktable>
</div>
</apex:outputPanel>

<div id="content" style="background-color:#EEEEEE;height:400px;width:800px;float:left;">

</div>

</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

/////////////////////////////////class///////////////////////////////////////////////////////

 

public class describe {

Public List<String> fields{get;set;}
public List<WrapperFieldDetails> lstOfLabel{get;set;}
public Integer counter{get;set;}
public List<WrapperFieldDetails> selectedField{get;set;}
public List<Account> searchResList { get; set; }
Public String fieldName{get;set;}
Public List<sObject> recordList {get; set;}
Public static List<String> selectedFieldList {get; set;}

Public describe()
{
Map<String, Schema.SObjectField> fieldMap= Schema.SObjectType.Account.fields.getMap();
lstOfLabel=new List<WrapperFieldDetails>();
counter=1;

for (String fieldName: fieldMap.keySet())
{
WrapperFieldDetails wca = new WrapperFieldDetails();
wca.idOfEachField=counter;
//wca.isSelected=false;
wca.labelValue=fieldMap.get(fieldName).getDescribe().getLabel();
lstOfLabel.add(wca);
counter=counter+1;
}
}

Public void actionfunc()
{
system.debug('action method is fired');
}

public class WrapperFieldDetails
{
public Integer idOfEachField{get;set;}
public String labelValue{ get; set; }
//public Boolean isSelected{get;set;}
}
}

Here is my Code ...

 

<apex:page id="page" sidebar="false" controller="describe">
<apex:includeScript value="{!URLFOR($Resource.jqueryStable, '/js/jquery-1.7.2.min.js')}" />
<apex:includeScript value="{!URLFOR($Resource.jqueryStable, '/js/jquery-ui-1.8.20.custom.min.js')}" />
<apex:stylesheet value="{!URLFOR($Resource.jqueryStable, '/css/cupertino/jquery-ui-1.8.20.custom.css')}"/>

<!-- <script>
$(function() {
$( ".dataCell" ).draggable();
});
</script>-->

<apex:form id="formid">
<apex:pageBlock title="Report Wizard" id="pb1">
<apex:pageBlocksection columns="3" id="pbs1" collapsible="true">
<apex:pageBlockSectionItem id="pbst1">
<apex:pageBlocktable value="{!fields}" var="da" >
<apex:column headerValue="Field" value="{!da}"/>
</apex:pageBlocktable>
</apex:pageBlockSectionItem>

</apex:pageBlock>
</apex:form>
</apex:page>

Hi,
I am stuck with the width of modal window pos up when someone clicks on a quick action. I saw there is a option to adjust the height.
But i am not able to adjust the width of modal window at all. Tried all possibilities.

Kindly help me on this.
Hi,
I am stuck with the width of modal window pos up when someone clicks on a quick action. I saw there is a option to adjust the height.
But i am not able to adjust the width of modal window at all. Tried all possibilities.

Kindly help me on this.
Hi,

My scenario is :

A email will be fired from SAP with one text attachment. Once salesforce receives the attachment it will traverse through the attachment and creates some record in salesforce. 

Now the issue is incoming attachment contains chinese charater. So in case the .txt file encoding format is unicode it's converting those chinese character as Nwm�m�l;S�uhV�h-N�. But the system works absolutely fine with UTF-8 format.

Any work around to process with this unicode format txt file?

Thanks in advance.
Hi,
I need to upload mutiple attachment at once by selecting them all. Is it possible in salesforce?

hi i am trying to call a apex method from a command button but it's not woring.attached the class and page below.

 

Details: a output panel with id "panelId" is render when one clicks on Edit button. In the output panel i have written a command button Save which should call a apex method saveRec . but when i clicked the button the method is not getting called , i have debuged it. Please help!!

------------------------------------------------------page-------------------------------------------------------------

<apex:page controller="noteListView" tabStyle="Quick_Note__c" sidebar="false" id="pdId">

<script>
function deleteARow(recordId){
actionFunc1(recordId);
}
function editARow(recordId){
actionFunc2(recordId);

</script>

<apex:form id="formId">
<apex:pageMessages id="pgmsg"/>
<apex:actionfunction name="actionFunc1" action="{!deleteRec}" rerender="pb,proxy">
<apex:param name="recId" id="paramId" value=""/>
</apex:actionFunction>

<apex:actionfunction name="actionFunc2" action="{!editRec}" rerender="panelId,proxy">
<apex:param name="recId" id="param1Id" value=""/>
</apex:actionFunction>

<apex:sectionHeader title="Case Note" subtitle="Home"/>

<b>View: </b>

<apex:selectList value="{!timeSpan}" multiselect="false" size="1" >
<apex:selectOptions value="{!items}"/>
</apex:selectList>

<apex:commandButton value=" Go " action="{!fetchDataBase}" rerender="pb"/>

<apex:pageBlock id="pb">

<apex:pageBlockTable value="{!noteList}" var="perNote" id="pbt1" rendered="{!IF(noteList.size>0,True,False)}">
<apex:column style="width:80px">
<apex:facet name="header">Action</apex:facet>
<apex:commandLink value="Edit" onclick="editARow('{!perNote.id}');" rerender="proxy"/>
&nbsp; | &nbsp;
<apex:commandLink value="Del" onclick="deleteARow('{!perNote.id}');" rerender="proxy"/>
&nbsp; |
</apex:column>

<apex:column value="{!perNote.Name}"/>
<apex:column value="{!perNote.Notes__c}"/>
<apex:column value="{!perNote.Long_Note__c}"/>
</apex:pageBlockTable>

</apex:pageBlock>

<apex:outputpanel id="panelId">
<apex:pageBlock title="Case Note Edit" rendered="{!isEdit}">
<apex:pageBlockButtons >
<apex:commandButton value="save" action="{!saveRec}" rerender="proxy,pb,panelId"/>
</apex:pageBlockButtons> 
<apex:pageBlockSection >
<apex:inputField value="{!noteRec.Notes__c}"/>
<apex:inputField value="{!noteRec.Long_Note__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:outputpanel>

</apex:form>

</apex:page>

------------------------------------------------------------class----------------------------------------------------------

public class noteListView {

public List<Quick_Note__c> noteList{get;set;}
public String soqlQuery{get;set;}
public String timeSpan{get;set;}
//public String selectedRecordId
public Quick_Note__c noteRec{get;set;}
//public Quick_Note__c toUpdate{get;set;}
public Boolean isEdit{get;set;}

public noteListView(){
noteList = new List<Quick_Note__c>();
fetchDataBase();
isEdit = false;
}

public List<SelectOption> getItems() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('Top 50 Notes','Top 50 Notes'));
options.add(new SelectOption('Notes Last Week','Notes Last Week'));
options.add(new SelectOption('Notes Last Month','Notes Last Month'));
return options;
}

public void fetchDataBase(){

System.debug('Method called');

if(timeSpan == 'Top 50 Notes'){
soqlQuery = 'Select Id,Name,Notes__c,Long_Note__c from Quick_Note__c Limit 50 OFFSET 0';
}else if(timeSpan == 'Notes Last Week'){
soqlQuery = 'Select Id,Name,Notes__c,Long_Note__c from Quick_Note__c WHERE LastModifiedDate = LAST_N_DAYS:7';
}else{
soqlQuery = 'Select Id,Name,Notes__c,Long_Note__c from Quick_Note__c WHERE LastModifiedDate = LAST_N_DAYS:30';
}

noteList = DataBase.Query(soqlQuery);

system.debug('List Size'+noteList.Size());

}

public void deleteRec(){
String recordId = Apexpages.currentPage().getParameters().get('recId');
system.debug('Delete Id:::'+recordId);
List<Quick_Note__c> deleteId = [select Id from Quick_Note__c where Id =:recordId];
system.debug('Size::'+deleteId.size());
delete deleteId[0];
fetchDataBase();
}

public void editRec(){
system.debug('Method Called');
String recordId = Apexpages.currentPage().getParameters().get('recId');
noteRec = [Select Id,Name,Notes__c,Long_Note__c from Quick_Note__c where Id =:recordId];
isEdit = true;
system.debug('value ::::::::'+noteRec.Id);
Apexpages.currentPage().getParameters().put('recId',noteRec.Id);
}

public void saveRec(){
System.debug('Method Called - Save ::');
/*try{
upsert noteRec;
}catch(DMLException e){
ApexPages.addMessages(e);
}*/
isEdit = false;
}

}

 

I want to show alert whenever progressbar reaches to the max value.

 

Here is my code---------

<script>
var width=0;
var timer;
$(document).ready(function(){
if(width<100){
timer=setInterval("CallMeInterval()", 2000);
}
});

function CallMeInterval()
{

$( "#progressbar" ).progressbar({
value: width+=10
});
}
</script>
<apex:form >
</apex:form>
<div id="progressbar"></div>

 

I have tried it through lots of way but not working perfectly.Please Help.

I am trying to build a report wizard. What i am doing is that dragging a field form one table & dropping it to a div. I want  actionfunc() to be called when a field is dropped to droppable section. I have defined that in my page.But it is not working.

 

///////////////////////////////////////////////visualforce page///////////////////////////////////////////////

 

<apex:page id="page" sidebar="false" controller="describe">
<apex:includeScript value="{!URLFOR($Resource.jqueryStable, '/js/jquery-1.7.2.min.js')}" />
<apex:includeScript value="{!URLFOR($Resource.jqueryStable, '/js/jquery-ui-1.8.20.custom.min.js')}" />
<apex:stylesheet value="{!URLFOR($Resource.jqueryStable, '/css/cupertino/jquery-ui-1.8.20.custom.css')}"/>

<style>
p{
text-transform:uppercase;
font-family:"Times New Roman", Times, serif;
color:#61210B;
}


.insertImage{background-image:url(http://www.wbsonline.com/images/icon-search-small.gif);
text-align:center;
background-repeat:no-repeat;
padding:10px;
height:0.1px;
width:170px;
font-family:Tahoma;
font-size:14px;
color:#000000;
}
</style>

<script type="text/javascript">

$(function() {
$(".account-Field").draggable({
helper: "clone",
revert: "invalid"
});

$("#content").droppable({
accept: ".account-Field",
drop: function( event, ui ) {
var fieldName = j$(ui.draggable).text();

rerenderPb1();
alert('Hello all');
}
});
//***************************************************//
// modal show //
//***************************************************//

function pleaseWait() {
j$('#content').modal('show');
}


});



</script>

<apex:form id="formid">

<apex:actionFunction name="rerenderPb1" action="{!actionfunc}" status="loadingstatus">
<!--apex:param id="param1" name="node1" value=""/-->
</apex:actionFunction>

<apex:actionStatus id="loadingstatus" onstart="pleaseWait();"/>

<apex:pageBlock title="Report Wizard" id="pb1">
<apex:pageBlockSection columns="3">

<apex:outputPanel >
<p>Search:</p>
<apex:inputText value="{!fieldName}" id="theInputText" styleClass="insertImage" onkeyup="ItemSearch()"/>
<div style="overflow-y:scroll; width:200px; height:400px">
<apex:pageBlocktable value="{!lstOfLabel}" var="da" id="pbt1" title="MY TABLE" >
<apex:column styleClass="account-Field" value="{!da.labelValue}"/>
</apex:pageBlocktable>
</div>
</apex:outputPanel>

<div id="content" style="background-color:#EEEEEE;height:400px;width:800px;float:left;">

</div>

</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

/////////////////////////////////class///////////////////////////////////////////////////////

 

public class describe {

Public List<String> fields{get;set;}
public List<WrapperFieldDetails> lstOfLabel{get;set;}
public Integer counter{get;set;}
public List<WrapperFieldDetails> selectedField{get;set;}
public List<Account> searchResList { get; set; }
Public String fieldName{get;set;}
Public List<sObject> recordList {get; set;}
Public static List<String> selectedFieldList {get; set;}

Public describe()
{
Map<String, Schema.SObjectField> fieldMap= Schema.SObjectType.Account.fields.getMap();
lstOfLabel=new List<WrapperFieldDetails>();
counter=1;

for (String fieldName: fieldMap.keySet())
{
WrapperFieldDetails wca = new WrapperFieldDetails();
wca.idOfEachField=counter;
//wca.isSelected=false;
wca.labelValue=fieldMap.get(fieldName).getDescribe().getLabel();
lstOfLabel.add(wca);
counter=counter+1;
}
}

Public void actionfunc()
{
system.debug('action method is fired');
}

public class WrapperFieldDetails
{
public Integer idOfEachField{get;set;}
public String labelValue{ get; set; }
//public Boolean isSelected{get;set;}
}
}

Here is my Code ...

 

<apex:page id="page" sidebar="false" controller="describe">
<apex:includeScript value="{!URLFOR($Resource.jqueryStable, '/js/jquery-1.7.2.min.js')}" />
<apex:includeScript value="{!URLFOR($Resource.jqueryStable, '/js/jquery-ui-1.8.20.custom.min.js')}" />
<apex:stylesheet value="{!URLFOR($Resource.jqueryStable, '/css/cupertino/jquery-ui-1.8.20.custom.css')}"/>

<!-- <script>
$(function() {
$( ".dataCell" ).draggable();
});
</script>-->

<apex:form id="formid">
<apex:pageBlock title="Report Wizard" id="pb1">
<apex:pageBlocksection columns="3" id="pbs1" collapsible="true">
<apex:pageBlockSectionItem id="pbst1">
<apex:pageBlocktable value="{!fields}" var="da" >
<apex:column headerValue="Field" value="{!da}"/>
</apex:pageBlocktable>
</apex:pageBlockSectionItem>

</apex:pageBlock>
</apex:form>
</apex:page>