• Creatobug
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 9
    Replies
What does this mean?.
Does this mean that if I have a javascript code which is invoked on the click of an apex command button/ action support defined to call a function in the javascript will not get invoked?

Does it mean that a custom detail/list button having the javascript code won't work? eg: what is we are simply opening a VF page from a URL in window.open(). Will this not work is lightening is enabled?. 

I'm new to this so please excuse me if my question seems silly.
Approval.ProcessResult is supposed to have fields which identify which record is being processed (getEntityId()). However, this seems to be null for the records for which the approval process fails. Is this the expected behaviour?

Sample Code:
           Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
           req.setComments('Approval Comments');
           req.setObjectId(<Record ID>);
           LApproval.ProcessResult result = Approval.process(req, false);
           System.debug(result);

So how can we identify those records for which the approval process fails?

My requrement is to update the Currencyisocode field of a converted opportunity (from lead) with the Currencyisocode of the account associated with that opportunity.

 

Currently the field is getting populated with the Currencyisocode of the lead converted.I cant find any trigger/ workflow which is doing this. Is this the default functionality?.

 

I was able to achive this requirement with an 'after insert' trigger on opportunity but the 'before insert' trigger does not seem to work. So I assume that the value gets populated with the lead's Currencyisocode first and then the 'after insert' trigger updates the field again. I dont want this to happen . I want the field to get updated only once. 

 

Can anyone explain what is happening here? and also if possible suggest a workaround.

VF page

 

<apex:page controller="passtest" >
<script>
    function callit()
    {
        var well="Hello world";
        call(well);
    
    }
</script>
<apex:form id="frm">
<apex:commandButton value="clickit" onclick="callit();"/>
<apex:commandButton value="testit" action="{!testfunction}"/>
<apex:actionFunction name="call" action="{!recieveit}" reRender="frm">
<apex:param name="well" assignTo="{!ok}" value=""/>
</apex:actionFunction>

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

 

Controller


public class passtest
{
    public string ok{get;set;}
    public string ok1{get;set;}
    public PageReference recieveit()
    {
        
        system.debug('&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'+ok);
        ok1=ok;
        return null;
    }
    public void testfunction()
    {
        system.debug('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'+ok1);
    }
    

}

 

On the click of the first button the value of OK is set through the actionfuntion. However the value of ok is NULL when accessed in the second function by the click of the second button! even though the value is global. Can anyone explain why this happens??.  Could you suggest a solution?

Hey can anyone Help me understand why this doesn't work and suggest a work around?

 

VF page:

 

<apex:page controller="paneltest">

    <apex:form >
    <apex:commandbutton action="{!settabpanel1}" value="tabcol1" rerender="outputpanel1,outputpanel2,outputpanel3"/>
    <apex:commandbutton action="{!settabpanel2}" value="tabcol2" rerender="outputpanel1,outputpanel2,outputpanel3"/>
    <apex:commandbutton action="{!settabpanel3}" value="tabcol3" rerender="outputpanel1,outputpanel2,outputpanel3"/>
    <apex:outputpanel rendered="{!showpanel1}" id="outputpanel1">
        Panel1
    </apex:outputpanel>
    <apex:outputpanel rendered="{!showpanel2}" id="outputpanel2">
        panel2
    </apex:outputpanel>
    <apex:outputpanel rendered="{!showpanel3}" id="outputpanel3">
        Panel3
    </apex:outputpanel>
</apex:form>
</apex:page>

 

Controller:

 

public class paneltest
{
    public boolean showpanel1 {get;set;}
    public boolean showpanel2 {get;set;}
    public boolean showpanel3 {get;set;}
    public boolean getShowpanel1()
    {
        return showpanel1;
    }
    public boolean getShowpanel2()
    {
        return showpanel2;
    }
    public boolean getShowpanel3()
    {
        return showpanel3;
    }
    public paneltest()
    {
        showpanel1=true;
        showpanel2=false;
        showpanel3=false;
    }
    public pagereference settabpanel1()
    {
        showpanel1=true;
        showpanel2=false;
        showpanel3=false;
        return null;
    }
    public pagereference settabpanel2()
    {
        showpanel1=false;
        showpanel2=true;
        showpanel3=false;
        return null;
    }
    public pagereference settabpanel3()
    {
        showpanel1=false;
        showpanel2=false;
        showpanel3=true;
        return null;

    }
 
}

 

