• vinoth
  • NEWBIE
  • 25 Points
  • Member since 2011
  • Developer

  • Chatter
    Feed
  • 1
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 44
    Questions
  • 28
    Replies
Hi, how can i default a dependent picklist value if there is only one value?

for example, i have controling picklist value of A,B,C and dependent picklist value of 1,2,3,6,7,8

A - 1,2,3
B - 6
C - 7,8

so when i select B my dependent picklist will automatically show 6 instead of None and need to choose again since there is only onle value there.
Hi, I want to get full fault message in SOAP API call. But right now, it’s not possible in Salesforce. I found the below workaround in one site. Can anyone guide me to get full message and how to implement the below workaround?

1.Add an 'error' string field to the response class. You then do your webservice call to an intermediate layer which hides these exceptions and always returns to salesforce a 'valid' response.
 
  • December 15, 2015
  • Like
  • 1
I am using REST API to call the site URL(endpoint), i am getting response in HTML format.
I tried:
Content-Type : application/json
Accept : application/json
But No luck. It seems, not supporting Json. 
How do i parse HTML response in apex?

Regards,
Vinoth.
  • November 02, 2015
  • Like
  • 0
Hi All,

Is there any possiblity to show detail page fo the record/Article page in Visual workflow or after the flow completes?

Thanks
Vinoth.
  • September 16, 2015
  • Like
  • 0
Hi,

I am using case creation global action in Community page. That form is having Phone number field, It has two custom validation rule in object level. It is working for Authorized user, but for unAuthorized its not working. Guide me to resoulve this issue.
Hi, I am implementing SSO using Auth Provider(open id connector).I have placed the button in the community page. Once the user clicks the button, after authorization, I want to redirect to the same community  page from where they clicked the button. Please guide me to implement this scenario
Hi, 
I am trying to login salesforce community, when i login the third part site.
For this i have created
1.Auth. Provider as open ID connect by giving value for customerkey, enpointURLs, customsecretes and all.
2. copy past the Test-Only Initialization URL in browser.
3. Given USer name and password in third party login page
4. After that i am getting following error:
              Error:There was a problem with your authentication attempt. Please try again. If you continue to encounter problems, contact your administrator.
           URL:hostname//_nc_external/identity/sso/ui/AuthorizationError?ErrorCode=No_Oauth_Token&ErrorDescription=Empty+Response


Giude me to get rid of this issue, tried in many ways like , created Connected App, Update Remote site setting etc. But No Luck. 
Hi, 
I am trying to login salesforce community, when I login the third part site. 
For this I have created 
1.Auth. Provider as open ID connect by giving value for customerkey, enpointURLs, customsecretes and all.
2. Copy past the Test-Only Initialization URL in browser.
3. Given User name and password in third party login page
4. After that I am getting following error:
              Error: There was a problem with your authentication attempt. Please try again. If you continue to encounter problems, contact your administrator.
           URL:hostname//_nc_external/identity/sso/ui/AuthorizationError?ErrorCode=No_Oauth_Token&ErrorDescription=Empty+Response

Guide me to get rid of this issue, tried in many ways like , created Connected App, Update Remote site setting etc. But No Luck. 
 
  • April 21, 2015
  • Like
  • 2
Hi,

I want to customize the visualforce permission error message,eg: if I am not having permission on 'page1', and  i am loading 'page1' , i am geeting following error message "Content cannot be displayed: You do not have sufficient privileges to access the page: page1" instead of  that i want to display custom error message. Guide me to implement this scenario. 

Thanks
  • March 16, 2015
  • Like
  • 0
Hi,

I am having one VF page which is displaying the value of one rich text field which contain tables.when i render as pdf the table are getting overlapped. since that is the value of one field i am not able to use br tag also.Guide me to fix this issue.

Hi,

I want to display Stacked chart in salefsorce. This is the scenario.

 

Eg:

x-axis ----month(Jan,Feb.,,,,,).

y-axis----- record count

chart content------ User.

 

 

i want to display a how many records got created by each user for each month . user count is dynamic.. here its 3. based on query user count will change. how to implement this?

 

 

 

 

