• Karthi_Velu
  • NEWBIE
  • 75 Points
  • Member since 2009

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

hi

 

 

can u please tell me how to retrieve the User timezone in s-control?

 

var user = sforce.connection.getUserInfo();
alert("your timezone is: " + user.userTimeZone);

 

if i give like that i got the time zone like this America/Chicago.

 

 

but i want the complete time zone like

 

(GMT-06:00) Central Standard Time (America/Chicago)

 

Please help me how to get this.

I want get the WebTab URL from Apex Controller. I got a  describeTabs Link Example But i iam getting Error SysLog:

 

19:04:27 ERROR - Compile error: Invalid type: DescribeTabSetResult

 

In Eclipse IDE: Invalid type: DescribeTabSetResult  

 

Code:

private void describeTabSet (){  try {    DescribeTabSetResult[] dtsrs = binding.describeTabs();    System.out.println("There are " + new Integer(dtsrs.length).toString() +                        " tabsets defined.");    for (int i=0;i<dtsrs.length;i++) {      System.out.println("Tabset " + new Integer(i + 1).toString() + ":");      DescribeTabSetResult dtsr = dtsrs[i];      String tabSetLabel = dtsr.getLabel();      String logoUrl = dtsr.getLogoUrl();      boolean isSelected = dtsr.isSelected();      DescribeTab[] tabs = dtsr.getTabs();      System.out.println("Label is " + tabSetLabel + " logo url is " + logoUrl + ",                 there are " + new Integer(tabs.length) + " tabs defined in this set.                 This tab is selected: " + isSelected);      for (int j=0;j<tabs.length;j++) {        DescribeTab tab = tabs[j];        String tabLabel = tab.getLabel();        String objectName = tab.getSobjectName();        String tabUrl = tab.getUrl();        System.out.println("\tTab " + new Integer(j + 1) + ": \n\t\tLabel = " +            tabLabel + "\n\t\tObject details on tab: " + objectName + "\n\t\t" +           "Url to tab: " + tabUrl);      }    }  } catch (Exception ex) {    System.out.println("\nFailed to describe tabs, error message was: \n" +                        ex.getMessage());  } 

}

 

Thanks in advance for your valuable suggestion. 

Folks,

 

I having VF page same as view on lead.  

Requirements':

 

1. a field(View Name) should not allowed duplicate name.

2. if we enter the view name then directly(poiter should be in view name input field) click on save button(consider submit).

 

Now My code is like.

1.onclick js function on save button trying to call <apex:actionFunction>  ajax js function to verify the view name existence. 

2. But Javascript call the  apex:actionFunction ajax, with out waiting till the response. it follows the statements and trying to submit the form.

 

 