I have just started writing apex controller and I'm quite new to it.....and I'm not sure what is happening here....I wanted the output of the VF page to be 1 2 3 4 but instad it is 1 1 1 1.  Is there a work around for this?......I need the values within the <repeat>tag itself. 

<!-- The VF PAGE -->

<apex:page controller="increment" sidebar="false" showHeader="false" >
     <apex:repeat var="a" value="{!a}">
         {!i} <br/>
     </apex:repeat>
</apex:page>


/* The Controller ----Increment */

public class increment
{
    integer i=0;
    list<integer> a{get;set;}
      
    public integer geti()
    {
       
        i++;
        return i;
    }
    public list<integer> geta()
    {
        a = new list<integer>();
        a.add(10);
        a.add(10);
        a.add(10);
        a.add(10);
        return a;
    }
}


Approval.ProcessResult is supposed to have fields which identify which record is being processed (getEntityId()). However, this seems to be null for the records for which the approval process fails. Is this the expected behaviour?

Sample Code:
           Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
           req.setComments('Approval Comments');
           req.setObjectId(<Record ID>);
           LApproval.ProcessResult result = Approval.process(req, false);
           System.debug(result);

So how can we identify those records for which the approval process fails?

In salesforce tutorial, it is written that an custom object which is a detail in an master detail relationship cannot be a master in another master detail relationship. But this is not working. I am able to create more than one level of master detail relationships? Is it an updated feature in salesforce? 

 

Scenario:- i have a object test 1 which is master of object test 2.  Now obj test2 is again the master of obj test 3. Obj test3 is again the master of obj test4.

 

Also can a custom object which is a child of a standard object, be the master of another object ? If yes how many levels are possible?

My requrement is to update the Currencyisocode field of a converted opportunity (from lead) with the Currencyisocode of the account associated with that opportunity.

 

Currently the field is getting populated with the Currencyisocode of the lead converted.I cant find any trigger/ workflow which is doing this. Is this the default functionality?.

 

I was able to achive this requirement with an 'after insert' trigger on opportunity but the 'before insert' trigger does not seem to work. So I assume that the value gets populated with the lead's Currencyisocode first and then the 'after insert' trigger updates the field again. I dont want this to happen . I want the field to get updated only once. 

 

Can anyone explain what is happening here? and also if possible suggest a workaround.

VF page

 

<apex:page controller="passtest" >
<script>
    function callit()
    {
        var well="Hello world";
        call(well);
    
    }
</script>
<apex:form id="frm">
<apex:commandButton value="clickit" onclick="callit();"/>
<apex:commandButton value="testit" action="{!testfunction}"/>
<apex:actionFunction name="call" action="{!recieveit}" reRender="frm">
<apex:param name="well" assignTo="{!ok}" value=""/>
</apex:actionFunction>

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

 

Controller


public class passtest
{
    public string ok{get;set;}
    public string ok1{get;set;}
    public PageReference recieveit()
    {
        
        system.debug('&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'+ok);
        ok1=ok;
        return null;
    }
    public void testfunction()
    {
        system.debug('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'+ok1);
    }
    

}

 

On the click of the first button the value of OK is set through the actionfuntion. However the value of ok is NULL when accessed in the second function by the click of the second button! even though the value is global. Can anyone explain why this happens??.  Could you suggest a solution?

Hey can anyone Help me understand why this doesn't work and suggest a work around?

 

VF page:

 

<apex:page controller="paneltest">

    <apex:form >
    <apex:commandbutton action="{!settabpanel1}" value="tabcol1" rerender="outputpanel1,outputpanel2,outputpanel3"/>
    <apex:commandbutton action="{!settabpanel2}" value="tabcol2" rerender="outputpanel1,outputpanel2,outputpanel3"/>
    <apex:commandbutton action="{!settabpanel3}" value="tabcol3" rerender="outputpanel1,outputpanel2,outputpanel3"/>
    <apex:outputpanel rendered="{!showpanel1}" id="outputpanel1">
        Panel1
    </apex:outputpanel>
    <apex:outputpanel rendered="{!showpanel2}" id="outputpanel2">
        panel2
    </apex:outputpanel>
    <apex:outputpanel rendered="{!showpanel3}" id="outputpanel3">
        Panel3
    </apex:outputpanel>
