• Anusha
  • NEWBIE
  • 215 Points
  • Member since 2010

  • Chatter
    Feed
  • 8
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 36
    Questions
  • 62
    Replies

Hi friends,

Did anybody aware of trail orgs, I have a managed package and I need to show demos to clients in a trail org.

If anybody knows about it please provide some information.

 

Thanks

Hi All,

       I have an image on my visualforce page (which is rendered as pdf as well). I want that image to redirect me to a link say : google  when it;s clicked. This redirection should also work when the page is rendered as pdf. This is what i have tried so far and itt doesnt work. Request you all to help.

 

    <script type="text/javascript">
    function popupwindow(){
        var newwindow = window.open("http://www.google.com/");
        newwindow.focus();
    }
    </script>

 

<apex:image url="{!$Resource.PDFImage}" onclick="popupwindow" width="550" height="50"/>

 

I  have also tried to use <a></a> tags , just outside <apex:image> but even that doesn't seem to work.

 

Regards

Shrey Tyagi

I have the below code where I have used if condition and wen i try to save it ,it throws the below error


Error: Syntax error


But when I remove the exclamatory mark before 'IF' it saves perfectly but the
condition is not satisfied.

I want the first window to open if the condition is true and the second if the condition is false.
Kindly help me

 

 

<apex:page showHeader="false" standardcontroller="Merchandise__c" extensions="callout1" wizard="true">


<apex:form >


<apex:pageBlock >
<apex:pageBlockButtons >
<apex:pageblockSection >
<apex:outputPanel id="panel">


<apex:commandButton value="Search" action="{!testing1}" rerender="panel" onclick="{!IF({!Merchandise__c.yoyo__c}!=null, 'window.open('/apex/twovalues?id={!idi}','','width=800,height=500')', 'alert('ShelfNo not available')')} "/>

<br/>

</apex:outputPanel>


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

 

 

Hi friends,

I have a requiremnt like,

there are 2 objects

BR

CN

 

And CN has a Lookup relationship with BR

 

Each BR may have more than one CNs;

On BR object one of the field will have some logic like below,

1 OR (2 AND 3)

 

FYI,

1, 2 and 3 are the CN records say some condition records

each condition record will have 3 fields like below,

Field Name              Operator                      Value

Status                        equals                         New

 

Now I need to perform validations from Apex.

Can someone help me ?

Thanks in advance.

 

 

 

How to find no of records in  a object using lookup relations?

Hi,

 

In me Lead object, I have created different list views.

I want to get all records of particular list view in VisualForce  page.

 

Please let me know, How can i get records from the list view of the object.

 

Thanks,

Hi All,

 

I have a trigger ( After Update). I want to write a test class for it. The idea is to send an Email to the concerned person upon modification of a note. Here Note is a lookup with Account. And an Account will have a contact. The email address is of the contact.

 

Code is :

Hi All,

I am facing one of the worst test class scenarios. I have a trigger ( After Update). The code is:

Trigger sendEmail on Note__c (after update)
{

 User pu;
 List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
 
 pu= [select u.Contact.Account.Rep1__r.Name,
 
 u.Contact.Account.Rep2__r.Name,
 u.Contact.Account.Rep1__r.Email,
 u.Contact.Account.Rep2__r.Email from User u where  u.id=:UserInfo.getUserId()]; 
 
 
 String Smail= pu.Contact.Account.Rep1__r.Email;
 String Imail= pu.Contact.Account.Rep2__r.Email;

 
 system.debug('Toaddress:'+Smail);

 
 List<User> listOfUser = [Select u.Name From User u WHERE Id=:Userinfo.getUserId() limit1];
 
 List<Note__c> nt = new List<Note__c>();

 nt = [select Note1__c,Note2__c from Note__c where id IN :Trigger.New];
 
  
 for(Note__c n : nt)
 {
 
  Note__c oldNote = Trigger.oldMap.get(n.ID);
 
  snew = n.Note1__c;
  sold = oldNote.Note1__c;
  inew = n.Note2__c;
  iold = oldNote.Note2__c;
 }

 
 for(User us:listofUser)
 {
    username=us.Name;
 }

    if(sold<>snew)
	{
      Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
      String[] toAddresses = new String[] {Imail}; 
      mail.setSubject('Samsung Notes Modified');
      mail.setToAddresses(toAddresses);
    
      mail.setHTMLBody('The Email Body');
      Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
     
     }
     
     
     
     }
}

 

 

Can anyone please help me with the test class? I have researched enough but I am not getting any coverage!

 

Hi 

I am customize a home page component but it is not working like standard home tabs like " Create New"  

 

my component HTML code is 

<iframe height="60px" src="/apex/search" width="90%" scrolling ="no" frameborder="0"></iframe>

 

 

 

 

Hello,

Could anybody help. 