Ex.<input type="submit" onclick="jsValidate()">function jsValidate(){alert('1');AjaxCheck(document.getElementById('viewname').value);alert('2');//the above function called. with out getting response. returned the function so form was sumbitted.}

 

 

But in normal ajax in JSP can wait till getting the response.   

 

Folks,

 

From my apex class i want to get the 'Web Tab' URL using its name.  I want to avoid the hardcoding the url my code following.

 

 

private final String RedirectUrl = '/servlet/servlet.Integration?lid=01r70000000EWxQ&ic=1'; public PageReference cancelView(){ PageReference newPage = new PageReference(RedirectUrl); newPage.setRedirect(true); return newPage; }

 

 

 

Folk,

 

I am having one dropdown on Visual Force page. Onchange event i am creating new options for this select using java script. And for this select option one String varible on controller.

 

VF tag:

  <apex:selectList onchange="javascript:change()" id="myselect" size="1" value="{!testSelect}">

<apex:selectOptions value="{!picklist}"></apex:selectOptions> </apex:selectList>

 JS Funtion:

 

<script language='JavaScript'>function change(){alert('{!$Component.form.block.myselect}'); tbox = document.getElementById('{!$Component.form.block.myselect}'); clearlistbox(tbox); for(i=0; i < 5 ; i++) { var no = new Option(); no.value = 'karthi' + i; no.text = 'karthi' + i; tbox[i] = no; } } function clearlistbox(lb){ for (var i=lb.options.length-1; i>=0; i--){ lb.options[i] = null; } lb.selectedIndex = -1; }</script>

 

 

 

Controller:

 

public List<SelectOption> getPicklist(){ List<SelectOption> options = new List<SelectOption>{new SelectOption('Silambarasan','Silambarasan'),new SelectOption('Velu','Velu'),new SelectOption('Banu','Banu')}; return options; } public String testSelect {set;get;}

 

On clicking the save button i am getting the following error:

 

j_id0:form:block:myselect: Validation Error: Value is not valid

 

 Full code for VF PAge:

 

<apex:page standardController="VbApp__c" extensions="VBAPPController" ><script language='JavaScript'>function change(){alert('{!$Component.form.block.myselect}'); tbox = document.getElementById('{!$Component.form.block.myselect}'); clearlistbox(tbox); for(i=0; i < 5 ; i++) { var no = new Option(); no.value = 'karthi' + i; no.text = 'karthi' + i; tbox[i] = no; } } function clearlistbox(lb){ for (var i=lb.options.length-1; i>=0; i--){ lb.options[i] = null; } lb.selectedIndex = -1; }</script> <apex:form ID="form"> <apex:sectionHeader title="Welcom to VB Application"/> <apex:pageBlock id="block"> <apex:pageBlockButtons location="both"> <apex:commandButton action="{!save}" value="Save"/> </apex:pageBlockButtons> Name:<apex:inputText value="{!vbname}"/><br/> PickList: <apex:selectList size="1" multiselect="false"> <apex:selectOptions value="{!picklist}"></apex:selectOptions> </apex:selectList> <br/> Myselect: <apex:selectList onchange="javascript:change()" id="myselect" size="1" value="{!testSelect}"> <apex:selectOptions value="{!picklist}"></apex:selectOptions> </apex:selectList> </apex:pageBlock> </apex:form></apex:page>

 and 

 

Example for page shows

 

After changed the dromdown. I am trying to save on this time I am gettingerror "j_id0:form:block:myselect: Validation Error: Value is not valid"

Hi folks,

I am interested to do salesforce.com developer Certification. I am from inida. What is the procedure and where i will get the voucher. Where all exam centre available. I want only do the certification(with out seminar fee).

Advance thanks for your suggestion and syllabus for certification.


Folks,

 

Iam having requirement in addition of a VF page as same functionality of 'Create new view' of Lead Object Page. is there andy example or SF componenet is available.

 

 

Folks,

 

Iam creating a 'Visual Force' page as 'Lead' Object view. for the following functionality i am confusing....

 

Can any one explain the detailed Concept of Roles & Roles and Subordinates visiblity on creating view in Lead,... 

 

ceo ---> role1---->role-sub-1--->role-sub-2

|-------> role-branch1// share view for R & Subs

|----------------> role-branch2

 

i have created a view 'View1' and shared to 'Roles and Subordinates' as 'role-branch1' .

1 . is 'ceo' can view == Yes/NO

2.  is 'role1' can view == Yes/NO

3.  is 'role-branch1' can view == Yes/NO

4.  is 'role-branch2' can view == Yes/NO.

 

Also Wat is the ans for only shared 'Roles'  as 'role-branch1'.

 

If possible explain about public group also.. 

 

Hi Folk,

 

The below code is working in with '.html' file from local.

 

But when intergrating with S-Controls, It telling "[Object Error]" in IE.7 and "Error: A script from "https://na5.salesforce.com" was denied UniversalXPConnect privileges." in Mozilla. 

 

If you having any other solution to launch .exe from S-Controls (Consider S-Controls having the full path of .exe)  on windows client machine.

 

 

HTML:

============

 

<a href='#' onclick='launchExeToCall();return true;'>call</a>

 

 

JS

=========== 

 

 

/*

*to Launch the click2call application

*/

function launchExeToCall()

{

var browser=navigator.appName;

// var path = getLaunchExePath();

var path = "C:\\n.exe";

if (browser=="Microsoft Internet Explorer") {

alert("Microsoft Internet Explorer s");

runExeOnIE('\"'+path+'\"');

} else if(browser=="Netscape") {

alert("Netscape q");

runExeOnMozilla(path);

}

}

 

/*

*  launch the application in IE

*/

function runExeOnIE(path) {

try{

path="\"C:\\n.exe\"";

WSH=new ActiveXObject("WScript.Shell");

WSH.run(path);

} catch(e){

alert(e);

}

}

 

/*

*  launch the application in Mozzila.

*/

function runExeOnMozilla(path) {

alert('started lanuch');

try{

netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');

var file = Components.classes["@mozilla.org/file/local;1"]

                    .createInstance(Components.interfaces.nsILocalFile);

path = "C:\\Progra~1\\Skype\\Phone\\Skype.exe";

file.initWithPath(path);

 

var process = Components.classes["@mozilla.org/process/util;1"]

                       .createInstance(Components.interfaces.nsIProcess);

process.init(file);

 

// Run the process.

// If first param is true, calling thread will be blocked until

// called process terminates.

// Second and third params are used to pass command-line arguments

// to the process.

var args = ["argument1", "argument2"];

process.run(false, args, args.length);

 

 

} catch(err){

alert(err);

}

}

 

 

Hi All,

 

Can any help me How to update a Field in paritcular Table(object), i tried to update a Lead record, but i coud't set the id value.

 

ex,

 

Lead leadOldObject = ref for exsiting; //existing lead object ....

 

Lead l = new Lead();

l.LastName =  l.LastName +'Its me';

l.id = new ID(leadOldObject.id); // if i commited this line getting error as no id was assigned for update objects

update l;

 

<end> 

 

l.id = new ID(leadOldObject.id);

if i commited the above line getting error as no id was assigned for update throw 

 

not commented means i compiler error on this line..

 

Thnx in advance! 

Hi,

 

Can any one help me "How To print the Log message in console using Apex or Trigger"

 

System.debug('text') wast not working or printing in "System Log"  link, even iadded the user in setup ===> monitoring ===> debug logs.. No Use..

 

Thnx KarthiVB

Hi,

 

I am New to salesForce. I had two issue.

1). using System.debug('Log messgae'); in trigger apex code, i can't the log in "System Log" link.