</apex:form>
</apex:page>

 

Controller:

 

public class paneltest
{
    public boolean showpanel1 {get;set;}
    public boolean showpanel2 {get;set;}
    public boolean showpanel3 {get;set;}
    public boolean getShowpanel1()
    {
        return showpanel1;
    }
    public boolean getShowpanel2()
    {
        return showpanel2;
    }
    public boolean getShowpanel3()
    {
        return showpanel3;
    }
    public paneltest()
    {
        showpanel1=true;
        showpanel2=false;
        showpanel3=false;
    }
    public pagereference settabpanel1()
    {
        showpanel1=true;
        showpanel2=false;
        showpanel3=false;
        return null;
    }
    public pagereference settabpanel2()
    {
        showpanel1=false;
        showpanel2=true;
        showpanel3=false;
        return null;
    }
    public pagereference settabpanel3()
    {
        showpanel1=false;
        showpanel2=false;
        showpanel3=true;
        return null;

    }
 
}

 

I have just started writing apex controller and I'm quite new to it.....and I'm not sure what is happening here....I wanted the output of the VF page to be 1 2 3 4 but instad it is 1 1 1 1.  Is there a work around for this?......I need the values within the <repeat>tag itself. 

<!-- The VF PAGE -->

<apex:page controller="increment" sidebar="false" showHeader="false" >
     <apex:repeat var="a" value="{!a}">
         {!i} <br/>
     </apex:repeat>
</apex:page>


/* The Controller ----Increment */

public class increment
{
    integer i=0;
    list<integer> a{get;set;}
      
    public integer geti()
    {
       
        i++;
        return i;
    }
    public list<integer> geta()
    {
        a = new list<integer>();
        a.add(10);
        a.add(10);
        a.add(10);
        a.add(10);
        return a;
    }
}


New to salesforce, SOAP and web services, so not surprising that I'm stuck @ the gate on login.  Created a Developer account, followed instructions for getting WSDL files, and using soapUI (seems to be a great tool BTW!) to generate SOAP messages for login.  Using the same username and password that I can successfully use on the salesforce website, cut and paste my organizationId from the site, and appended the security token from the email to my password. 

Based on what I read somewhere, I left the tags for client, defaultNamespace and portalId empty.

Here's what I post (edited for the ID, username, etc.) - this is trying to use the Partner wsdl - get same error for Enterprise:

 

POST https://login.salesforce.com/services/Soap/u/19.0 HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.1
Host: login.salesforce.com
Content-Length: 715

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com">
   <soapenv:Header>
      <urn:CallOptions>
         <urn:client></urn:client>
         <urn:defaultNamespace></urn:defaultNamespace>
      </urn:CallOptions>
      <urn:LoginScopeHeader>
         <urn:organizationId>00D50000000xxxx</urn:organizationId>
         <!--Optional:-->
         <urn:portalId></urn:portalId>
      </urn:LoginScopeHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:login>
         <urn:username>jort@xxxxxxxxxxxxx.com</urn:username>
         <urn:password>pppppppppp78l6g7iFac5uaviDnJLFxxxxx</urn:password>
      </urn:login>
   </soapenv:Body>
</soapenv:Envelope>

 

and the response:

 

HTTP/1.1 500 Internal Server Error
Server:
Content-Encoding: gzip
Content-Type: text/xml; charset=utf-8
Content-Length: 351
Date: Thu, 01 Jul 2010 14:03:03 GMT

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>sf:INVALID_LOGIN</faultcode><faultstring>INVALID_LOGIN: Invalid username or password, locked out or Self-Service portal is not enabled</faultstring><detail><sf:LoginFault xsi:type="sf:LoginFault"><sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode><sf:exceptionMessage>Invalid username or password, locked out or Self-Service portal is not enabled</sf:exceptionMessage></sf:LoginFault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

 

This newbie thanks you in advance for any and all help you can give!

  • July 01, 2010
  • Like
  • 1