<apex:chart data="{!data}" height="400" width="500">
    <apex:legend position="left"/>
    <apex:axis type="Numeric" position="left" title="Closed Won" grid="true"
        fields="data1,data2,data3" dashSize="2"> -----can we make this field data dynamic like data4,date5
        <apex:chartLabel/>
    </apex:axis>
    <apex:axis type="Category" position="bottom" fields="name" title="Stacked Bars">
        <apex:chartLabel rotate="315"/>
    </apex:axis>
    <apex:barSeries orientation="vertical" axis="left" stacked="true"
        xField="name" yField="data1,data2,data3" title="MacDonald,Promas,Worle"/>-----can we make this field data dynamic like data4,date5
</apex:chart>

 

  • April 03, 2013
  • Like
  • 0

Hi,

 

I am using one Fieldset in two different Visualforce pages.  I want to change one field label in one visualforce page. Second Visualforce page will remaining same.How can I achieve this?

  • March 22, 2013
  • Like
  • 0

Hi,

 

I am having two object called objectA and objectB and both having same set of fields. Now I want to copy the objectA record to objectB periodically or on save of objectA record. Is there any solution to achieve this scenario. I thought of doing it in trigger, but I am have 100+ fields!.

  • March 06, 2013
  • Like
  • 0

Hi,

I am using Field set to display the transpose table. In the field set I am having 10 fields, among them I have to apply style to the particular field. Eg,.3rd field. How to do this,Guide me to resolve this issue.

  • January 30, 2013
  • Like
  • 0

Hi,

I read about salesforce canvas developer guide and understand the concept. but i unable to understand the usecase, Can anyone tell about it?

  • November 06, 2012
  • Like
  • 0

How to call Rest Api webservice from HTML and javascript? please provide me some sites or blog to start up.

  • September 25, 2012
  • Like
  • 0

hi,

 

I have tried to create enterprise.jar file. but i am getting the following error.

 

Location of the files:

D:\Program Files\Java\jdk1.6.0_30\lib---->wsc-22.jar

                                                                   ----->enterprise.wsdl

 


D:\Program Files\Java\jdk1.6.0_30\lib>java -classpath "D:\Program Files\Java\jdk
1.6.0_30\lib\wsc-22.jar" com.sforce.ws.tools.wsdlc enterprise.wsdl enterprise.ja
r
[WSC][wsdlc.run:312]Created temp dir: C:\DOCUME~1\abins9\LOCALS~1\Temp\wsdlc-tem
p-2576323047246107284-dir
Exception in thread "main" com.sforce.ws.wsdl.WsdlParseException: Parse error: e
nterprise.wsdl (The system cannot find the file specified)
        at com.sforce.ws.wsdl.WsdlFactory.create(WsdlFactory.java:61)
        at com.sforce.ws.tools.wsdlc.<init>(wsdlc.java:75)
        at com.sforce.ws.tools.wsdlc.run(wsdlc.java:312)
        at com.sforce.ws.tools.wsdlc.main(wsdlc.java:303)
