• WannaKnow
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hello guys,

 

I need your help.

 

I am using some API to get the exchange rates using javascript and I am successful in that.

 

Now, I want these rates should be passed to the Save method defined in the controller.

 

To clarify, my JS function is :

function newnee(){
		dollar1 = fx.convert(1, {from: 'USD', to: 'EUR'});
		}

 As you can see, I have set the value of dollar1. Here is my save in VF :

<apex:commandButton action="{!NewSave}" value="Save" onclick="newnee();"/>

 Here is the Save in my controller :

 public Pagereference NewSave()
        {
         //.......Some code and then insert ......//
            insert objInv ;
            PageReference acctPage = new ApexPages.StandardController(objInv).view();
            acctPage.setRedirect(true);
            return acctPage;
        }

 

I have tried Actionfunction as well as inputhidden. But seems I am missing something.

 

What would be the best way to pass the values to the Save function(Custom)?

 

Can someone help me?

 

Thanks,

Rocky

Hi,

 

I have a page with Account as standard controller. But in that page, I want to save the record of the child of account. So I have created an extension but my save function is not getting called. Am I missing something here?

 

  public PageReference mySave()
    {
        Pagereference pr;
        system.debug('=================='+Address);
        system.debug('=================='+Follow_up);
        system.debug('=================='+acct.ID);
        objMed.Address__c = Address;
        objMed.Follow_up_Method__c = Follow_up;
        objMed.Account__c = acct.ID;
        insert objMed;
        return pr;
    }

 

Please help.

Hi all, thanks for reading.

 

I have a before insert trigger on a custom object.  The trigger should query the User table and grab the Manager record where ID = the custom object's owner.managerID.

 

 List <User> userList = [select name from USER where ID = :ownerObj.ManagerID limit 1];
               if(userList.size() == 0 || userList == null)
               {
                   trigger.new[0].addError('No manager was found for the user attempting to own a Projection.  Please fill in the manager field for this user before   creating a Projection for them.');
               }
               String managerName = userList[0].name;

 

I thought my if statement would prevent String managerName = userList[0].name from ever blowing up but I am getting the list has no rows for assignment on that line and not seeing my error message inside the IF.

 

What gives? 0.1 BTC reward if you are interested. Thanks again.

Hi Community, 

I have a VF page(contains only a table and a button) on my Opportunity layout and by clicking a button on that, I'm opening a popup(showModalDialog) window. I need to refresh the entire parent page which means the opportunity layout page(not only the VF page which opened the popup). 
What I tryied was, putting a hidden button on my detailed VF page and when the popup get closed, fire that button with,
        

 window.opener.location.href='/{!$CurrentPage.parameters.id}';

 


also tryied,
        

window.opener.location.reload();

 


Sometimes I'm getting "URL no longer existing" error on my detailed page when the popup get closed.
Actually I have not clear idea about how to work with this 3 level of pages. Please guide me on this.

 

Edited :

Ok, seemslike my question is not clear :) Can anyone let me know, how to reload the parent page, from a VF page which is inside the parent page(as a section in the layout)

 

Thanks,

Madhura

Hi,

 

I have a page with Account as standard controller. But in that page, I want to save the record of the child of account. So I have created an extension but my save function is not getting called. Am I missing something here?

 

  public PageReference mySave()
    {
        Pagereference pr;
        system.debug('=================='+Address);
        system.debug('=================='+Follow_up);
        system.debug('=================='+acct.ID);
        objMed.Address__c = Address;
        objMed.Follow_up_Method__c = Follow_up;
        objMed.Account__c = acct.ID;
        insert objMed;
        return pr;
    }

 

Please help.