2). while using Trigger on Lead after update/insert i cant change the lead object value.

3). can you give any update example in apex or trigger(how to set the id).

 

example code:

 

trigger ChangeLeadCheckStatus on Lead (after insert, after update) {
       system.debug('test Karthig');
       if (true) {
            Lead[] newLead = Trigger.new;
            newLead[0].LastName = newLead[0].LastName + '_VB_';
       }

}

I am trying to create apex class from wsdl (WCF service) but getting the following error.

Error: Failed to parse wsdl: Unsupported Schema element found http://www.w3.org/2001/XMLSchema:attribute. At: 1:4163
I am using Xml serializer as sfdc may not support datacontract serialzer. i cannot paste the wsdl here as it is not allowing me that many lines. if somebody faced the same problem earlier please suggest the things to take care for integrating WCF with SFDC.
praveen

Hi All,

 

I have an future method that inserts/updates user. However during checking on Setup->Monitoring->Apex Jobs I found out that there are some instances that I get the an error 'First error: Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, group membership operation already in progress:'

 

I'm not sure about the error since it was not meaningful to me. Can somebody shed some light regarding this issue? I have tried search for other thread but none to avail.

 

Regards

Hi,

 

I try to generate Apex classes from WSDL but I get an error stating that "attribute" is not supported.

 

Nevertheless, the help page: Apex callouts says it's supported after v15.0

 

Is there something to activate to use the last version of wsdl2apex ?

 

Thanks.

  • August 18, 2010
  • Like
  • 0

I want get the WebTab URL from Apex Controller. I got a  describeTabs Link Example But i iam getting Error SysLog:

 

19:04:27 ERROR - Compile error: Invalid type: DescribeTabSetResult

 

In Eclipse IDE: Invalid type: DescribeTabSetResult  

 

Code:

