• Debajyoti
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Hello All,
I need your help to resolve this issue:
Is it possible to get the translation value for a field for a certain language and store it in a apex variable? AND Is there any Object which stores Translation value for different Language so that we can perform DML operation on that object using apex or VF.

For an example. i want to create a Visualforce Page:

Language Selected from a Select List : CN
Object Slected from a Select List : Account:

Display fields in a PageBlockTable with two column Field Label(in English) and Current Translation (Translated using workbench in Slected laguage).

Thanks and Regards
Debajyoti Mondal

Hello,

Please help me to resolve an issue. I have created a page which will display all the fields name of an object and a comment box in a apex:page table. 

An object name as Trans__c have four fields : Language__c, Field__c, Comment__c and object__c. All are Text (320) field.

This link hold the attachment of screenshot of the requirement: https://ap1.salesforce.com/sfc/p/90000000hbAW/a/90000000PKFg/9n6p89F57h.kA5Kdcztjura0UeX260kYIrFYm56btD0=

 

Now requirement is get those field values from Visualforce page and store them as records. So when Save button will be clicked Number of records (for those fields where comment is not null) will be saved at a time. So if two fields having comments then two records will be saved at a time if save button is clicked. (Map as: Fields Name-->Fields__c, Comment-->comment__c, Language--> Language__c, Object Name-->object__c

 

Codes Are shared via link: https://ap1.salesforce.com/sfc/p/90000000hbAW/a/90000000PKFl/kbu6qs0sznPu7XISKu_F9d6WtdAxXW8HcjQtWweX6ys=

 

My issue is I am unable to get the Vales in Wrapper Class which consists Two list of strings. And Can't insert those values as records.

 

Please help me to resolve this issue.

 

Thanks and Regards

Debajyoti Mondal

Hello All,
I need your help to resolve this issue:
Is it possible to get the translation value for a field for a certain language and store it in a apex variable? AND Is there any Object which stores Translation value for different Language so that we can perform DML operation on that object using apex or VF.

For an example. i want to create a Visualforce Page:

Language Selected from a Select List : CN
Object Slected from a Select List : Account:

Display fields in a PageBlockTable with two column Field Label(in English) and Current Translation (Translated using workbench in Slected laguage).

Thanks and Regards
Debajyoti Mondal

By using Visulaforce page it is there any  possibile display the charts..

 

 

Thanks,

SFDC_Learner

Hi,

Can any one help to this scenario.

 

Page Code:-

<apex:page controller="xyzcon" >
<script>
    function addElement(value)
        {
        //alert(value);
            var ni = document.getElementById('myDiv');
            var numi = document.getElementById('theValue');
            var num = (document.getElementById('theValue').value -1)+ 2;
            numi.value = num;
            var newdiv = document.createElement('div');
            var divIdName = 'my'+num+'Div';
            newdiv.setAttribute('id',divIdName);
            newdiv.type='Button';
        
   <!-- If conditions that helps to add a control dynamically based on field types -->
        if(value=='STRING')
        {
            newdiv.innerHTML = 'Name:<input type="+value+" Name="DVF__STRING" />';
        }
        if(value=='EMAIL')
        {
            newdiv.innerHTML = 'Email:<input type="+value+" Name="DVF__EMAIL" />';
        }
        if(value=='PHONE')
        {
            newdiv.innerHTML = 'Phone:<input type="+value+" Name="DVF__PHONE"/>';
        }
        if(value=='PICKLIST')
        {
            newdiv.innerHTML = 'Location:<select type="+value+" Name="DVF__PICKLIST"><option value="Hyderabad">Hyderabad<option value="Banglore">Banglore<option value="Chennai">Chennai';
        }
        if(value=='TEXTAREA')
        {
            newdiv.innerHTML = 'About You:<textarea rows="5" cols="20" Name="DVF__TEXTAREA"/>';
        }
        if(value=='BOOLEAN')
        {
            newdiv.innerHTML = 'CheckBox:<input type="Checkbox" Name="DVF__BOOLEAN"/>';
        }
        if(value=='DATE')
        {
            newdiv.innerHTML = 'Date:<input type="text" Name="DVF__DATE"/>';
        }
         ni.appendChild(newdiv);
     }
     
  <!-- function that helps to get the form elements -->
 
     function getfieldvalues(oForm)
     {  
      str = oForm.name;
        for (i = 0; i < oForm.length; i++)
        {
            str += oForm.elements[i].name+ " -- "+ oForm.elements[i].value + "\n";
        }
        alert(str);
     }

</script>
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!Data}" var="Fvalues">
                    <apex:column headervalue=" Field Names ">
                        <a href="javascript&colon;;" onclick="addElement('{!Fvalues}')">{!Fvalues}</a>
                    </apex:column>
                </apex:pageBlockTable>
             </apex:pageBlockSection>
        </apex:pageBlock>
        <input type="hidden" value="0" id="theValue" />
    <div id="myDiv"> </div>
    <input type="button" value="Submit" onclick="getfieldvalues(this.form)"/>
   </apex:form>
</apex:page>

 

 

Controller Code:-

public class xyzcon
{
    List<Schema.DisplayType> fieldtypelst= new List<Schema.DisplayType>();

        public List<Schema.DisplayType> getData()
        {
                Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
                Schema.SObjectType systemObjectType = gd.get('E__C') ;
                Schema.DescribeSObjectResult r = systemObjectType.getDescribe();
                Map<String, Schema.SObjectField> M = r.fields.getMap();
                Set<String> fieldNames = M.keySet();               
                    for(String fieldName : fieldNames)
                    {
                            Schema.SObjectField field = M.get(fieldName);                                                    
                            Schema.DescribeFieldResult fieldDesc = field.getDescribe();
                            if(fieldDesc.iscustom())
                            fieldtypelst.add(fieldDesc.getType());  
                    }
               return fieldtypelst;
        }
}

 

 

How can i pass  'str' value from JavaScript method to apex Controller.

 

 

Can u please suggest me.

 

 

Thanks & Regards;

Ramya