• SeniorMove
  • NEWBIE
  • 0 Points
  • Member since 2011

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

Hi.

 

Working on the classic case of needing to fully customize a Customer Portal, so I'm using Sites.

 

The problem I'm having is this:

 

I have a Visualforce page to emulate Cases.  How do I control the navigation in such a way so that when the user clicks a hyperlink they're taken to another one of my custom VF pages, instead of to the standard object?

 

Example:

 

VF page with a Case record ... one of the fields on the page layout shows the Contact Name, ( Joe Smith ) which is obviously a hyperlink back to the standard Contact object.

 

When the user clicks Joe Smith how can I ensure the user is passed to a custom VF page instead of the standard object Contact page?

 

Thanks for any help.  Code samples always appreciated!! :smileyhappy:

This seems like it should be straightforward, but it doesn't work.  I don't receive any errors, but nothing happens.

 

The Move__c object is on the detail side of a Master-Detail relationship with Client__c.

 

I'm trying to use the button to grab field values from Move__c, and pass those values into fields on Client__c.

 

Am I trying to do something that won't work?

 

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

var connection = sforce.connection; 

var url = parent.location.href; //string for the URL of the current page 
var clientMoved = "{!Move__c.ClientId__c}"; 

var moveToStreet = "{!Move__c.Move_To_Street__c}"; 
var moveToCity = "{!Move__c.Move_To_City__c}"; 
var moveToState = "{!Move__c.Move_To_State_Province__c}"; 
var moveToZip = "{!Move__c.Move_To_Zip_Postal_Code__c}"; 
var moveToCountry = "{!Move__c.Move_To_Country__c}"; 
var moveToProperty = "{!Move__c.Property__c}";

var client= new sforce.SObject("Client__c"); 
client.Id = clientMoved; 

client.Mailing_Street__c = moveToStreet; 
client.Mailing_City__c = moveToCity; 
client.Mailing_State__c = moveToState; 
client.Mailing_Zip_Code__c = moveToZip; 
client.Mailing_Country__c = moveToCountry; 

client.Shipping_Street__c = moveToStreet; 
client.Shipping_City__c = moveToCity; 
client.Shipping_State__c = moveToState; 
client.Shipping_Zip_Code__c = moveToZip; 
client.Shipping_Country__c = moveToCountry; 

client.Property__c = moveToProperty;

connection.update([client]); 
parent.location.href = url; //refresh the page

 

This seems so simple but I can't get it to work.

 

I want to copy 2 fields from one object to another:

 

Move_To_State_Province__c on Move__c copied to Mailing_State__c on Client__c

Move_To_Country on Move__c copied to Mailing_Country__c on Client__c

 

I've cobbled together the code based on solutions here on the board.  It saves fine, but nothing happens.  What am I missing?  Also, once it works, how would you write a test for it?

 

Thanks!  I'm stumped!

 

trigger NewMailingStateAndCountry on Move__c (after insert, after update) {
    for(Move__c mov : Trigger.New){
        List<Client__c> listClient = [Select Mailing_State__c, Mailing_Country__c from Client__c];
        for(Client__c client : listClient){
            client.Mailing_State__c = mov.Move_To_State_Province__c;
            client.Mailing_Country__c = mov.Move_To_Country__c;
        }
        update listClient;
    }

}

 

Hi.

 

Working on the classic case of needing to fully customize a Customer Portal, so I'm using Sites.

 

The problem I'm having is this:

 

I have a Visualforce page to emulate Cases.  How do I control the navigation in such a way so that when the user clicks a hyperlink they're taken to another one of my custom VF pages, instead of to the standard object?

 

Example:

 

VF page with a Case record ... one of the fields on the page layout shows the Contact Name, ( Joe Smith ) which is obviously a hyperlink back to the standard Contact object.

 

When the user clicks Joe Smith how can I ensure the user is passed to a custom VF page instead of the standard object Contact page?

 

Thanks for any help.  Code samples always appreciated!! :smileyhappy:

This seems like it should be straightforward, but it doesn't work.  I don't receive any errors, but nothing happens.

 

The Move__c object is on the detail side of a Master-Detail relationship with Client__c.

 

I'm trying to use the button to grab field values from Move__c, and pass those values into fields on Client__c.

 

Am I trying to do something that won't work?

 

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

var connection = sforce.connection; 

var url = parent.location.href; //string for the URL of the current page 
var clientMoved = "{!Move__c.ClientId__c}"; 

var moveToStreet = "{!Move__c.Move_To_Street__c}"; 
var moveToCity = "{!Move__c.Move_To_City__c}"; 
var moveToState = "{!Move__c.Move_To_State_Province__c}"; 
var moveToZip = "{!Move__c.Move_To_Zip_Postal_Code__c}"; 
var moveToCountry = "{!Move__c.Move_To_Country__c}"; 
var moveToProperty = "{!Move__c.Property__c}";

var client= new sforce.SObject("Client__c"); 
client.Id = clientMoved; 

client.Mailing_Street__c = moveToStreet; 
client.Mailing_City__c = moveToCity; 
client.Mailing_State__c = moveToState; 
client.Mailing_Zip_Code__c = moveToZip; 
client.Mailing_Country__c = moveToCountry; 

client.Shipping_Street__c = moveToStreet; 
client.Shipping_City__c = moveToCity; 
client.Shipping_State__c = moveToState; 
client.Shipping_Zip_Code__c = moveToZip; 
client.Shipping_Country__c = moveToCountry; 

client.Property__c = moveToProperty;

connection.update([client]); 
parent.location.href = url; //refresh the page

 

This seems so simple but I can't get it to work.

 

I want to copy 2 fields from one object to another:

 

Move_To_State_Province__c on Move__c copied to Mailing_State__c on Client__c

Move_To_Country on Move__c copied to Mailing_Country__c on Client__c

 

I've cobbled together the code based on solutions here on the board.  It saves fine, but nothing happens.  What am I missing?  Also, once it works, how would you write a test for it?

 

Thanks!  I'm stumped!

 

trigger NewMailingStateAndCountry on Move__c (after insert, after update) {
    for(Move__c mov : Trigger.New){
        List<Client__c> listClient = [Select Mailing_State__c, Mailing_Country__c from Client__c];
        for(Client__c client : listClient){
            client.Mailing_State__c = mov.Move_To_State_Province__c;
            client.Mailing_Country__c = mov.Move_To_Country__c;
        }
        update listClient;
    }

}

 

Can anyone suggest, how ca we delete apex class from production.

please provide step-step process to delete it from prod. through Force.com Eclipse.

  • October 29, 2010
  • Like
  • 1