private void describeTabSet (){  try {    DescribeTabSetResult[] dtsrs = binding.describeTabs();    System.out.println("There are " + new Integer(dtsrs.length).toString() +                        " tabsets defined.");    for (int i=0;i<dtsrs.length;i++) {      System.out.println("Tabset " + new Integer(i + 1).toString() + ":");      DescribeTabSetResult dtsr = dtsrs[i];      String tabSetLabel = dtsr.getLabel();      String logoUrl = dtsr.getLogoUrl();      boolean isSelected = dtsr.isSelected();      DescribeTab[] tabs = dtsr.getTabs();      System.out.println("Label is " + tabSetLabel + " logo url is " + logoUrl + ",                 there are " + new Integer(tabs.length) + " tabs defined in this set.                 This tab is selected: " + isSelected);      for (int j=0;j<tabs.length;j++) {        DescribeTab tab = tabs[j];        String tabLabel = tab.getLabel();        String objectName = tab.getSobjectName();        String tabUrl = tab.getUrl();        System.out.println("\tTab " + new Integer(j + 1) + ": \n\t\tLabel = " +            tabLabel + "\n\t\tObject details on tab: " + objectName + "\n\t\t" +           "Url to tab: " + tabUrl);      }    }  } catch (Exception ex) {    System.out.println("\nFailed to describe tabs, error message was: \n" +                        ex.getMessage());  } 

}

 

Thanks in advance for your valuable suggestion. 

Folks,

 

From my apex class i want to get the 'Web Tab' URL using its name.  I want to avoid the hardcoding the url my code following.

 

 

private final String RedirectUrl = '/servlet/servlet.Integration?lid=01r70000000EWxQ&ic=1'; public PageReference cancelView(){ PageReference newPage = new PageReference(RedirectUrl); newPage.setRedirect(true); return newPage; }

 

 

 

Folk,

 

I am having one dropdown on Visual Force page. Onchange event i am creating new options for this select using java script. And for this select option one String varible on controller.

 

VF tag:

  <apex:selectList onchange="javascript:change()" id="myselect" size="1" value="{!testSelect}">

<apex:selectOptions value="{!picklist}"></apex:selectOptions> </apex:selectList>

 JS Funtion:

 

<script language='JavaScript'>function change(){alert('{!$Component.form.block.myselect}'); tbox = document.getElementById('{!$Component.form.block.myselect}'); clearlistbox(tbox); for(i=0; i < 5 ; i++) { var no = new Option(); no.value = 'karthi' + i; no.text = 'karthi' + i; tbox[i] = no; } } function clearlistbox(lb){ for (var i=lb.options.length-1; i>=0; i--){ lb.options[i] = null; } lb.selectedIndex = -1; }</script>

 

 

 

Controller:

 

public List<SelectOption> getPicklist(){ List<SelectOption> options = new List<SelectOption>{new SelectOption('Silambarasan','Silambarasan'),new SelectOption('Velu','Velu'),new SelectOption('Banu','Banu')}; return options; } public String testSelect {set;get;}

 

On clicking the save button i am getting the following error:

 

j_id0:form:block:myselect: Validation Error: Value is not valid

 

 Full code for VF PAge:

 

<apex:page standardController="VbApp__c" extensions="VBAPPController" ><script language='JavaScript'>function change(){alert('{!$Component.form.block.myselect}'); tbox = document.getElementById('{!$Component.form.block.myselect}'); clearlistbox(tbox); for(i=0; i < 5 ; i++) { var no = new Option(); no.value = 'karthi' + i; no.text = 'karthi' + i; tbox[i] = no; } } function clearlistbox(lb){ for (var i=lb.options.length-1; i>=0; i--){ lb.options[i] = null; } lb.selectedIndex = -1; }</script> <apex:form ID="form"> <apex:sectionHeader title="Welcom to VB Application"/> <apex:pageBlock id="block"> <apex:pageBlockButtons location="both"> <apex:commandButton action="{!save}" value="Save"/> </apex:pageBlockButtons> Name:<apex:inputText value="{!vbname}"/><br/> PickList: <apex:selectList size="1" multiselect="false"> <apex:selectOptions value="{!picklist}"></apex:selectOptions> </apex:selectList> <br/> Myselect: <apex:selectList onchange="javascript:change()" id="myselect" size="1" value="{!testSelect}"> <apex:selectOptions value="{!picklist}"></apex:selectOptions> </apex:selectList> </apex:pageBlock> </apex:form></apex:page>

 and 

 

Example for page shows

 

After changed the dromdown. I am trying to save on this time I am gettingerror "j_id0:form:block:myselect: Validation Error: Value is not valid"