Caused by: java.io.FileNotFoundException: enterprise.wsdl (The system cannot fin
d the file specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(Unknown Source)
        at java.io.FileInputStream.<init>(Unknown Source)
        at com.sforce.ws.wsdl.WsdlFactory.create(WsdlFactory.java:58)
        ... 3 more

D:\Program Files\Java\jdk1.6.0_30\lib>

 

  • September 07, 2012
  • Like
  • 0

I am using below URL to send email with relavent email template and users. i need to send two email at the same time, but its sending mail to only one emailID(last one).

 

i am unable to use workflow also because i am having the email id in formula field.

 

how to rectify this issue.

 

location.replace('/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&template_id=<yourtemplate_here>&p26=me@mydomain.com1&new_template=true');

 

location.replace('/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&template_id=<yourtemplate_here>&p26=me@mydomain.com2&new_template=true');

Below is the Requirement for the formula field.

 

VS1 := Type = "Spill" & Common = "1" or Common = "2";
VS2 := Type = "Injury" & InjuryType = "Death" or InjuryType= "Accident";
VS3 := Type = "Injury" &CompDis= "PPD" or CompDis= "PTD";
If(VS1 ; "fatality"; "" ) :
If(VS2 ; "permanent disability" ; "" ) :
If(VS3 ; "$100,000 US" ; "" ) :
If( !VS1 & !VS3 ; " Other fire" ; "" ) :

 

I Had designed the formula field for this requirement

 

IF((text( Type__c)=='Spill')&&((text( Common__c )=='1')||(text( Common__c )=='2')), 'fatality',
       IF((text( Type__c)=='Injury')&&(text( InjuryType__c )=='Death')||(text( InjuryType__c )=='Accident'), 'permanent disability',
                IF((text( Type__c)=='Injury')&&((text(CompDis__c)=='PPD')||(text( CompDis__c )=='PTD')), '$100,000 US', null
                        If( !VS1 & !VS3 ; "Other fire" ; "" ) :(How I can implement this IF condition inside this formula field)?
                 )
        )
)

How to write the below code in SOQL format?

 

SQL:-

 

SELECT ROW_NUMBER() 
        OVER (ORDER BY EmployeeName) AS Row, 
    EmployeeId, EmployeeName, Salary 
FROM Employees where Row BETWEEN 2 AND 4

Is there any possibility to write a trigger on document object?



1.How to display the image which is in rich text area in visual force page. in user object i am having one custom field called signature, i need to display the current user image(signature) in visual force page? i am rendering the visual force page as a PDF.

 

2. How to upload the image to rich text field using data loader?

Hi, I want to get full fault message in SOAP API call. But right now, it’s not possible in Salesforce. I found the below workaround in one site. Can anyone guide me to get full message and how to implement the below workaround?

1.Add an 'error' string field to the response class. You then do your webservice call to an intermediate layer which hides these exceptions and always returns to salesforce a 'valid' response.
 
  • December 15, 2015
  • Like
  • 1
Hi, 
I am trying to login salesforce community, when i login the third part site.
For this i have created
1.Auth. Provider as open ID connect by giving value for customerkey, enpointURLs, customsecretes and all.
2. copy past the Test-Only Initialization URL in browser.
3. Given USer name and password in third party login page
4. After that i am getting following error:
              Error:There was a problem with your authentication attempt. Please try again. If you continue to encounter problems, contact your administrator.
           URL:hostname//_nc_external/identity/sso/ui/AuthorizationError?ErrorCode=No_Oauth_Token&ErrorDescription=Empty+Response


Giude me to get rid of this issue, tried in many ways like , created Connected App, Update Remote site setting etc. But No Luck. 
Hi, 
I am trying to login salesforce community, when I login the third part site. 
For this I have created 
1.Auth. Provider as open ID connect by giving value for customerkey, enpointURLs, customsecretes and all.
2. Copy past the Test-Only Initialization URL in browser.
3. Given User name and password in third party login page
4. After that I am getting following error:
              Error: There was a problem with your authentication attempt. Please try again. If you continue to encounter problems, contact your administrator.
           URL:hostname//_nc_external/identity/sso/ui/AuthorizationError?ErrorCode=No_Oauth_Token&ErrorDescription=Empty+Response

Guide me to get rid of this issue, tried in many ways like , created Connected App, Update Remote site setting etc. But No Luck. 
 
  • April 21, 2015
  • Like
  • 2
There is force.com site as below:
http://handyman.force.com/HandymanContractor?id=003U0000017bs66IAA

Upon entry of a Contractor ID(003U0000017bs66IAA) in visualforce, the system will perform a real-time integration with the Handyman site and obtain the Name and credentials for the specified contractor.
Could any one help how to implement it?
Hi all,

I'm putting together a community site using one of the new Winter '15 templates and looking to add a chat button/link that routes to a pre-chat form.  I've configured/generated the following live agent deployment and button code (IDs replaced with '*') and dropped it into an html element of the community: 

<a id="liveagent_button_online_***************" href="javascript://Chat" onclick="liveagent.startChat('***************')">Click here to chat with us!</a>
<div id="liveagent_button_offline_***************" style="display: none;">No agents are currently available.</div>
<script type="text/javascript">
if (!window._laq) { window._laq = []; }
window._laq.push(function(){liveagent.showWhenOnline('***************', document.getElementById('liveagent_button_online_***************'));
liveagent.showWhenOffline('***************', document.getElementById('liveagent_button_offline_***************'));
});
</script>
    
<script type='text/javascript' src='https://c.la3-c1-was.salesforceliveagent.com/content/g/js/31.0/deployment.js'></script>
<script type='text/javascript'>
liveagent.init('https://d.la3-c1-was.salesforceliveagent.com/chat', '***************', '***************');
</script>

I've tried this same code on a community page created from a custom Site.com template, and it works just fine.  When I use it on the community template, the link doesn't seem to recognize whether a chat agent is online, so it always displays the available message.  Also, when I click on the link, I get the message "Uncaught TypeError: Cannot read propert 'startChat' of undefined" using the Chrome console.

Any help would be greatly appreciated!
TO Create Workflow we have to goto Setup -> Create -> Workflow & Approvals.
I am unable to see this "Workflow & Approvals".
I am having developer Org and I heard that this should be available in developer Org.
I tried changing some settings but no luck.
Hi,

I have a Time based workflow, which has to fire based on the close and it will update a field to lost.
Not able to find whether time based workflow has fired or not, since field update has not happed, and even field history tracking was not enabled.
IS there way to track this thing??



Dear Gurus,

Need your help on the following

[Scenario]
  • Person Account is on the org
  • When changing Account on Case, expected Contact is automatically changed. It was not.
  • I wrote a trigger as follows to enforce changing Contact on Account change.
  • Unfortunately it was not working though there was no error.
[Code]

trigger trgGetContactInfo on Case (before insert, before update, after insert, after update) {

    for(Case cas  : Trigger.New) 
        {    
            //Trigger Action Logic 
            List<Account> accList = [Select id from Account where id =: cas.AccountId]; 
                
            for(Account acc : accList) 
                { 
                    List<Contact> conList = [Select id, name from Contact where id =: acc.id];

                    for(Contact con : conList)
                        {
                            cas.ContactId = con.id;
                        }
                }
      // update cas;
        } 
}

Thanks for your help in advance.
Julian Lee 
Hi,
I would like to backup all my work from my current company org to my personal developer account org for my references. Is this possible?
If not, how can I save all my work for future references?

Thanks.
Hi, how can i default a dependent picklist value if there is only one value?

for example, i have controling picklist value of A,B,C and dependent picklist value of 1,2,3,6,7,8

A - 1,2,3
B - 6
C - 7,8

so when i select B my dependent picklist will automatically show 6 instead of None and need to choose again since there is only onle value there.
While importing data using data loader validation rules should be bypassed and for normal users validation rules should be enforced    how can you do that?

Hi,

 

I am having two object called objectA and objectB and both having same set of fields. Now I want to copy the objectA record to objectB periodically or on save of objectA record. Is there any solution to achieve this scenario. I thought of doing it in trigger, but I am have 100+ fields!.

  • March 06, 2013
  • Like
  • 0

1.How to display the image which is in rich text area in visual force page. in user object i am having one custom field called signature, i need to display the current user image(signature) in visual force page? i am rendering the visual force page as a PDF.

 

2. How to upload the image to rich text field using data loader?

Is there any possibilities to use inputText tag when we use 'StandardController ’ in  visualForce page? If so, how to save the values which is inputText? Do I need to write/override save button functionality to achieve this?  

I have wrote a trigger, this trigger will initiate only for the particular profile.so I wrote  trigger like this:

But its not covering the code which is inside the if condition. how to make the if condition "true" in test class?

 

trigger TriggerOnAttachments on Attachment (after insert) {
  Profile ProfileName = [select Name from profile where id = :userinfo.getProfileId()];
    if(ProfileName.Name=='AD - Integration User'){
    List<Id> parentIds=new List<Id>();
    for (Attachment att : trigger.new) {
         parentIds.add(att.ParentId);
    }
    List<Material_Sales_Data2__c> msd2 = [select id, Attachment_Exist__c from Material_Sales_Data2__c where id in :parentIds];
    if(msd2.size()>0) {
        for (Material_Sales_Data2__c msd : msd2) {
            msd.Attachment_Exist__c = true;
        }
        update msd2;
}    }                   
}

 

 

 

Test Class

 

@isTest
private class TriggerOnAttachmentsTest {

    static testMethod void myUnitTest() {
       
        Material_Sales_Data2__c msd2=new Material_Sales_Data2__c(Attachment_Exist__c=true,Material_Number__c='782222',Dist_Channel_Code__c='31',Record_Key__c='Recordkey01',Sales_Org_Code__c='1000');
        insert msd2; 
        
        List<Material_Sales_Data2__c> msd2obj=[select id, name from Material_Sales_Data2__c where id=:msd2.id];
        System.assertEquals(true, msd2.Attachment_Exist__c);
            
        Attachment attach=new Attachment();     
        attach.Name='Unit Test Attachment';
        Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
        attach.body=bodyBlob;
        attach.parentId=msd2.id;
        insert attach;
        
        List<Attachment> attachments=[select id, name from Attachment where parent.id=:msd2.id];
        System.assertEquals(1, attachments.size());
    }
}
  • April 17, 2012
  • Like
  • 0

I need to get current user profile name in trigger. I tried by using following way. Is there any possibility to get profile name directly without query.

 

trigger triggerName on CustomObject(after Insert){

Profile ProfileName = [select Name from profile where id = :userinfo.getProfileId()];
if(ProfileName.Name=='System Administrator'){

//code

}

}

  • April 11, 2012
  • Like
  • 0

I wrote one trigger code on attachments. It will enable one check box in parent object if we add new attachments. Please find below code. It is working fine but when we do bulk insertion it’s not working fine. What mistake i did? How can i promote for bulk insertion also?

 

Parent object :Material__c

Parent Object field: Attachment_Exist__c(Check Box)

 

trigger TriggerOnAttachments on Attachment (after insert) {

List<Material__c> msd2 = [select id, Attachment_Exist__c from Material__c where id =: Trigger.New[0].ParentId];

                        if(msd2.size()>0)
                        {
                                    msd2[0].Attachment_Exist__c = true;
                                    update msd2;
                        }                      
}
  • April 10, 2012
  • Like
  • 0

Hi,

 

I need to create multi select lookup. Once i click the lookup icon, one window should open with list of values and allow the user to select more than one value by clicking checkbox nearer to that value. Once After clicking “done” button, all the selected values should reflect in relevant lookup field in parent window. I am having the coding for single selection, but i need for multiple selected values.

  • March 28, 2012
  • Like
  • 0

Hi I need to write test class for the following trigger, but i could able to cover 65%.

 


trigger FormTypeAttachments on Attachment (before insert) {

List<Information_document_scan__c> FormType = [select id, Select_Form_Type__c from Information_document_scan__c where id =:Trigger.New[0].ParentId];
 List<Attachment> atts = Trigger.new;
 for(Attachment a:atts) {
    if(FormType[0].Select_Form_Type__c=='Signature Card'){
        a.addError('Signature Card should have only Four attachments.To go back to record,Click "Done" Button');
    }
  }
}

"a.addError" is not covering, how to Achieve more then 75%?

  • February 22, 2012
  • Like
  • 0

I am new to this data migration section.

 

I am using two different developer edition.


when I try to export the attachments from one developer login, it is exported.
when I try to import that attachments in to another developer login, it showing an error.

 

if any body knows please let me know.

  • March 10, 2011
  • Like
  • 0

Hi,

 

- Sorry to bother, but I found no answer to this wuestion either on the web, or in the dev forum, or in the Apex documentation - 

 

I have a trigger, which detects error conditions and feeds errors to the class or field.

This gives a nice result interactively, in the GUI.

But how do I write test code to catch these errors ?  Is there a System.AssertException(), or the equivalent ? 

 

trigger createOrder on Asset (after insert, after update) {[...] if (price.get(a.Product2Id) == NULL) { System.debug(' error : no active price'); a.Product2Id.addError('no active price on the Product'); }[...]}

 

 

 

  • August 31, 2009
  • Like
  • 1