I have one field where I am populating the Value from User Table and saving inside one lookup field. 

In the controller when saving this value in Lookup Field its giving the error as :

"Error System.StringException: Invalid id:"

 

Regards

Kit

Can i use action and onclick attribute on command line apex component together?

Can anyone give me some examples?

 

 

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>

 

I have set up a VF page to replace the edit page for a custom object “CompetencyOwner__c”.  The object contains two fields “Region__c” and “Country__c” which I want to be able to let the user change with selectLists.  I have no problem building the selectOption values and making the Country values dependent on the selected Region. My problem is that I don’t understand how to set the default value of the dropdowns based on the current record values of those fields.

 

I have a getter method to return the list of selectList values to populate the dropdowns. I also have getter and setter methods for the current value of the selection. Here’s an example for the Region field:

 

  String selectedRegion;  //for selected value

 

    public List<selectOption> getRegions() {

        List<SelectOption> regionOps=new List<SelectOption>();

        List<Region__c> regionList=[Select Name from Region__c Order by Name];

        for(Region__c r:regionList) {

            regionOps.add(new SelectOption(r.ID,r.Name));

        }

        return regionOps;

    }

 

    public String getSelectedRegion() {

        return SelectedRegion;

    }

          

    public void setSelectedRegion(String SelectedRegion)  {

        this.SelectedRegion=SelectedRegion;

    }

 

Assume I can get the actual record to be edited. How do I set the initial value of the dropdown to the selectOption that corresponds to the record ID or Name?

Hi There,

 

I have a requirement , I want to populate the Lookupfiled value in picklist value.

I was able to populate the lookup filed ID in picklist but not the the value of lookupfiled.

 

below is my trigger

 

trigger SyncPicklistFieldwithLookupField on OpportunityLineItem (before insert) {

list<OpportunityLineItem > oppSyncList=new list<OpportunityLineItem> ();

for(OpportunityLineItem  oppLineitem : trigger.new){

    if(oppLineitem.Product_Test__c!=null){
        system.debug('oppLineitem.Product_Test__c='+oppLineitem.Product_Test__c);
//PRODT_GROUP_NM__c is the pick list

        oppLineitem.PRODT_GROUP_NM__c=oppLineitem.Product_Test__c; // Product_Test__c is the lookup field

        

system.debug('oppLineitem.PRODT_GROUP_NM__c='+oppLineitem.PRODT_GROUP_NM__c);

        oppSyncList.add(oppLineitem);
        system.debug('oppSyncList='+oppSyncList);

    }

}
}

 

 

so how to populate look up filed value in pick list .

If any one know the solution please let me know.

Hi All , 

 

I have created a custom with javascript functionality and its working fine . I want when the same button is pressed twice or thrice  it should give alert message " Invalid action". I tried  using lot of things but its not working. I know it looks very easy but pls help me out in this issue. Below is the script:-

 

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}

 

var leadstatus = '{!Lead.Status}';
if (leadstatus != "Z-Program Approved")
{
alert('An Elite Id cannot be assigned unless the Lead Status is equal Z-Program Approved');
}

else{

// Now calling the webservice to create a new Id 
var callback = "" + sforce.apex.execute("CreateliteId","createlite", {LeadId:"{!Lead.Id}"});

// If create and update was ok - just reload Lead page to see the id of the elite partner
if(callback == 'OK' ){

alert('The Elite Id has been assigned');
window.location.reload();
}

 

else{
alert('Error: ' + callback);
}}

The text does not align left it is always aligned center why?

<apex:outputField value="{!doc__c}" style="text-align:left" />

I have tried using a span without luck, any other ideas?

Hi,

 

My requirement is to integrate salesforce with Linkedin and to show the shared connection between two contacts in a VF Page.

 

I have done the first step and generated the oauth_token and  in the oauth_callback, i have given the URL of Site with a VF page and same controller.

 

So, i generated a URL in the code as

 

LinkedAuthUri='https://api.linkedin.com/uas/oauth/authenticate?oauth_token='+unAuthorisedToken+'&oauth_callback='+oauth_callback1+'';


It gives me the URL as

 

https://api.linkedin.com/uas/oauth/authenticate?oauth_token=968c26de-8423-49ff-bab2-94fcfed60f88&oauth_callback=https%3A%2F%2social95-developer-edition.ap1.force.comer

If user validate this by clicking the link, it takes him to the site which i gave in oauth_callback and in the URL i get

 

oauthVerifier and oauthToken .

 

 

 

 

My problem is to get the oauthVerifier and oauthToken from the URL  so that i can send it in the request again.

 

i tried using ApexPages.currentPage().getParameters().get('oauth_verifier');


but it is coming as null because when the user verfies it  and then it takes it to the site i gave in oauth_callback. the controller is not getting instantiated again.

 

 

Any suggestion would be helpful.

 

 

Thanks,

Vineet