I want to use a web tab but I don't want to hard code the url into the web tab.  Is there an easy way to define some other object that the web tab content can reference?

 

I want to avoid having hard coded urls all over my application.  When going from dev to integration to production I would like the configuration data in one location.

 

 

  • May 05, 2009
  • Like
  • 0
Hi folks,

I am interested to do salesforce.com developer Certification. I am from inida. What is the procedure and where i will get the voucher. Where all exam centre available. I want only do the certification(with out seminar fee).

Advance thanks for your suggestion and syllabus for certification.


Hi Folk,

 

The below code is working in with '.html' file from local.

 

But when intergrating with S-Controls, It telling "[Object Error]" in IE.7 and "Error: A script from "https://na5.salesforce.com" was denied UniversalXPConnect privileges." in Mozilla. 

 

If you having any other solution to launch .exe from S-Controls (Consider S-Controls having the full path of .exe)  on windows client machine.

 

 

HTML:

============

 

<a href='#' onclick='launchExeToCall();return true;'>call</a>

 

 

JS

=========== 

 

 

/*

*to Launch the click2call application

*/

function launchExeToCall()

{

var browser=navigator.appName;

// var path = getLaunchExePath();

var path = "C:\\n.exe";

if (browser=="Microsoft Internet Explorer") {

alert("Microsoft Internet Explorer s");

runExeOnIE('\"'+path+'\"');

} else if(browser=="Netscape") {

alert("Netscape q");

runExeOnMozilla(path);

}

}

 

/*

*  launch the application in IE

*/

function runExeOnIE(path) {

try{

path="\"C:\\n.exe\"";

WSH=new ActiveXObject("WScript.Shell");

WSH.run(path);

} catch(e){

alert(e);

}

}

 

/*

*  launch the application in Mozzila.

*/

function runExeOnMozilla(path) {

alert('started lanuch');

try{

netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');

var file = Components.classes["@mozilla.org/file/local;1"]

                    .createInstance(Components.interfaces.nsILocalFile);

path = "C:\\Progra~1\\Skype\\Phone\\Skype.exe";

file.initWithPath(path);

 

var process = Components.classes["@mozilla.org/process/util;1"]

                       .createInstance(Components.interfaces.nsIProcess);

process.init(file);

 

// Run the process.

// If first param is true, calling thread will be blocked until

// called process terminates.

// Second and third params are used to pass command-line arguments

// to the process.

var args = ["argument1", "argument2"];

process.run(false, args, args.length);

 

 

} catch(err){

alert(err);

}

}

 

 

I'm overriding "delete" on std object Asset, pointing it to a vf page whose controller should either delete the asset or (if it has related custom objects) redirect to a vf page which warns the user that these relationships will be broken, dispays the related list, and offers a "delete anyway" button.

 

Following delete of the asset, I want to emulate standard salesforce behavior, that is, display the Products tab home page.

 

How can I determine the url of the Products page within my apex controller?

 

 

hi

 

 

can u please tell me how to retrieve the User timezone in s-control?

 

var user = sforce.connection.getUserInfo();
alert("your timezone is: " + user.userTimeZone);

 

if i give like that i got the time zone like this America/Chicago.

 

 

but i want the complete time zone like

 

(GMT-06:00) Central Standard Time (America/Chicago)

 

Please help me how to get this.

Hi All,

 

Can any help me How to update a Field in paritcular Table(object), i tried to update a Lead record, but i coud't set the id value.

 

ex,

 

Lead leadOldObject = ref for exsiting; //existing lead object ....

 

Lead l = new Lead();

l.LastName =  l.LastName +'Its me';

l.id = new ID(leadOldObject.id); // if i commited this line getting error as no id was assigned for update objects

update l;

 

<end> 

 

l.id = new ID(leadOldObject.id);

if i commited the above line getting error as no id was assigned for update throw 

 

not commented means i compiler error on this line..

 

Thnx in advance! 

Hi,

 

Can any one help me "How To print the Log message in console using Apex or Trigger"

 

System.debug('text') wast not working or printing in "System Log"  link, even iadded the user in setup ===> monitoring ===> debug logs.. No Use..

 

Thnx KarthiVB

Hi,

 

I am New to salesForce. I had two issue.

1). using System.debug('Log messgae'); in trigger apex code, i can't the log in "System Log" link.

2). while using Trigger on Lead after update/insert i cant change the lead object value.

3). can you give any update example in apex or trigger(how to set the id).

 

example code:

 

trigger ChangeLeadCheckStatus on Lead (after insert, after update) {
       system.debug('test Karthig');
       if (true) {
            Lead[] newLead = Trigger.new;
            newLead[0].LastName = newLead[0].LastName + '_VB_';
       }

}

Hi,

 

I want to create folders and upload documents in SalesForce from .net code.  I am able to do both.  

Next, I want to store information about the user, the created document and the url where he created the document in sql server.  

 

As soon as I create a document using -  SFEnterpriseWSDL.SaveResult[] results = binding.create(sdocObj), I get back results.

 

But, I can not get the URL where the document was created using this.  Any idea how can I get this information back.

 

Swati 

 Hello All,

 

I have an OpportunityLineItem (oli) before insert trigger that references the oli.ListPrice value.  The trigger works great in my sandbox when manually testing through the UI but is failing due to a null value for oli.ListPrice un unit testing.

 

I have verified that the issue is specifically that the oli.ListPrice value is null when adding the oli through the unit test code, but the ListPrice is not null when adding an oli through the UI.

 

Naturally, I suspected the unit test code had an issue with the PriceBook and PriceBookEntry process.  But after scouring the code, the Apex Code Language Reference section "Testing the Sample Application", and the developer boards, I'm not seeing anything that explains why the oli.ListPrice value would be null in the unit test.

 

The behavior seems like the assignment of the oli.ListPrice from the pbe.UnitPrice isn't happening in the correct sequence when the unit test is running but is occurring correctly when the UI is used.

 

Here is the unit test code that is resulting in a null oli.ListPrice when the oli before insert trigger is firing:



public class testTrigger {
static testMethod void testTriggers_Trigger () {

Product2 p = new product2(name='Test Product');
insert p;

Pricebook2 stdPb = [select Id from Pricebook2 where isStandard=true limit 1];
insert new PricebookEntry(pricebook2id = stdPb.id, product2id = p.id, unitprice=100.0, isActive=true);

Pricebook2 pb = new pricebook2(name='test pricebook');
insert pb;

PricebookEntry pbe = new PricebookEntry(pricebook2id=pb.id, product2id=p.id, unitprice=100.0, isActive=true);
insert pbe;

Opportunity o = new Opportunity(name='test', pricebook2id=pb.id, stageName='Open', CloseDate=Date.newInstance(2009,10,10) );
insert o;

OpportunityLineItem oli = new OpportunityLineItem(opportunityid=o.id, UnitPrice=100, quantity=1, pricebookentryid=pbe.Id);
insert oli;

}
}

 

 

I hope that you read this post and chuckle as you gently explain the obvious piece that I'm missing.  Otherwise, any input is appreciated.

 

Cheers,

-Philip 

 

 


 

Message Edited by Philip_F on 03-01-2009 06:01 PM
Message Edited by Philip_F on 03-01-2009 06:02 PM
I'm working on an app that is based upon the PersonAccount model (http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_guidelines_personaccounts.htm) and when I attempt to create a package for it I receive the error "Salesforce does not currently allow export of components referencing person account fields."

Does anyone know if SF has plans to support PersonAccounts in packages and if so, when?

Thanks.....
  • April 14, 2008
  • Like
  • 0
I am building an AppExchange app.  I have an S-Control assigned to a link on the Contact page.  When the link is clicked, user should be redirected my custom tab -- currently this works fine:  (see below).
 
top.window.location='https://na4.salesforce.com/servlet/servlet.Integration?lid=01r60000000197t&ic=1&myID=21';
 
Problem; current URL is hardcoded to my custom tab (i.e. https://na4.salesforce.com/servlet/servlet.Integration?lid=01r60000000197t&ic=1).  How to I reference and build the URL in javascript so the link will reference properly for anyone who downloads & uses my app?
 
I have tried using variations of {!UrlFor($Action.my Custom Tab.New,null,null)} ... but I must be missing something as it do not syntax check correctly.
 
Chris
 
 
 
 
  • November 16, 2007
  • Like
  • 0