• Dipti D
  • NEWBIE
  • 55 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 24
    Replies
Hi Friends, NEED help ASAP. Please.
I am trying to make a code change. Just one line. 
While passing a phone number, earlier we were passing all dashes as blanks. Now we need to exclude paranthesis as well.
i.e. (904) 111-2244 should be passed as 9041112244
How can i acieve this?
My old code is this. 
?CaseRecord.Phone__c.replaceAll('-',''):'');      
If i give double quotes as per some developer form suggestions, I get "No viable characterr "" error"
Hi Friends, NEED help ASAP. Please.
I am trying to make a code change. Just one line. 
While passing a phone number, earlier we were passing all dashes as blanks. Now we need to exclude paranthesis as well.
i.e. (904) 111-2244 should be passed as 9041112244
How can i acieve this?
My old code is this. 
?CaseRecord.Phone__c.replaceAll('-',''):'');      
If i give double quotes as per some developer form suggestions, I get "No viable characterr "" error"

 
Need help with the following trigger helper class.
This is the trigger helper class where it would update certain fields from one object (Customer) to its child object (Case). I need to add a condition here. The fields like Address, City, Zip etc should be carried over to Customer onmy when Source__ is NULL.

Where exactly do I add this condition, so that when Source on the Customer has a value, the values are not carried over to the Case.

   public static void updateCasesWithAccountData(List<Case> newCases){
        Set<Id> accIds = new Set<Id>();
        List<Case> lstCases = new List<Case>();
        for(Case objCase : newCases){
            accIds.add(objCase.AccountId);
        }
        Map<Id, User> MapUserIDToUser =  new Map<Id, User>([Select Id, Profile.Name from User]);
        Map<Id, Product__c> MapProductIdToProduct = new map<Id, Product__c>([Select Id, Name from Product__c]);
        Map<ID, Account> MapAccIdtoAccount = new Map<ID, Account>([Select Id, Street__c, City__c, State__c, Zip__c, Best_Number_to_Call__c, PersonHomePhone, Phone, Source__c, PersonMobilePhone, (Select Id from Contacts) from Account where Id IN:accIds]);
        for(Case objCase : newCases){
            if (MapAccIdtoAccount.containsKey(objCase.AccountId) && MapProductIdToProduct.containsKey(Objcase.Product__c)  && ){            // if(MapUserIDToUser.get(objCase.ownerId).Profile.Name == 'Oncor Sales Agent' && ){
                Case oCase = new Case(Id = objCase.Id);
                oCase.ContactId =  MapAccIdtoAccount.get(objCase.AccountId).Contacts[0].Id ;
                oCase.Address_Line1__c = MapAccIdtoAccount.get(objCase.AccountId).Street__c ;
                oCase.City__c = MapAccIdtoAccount.get(objCase.AccountId).City__c ;               
                oCase.Zip__c = MapAccIdtoAccount.get(objCase.AccountId).Zip__c ;

            If(MapAccIdtoAccount.get(objCase.AccountId).Best_Number_to_Call__c != null){
                    if(MapAccIdtoAccount.get(objCase.AccountId).Best_Number_to_Call__c =='Home'){
                        oCase.Phone__c = MapAccIdtoAccount.get(objCase.AccountId).PersonHomePhone; 
                    }else if(MapAccIdtoAccount.get(objCase.AccountId).Best_Number_to_Call__c =='Work'){
                        oCase.Phone__c = MapAccIdtoAccount.get(objCase.AccountId).Phone; 
                    }else if(MapAccIdtoAccount.get(objCase.AccountId).Best_Number_to_Call__c  =='Mobile'){
                        oCase.Phone__c = MapAccIdtoAccount.get(objCase.AccountId).PersonMobilePhone;
                    }
                }
                lstCases.add(oCase);
            }
        }
        if(lstCases.size()>0){
            update lstCases;
        }
    }
Hi,
This is my scenario. We have web to leads set up with two different types of leads. Quoted & Purchased.
A person can quote any no. of times and those leads get in to SF as 'Quoted Leads'. To note: All these quoted leads have same email ID as it is the same person quoting, let us say he quoted 3 times. We have 3 quoted leads.
Now, that same person purchased another quote and it is 'purchased lead' in SF. Now, How can I look up at all his quoted leads and mark them as Purchased to true..by searching based of of his email address? I tried this using process builder, but there is a difficulty in looking at all the leads. It is working only on that particular Lead, not looking at all the other leads by looking at the email address. Need help. thank you
Hi, 
Can someone help me with a trigger? I need to Update 'Contact Name' field on Case Object. 'Contact Name' should be the 'Account Name' - as we are using person accounts. Case has lookup relation with both Account & Contact. If someone has a trigger for this, please help. Thanks
I tried to update the Contact Name (lookup field) via workflow rules & process builder, but nothing helped as it is a lookup field. 


User-added image
Hi All, I need a help with the following trigger.
I have the below trigger to update Case's adrress fields with the account's address fields as soon as a new Case is created.
I have to add the following requirement as well to it and do not know how to do it. Can some one help me? 
What need to be added: On Account object - Sales agent will collect 3 phone numbers - Home Phone, Work Phone & Mobile Phone - and we have another picklist field as "Best Number to Call" - with picklist values - Home, Work, Mobile.
If Agent select - Home - for "Best Number to Call" , Home Phone need to be carried over to Case Phone.
If Agent Selects - Work - for "Best Number to Call" , Work Phone need to be carried over to Case Phone.
If Agent select - Mobile - for "Best Number to Call" , Mobile Phone need to be carried over to Case Phone.
Case has only one Phone field. This is the tricky part for this trigger and I need help on this.
Thank you!

    public static void updateCasesWithAccountData(List<Case> newCases){
        Set<Id> accIds = new Set<Id>();
        List<Case> lstCases = new List<Case>();
        for(Case objCase : newCases){
            accIds.add(objCase.AccountId);
        }
        Map<Id, User> MapUserIDToUser =  new Map<Id, User>([Select Id, Profile.Name from User]);
        Map<ID, Account> MapAccIdtoAccount = new Map<ID, Account>([Select Id, Street__c, City__c, State__c, Zip__c from Account where Id IN:accIds]);
        for(Case objCase : newCases){
            if(MapUserIDToUser.get(objCase.ownerId).Profile.Name == 'Oncor Sales Agent' && MapAccIdtoAccount.containsKey(objCase.AccountId)){
                Case oCase = new Case(Id = objCase.Id);
                    oCase.Address_Line1__c = MapAccIdtoAccount.get(objCase.AccountId).Street__c ;
                    oCase.City__c = MapAccIdtoAccount.get(objCase.AccountId).City__c ;
                    oCase.Zip__c = MapAccIdtoAccount.get(objCase.AccountId).Zip__c ;
                lstCases.add(oCase);
            }
        }
        if(lstCases.size()>0){
            update lstCases;
        }
  • September 28, 2015
  • Like
  • 0
Hi, A challenging question to all. EasyXDM
http://salesforcehacks.blogspot.com/2014/12/resizing-embedded-vf.html
We have been using easyXDM - and iframing a custom button functionality on a standard Case Object. It was working fine for months. But, lately the automatic rerendering is not happening..It is behaving differently for every browser. It was rendering immediately when the CASE page is open. But now, (Not sure why suddenly, now it broke) Probably because of Winter 16 release? 
In Chrome & firefox, I have to click on the XDM button and it is working fine.
In IE 11, the following happens. See the error..User-added image

When I click 'retry' URL no longer exists. What could be the reason? And how can I fix this? 
  • September 24, 2015
  • Like
  • 0
Attempt to de-reference a null object - Need Help with Trigger

Hi, 
I need help with a trigger. Someone please help me on what I am doing wrong. Thank you.
My scenario is - For a person Account - Address, City & Zip are filled.
When a Case is created for that Customer - Address, City & Zip should automatically be filled. So that Sales reps don't have to fill those 3 fields again.
Here is my CODE
trigger CasesTrigger on Case (after insert){
    Set<Id> accIds = new Set<Id>();
    List<Case> lstCases = new List<Case>();
    for(Case objCase:trigger.new){
        accIds.add(objCase.AccountId);
        system.debug('ACCOUNTIDS'+accIds);
    }
    Map<ID, Account> MapAccIdtoAccount = new Map<ID, Account>([Select Id, Street__c, City__c, State__c, Zip__c from Account where Id IN:accIds]);
system.debug('ACCOUNTSMAP'+MapAccIdtoAccount);
    for(Case objCase:Trigger.new){
        Case oCase = new Case();
       
    if(MapAccIdtoAccount.containsKey(objCase.AccountId))
{
         oCase.Address_Line1__c = MapAccIdtoAccount.get(oCase.AccountId).Street__c ;
            system.debug('ADDRESS---'+oCase.Address_Line1__c); 
           oCase.City__c = MapAccIdtoAccount.get(oCase.AccountId).City__c ;
            oCase.State__c = MapAccIdtoAccount.get(oCase.AccountId).State__c ;
           oCase.Zip__c = MapAccIdtoAccount.get(oCase.AccountId).Zip__c ;
        lstCases.add(oCase);
         system.debug('oCASE'+oCase); 
            }
            }
    if(lstCases.size()>0){
        update lstCases;
    }
}
  • September 23, 2015
  • Like
  • 0
I have a local system which is integrated to salesforce. I am passing the user name & pw through the URL for the users to get in to login to salesforce directly. But, I want them to directly access a Case# in salesforce, how can I pass teh case# through auto login/SSo?
Changes to the Home Page components in Summer 2015 release.

We have a scenario where on our Case object, we need two buttons that are color coded and has to appear to certain profiles and not to certain profiles.
These buttons when clicked will be routed to a different site that is integrated with our salesforce instance.
To get this done, our developer has created a html area with java script that would execute on the case object/based on the profiles and show the buttons to some profile users and hide for some.
But, since the html area will not/may not be working properly in future, with the summer release that is about to come, we did a work around.
We have saved that custom code as static resource.
We have put that code (along with other supporting codes like soap), on the custom links on the home page components.

{!REQUIRESCRIPT("/resource/1424715209000/HideCustomButton")}
{!REQUIRESCRIPT("/resource/1426710361000/sforce")}
{!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")}
{!REQUIRESCRIPT("/resource/1426899248000/CustomCode1")}

The code is performing like it should, but we see this error, ie.
Faultcode: INVALID SESSION ID ERROR whenever the code is being executed. Not sure why this is happening. We are thinking of deploying this to production in future as HTML component may not work properly from summer.

Please advise on what needs to be done. I can explain in detail again to a developer that might help us.
 
On our sandbox, I was working on the home page components as in Summer’15 release the java script in the HTML tags will no longer work on home page components. So, I have added the static resources (saved the code as static resources in salesforce) and referred them in the custom links (with execute javascript) and added them on the home page components. It is working like it used to, but I see this error “Invalid Session ID”. I have included the session ID global variable reference in the custom link, but it did not help. How exactly do I have add the session id global variable and in what order? I want to make sure what i am doing is right.Is there a solution for this? (by the way, I am admin, not a developer) 
Need help with the following trigger helper class.
This is the trigger helper class where it would update certain fields from one object (Customer) to its child object (Case). I need to add a condition here. The fields like Address, City, Zip etc should be carried over to Customer onmy when Source__ is NULL.

Where exactly do I add this condition, so that when Source on the Customer has a value, the values are not carried over to the Case.

   public static void updateCasesWithAccountData(List<Case> newCases){
        Set<Id> accIds = new Set<Id>();
        List<Case> lstCases = new List<Case>();
        for(Case objCase : newCases){
            accIds.add(objCase.AccountId);
        }
        Map<Id, User> MapUserIDToUser =  new Map<Id, User>([Select Id, Profile.Name from User]);
        Map<Id, Product__c> MapProductIdToProduct = new map<Id, Product__c>([Select Id, Name from Product__c]);
        Map<ID, Account> MapAccIdtoAccount = new Map<ID, Account>([Select Id, Street__c, City__c, State__c, Zip__c, Best_Number_to_Call__c, PersonHomePhone, Phone, Source__c, PersonMobilePhone, (Select Id from Contacts) from Account where Id IN:accIds]);
        for(Case objCase : newCases){
            if (MapAccIdtoAccount.containsKey(objCase.AccountId) && MapProductIdToProduct.containsKey(Objcase.Product__c)  && ){            // if(MapUserIDToUser.get(objCase.ownerId).Profile.Name == 'Oncor Sales Agent' && ){
                Case oCase = new Case(Id = objCase.Id);
                oCase.ContactId =  MapAccIdtoAccount.get(objCase.AccountId).Contacts[0].Id ;
                oCase.Address_Line1__c = MapAccIdtoAccount.get(objCase.AccountId).Street__c ;
                oCase.City__c = MapAccIdtoAccount.get(objCase.AccountId).City__c ;               
                oCase.Zip__c = MapAccIdtoAccount.get(objCase.AccountId).Zip__c ;

            If(MapAccIdtoAccount.get(objCase.AccountId).Best_Number_to_Call__c != null){
                    if(MapAccIdtoAccount.get(objCase.AccountId).Best_Number_to_Call__c =='Home'){
                        oCase.Phone__c = MapAccIdtoAccount.get(objCase.AccountId).PersonHomePhone; 
                    }else if(MapAccIdtoAccount.get(objCase.AccountId).Best_Number_to_Call__c =='Work'){
                        oCase.Phone__c = MapAccIdtoAccount.get(objCase.AccountId).Phone; 
                    }else if(MapAccIdtoAccount.get(objCase.AccountId).Best_Number_to_Call__c  =='Mobile'){
                        oCase.Phone__c = MapAccIdtoAccount.get(objCase.AccountId).PersonMobilePhone;
                    }
                }
                lstCases.add(oCase);
            }
        }
        if(lstCases.size()>0){
            update lstCases;
        }
    }
Hi,
This is my scenario. We have web to leads set up with two different types of leads. Quoted & Purchased.
A person can quote any no. of times and those leads get in to SF as 'Quoted Leads'. To note: All these quoted leads have same email ID as it is the same person quoting, let us say he quoted 3 times. We have 3 quoted leads.
Now, that same person purchased another quote and it is 'purchased lead' in SF. Now, How can I look up at all his quoted leads and mark them as Purchased to true..by searching based of of his email address? I tried this using process builder, but there is a difficulty in looking at all the leads. It is working only on that particular Lead, not looking at all the other leads by looking at the email address. Need help. thank you
I have a web-to-case form. I would like to add code that pre-populates the Subject field. Please help. 
Hi All, I need a help with the following trigger.
I have the below trigger to update Case's adrress fields with the account's address fields as soon as a new Case is created.
I have to add the following requirement as well to it and do not know how to do it. Can some one help me? 
What need to be added: On Account object - Sales agent will collect 3 phone numbers - Home Phone, Work Phone & Mobile Phone - and we have another picklist field as "Best Number to Call" - with picklist values - Home, Work, Mobile.
If Agent select - Home - for "Best Number to Call" , Home Phone need to be carried over to Case Phone.
If Agent Selects - Work - for "Best Number to Call" , Work Phone need to be carried over to Case Phone.
If Agent select - Mobile - for "Best Number to Call" , Mobile Phone need to be carried over to Case Phone.
Case has only one Phone field. This is the tricky part for this trigger and I need help on this.
Thank you!

    public static void updateCasesWithAccountData(List<Case> newCases){
        Set<Id> accIds = new Set<Id>();
        List<Case> lstCases = new List<Case>();
        for(Case objCase : newCases){
            accIds.add(objCase.AccountId);
        }
        Map<Id, User> MapUserIDToUser =  new Map<Id, User>([Select Id, Profile.Name from User]);
        Map<ID, Account> MapAccIdtoAccount = new Map<ID, Account>([Select Id, Street__c, City__c, State__c, Zip__c from Account where Id IN:accIds]);
        for(Case objCase : newCases){
            if(MapUserIDToUser.get(objCase.ownerId).Profile.Name == 'Oncor Sales Agent' && MapAccIdtoAccount.containsKey(objCase.AccountId)){
                Case oCase = new Case(Id = objCase.Id);
                    oCase.Address_Line1__c = MapAccIdtoAccount.get(objCase.AccountId).Street__c ;
                    oCase.City__c = MapAccIdtoAccount.get(objCase.AccountId).City__c ;
                    oCase.Zip__c = MapAccIdtoAccount.get(objCase.AccountId).Zip__c ;
                lstCases.add(oCase);
            }
        }
        if(lstCases.size()>0){
            update lstCases;
        }
  • September 28, 2015
  • Like
  • 0
Hello,

I have package which has a object and a tab.

This object is used as lookup in some other object.

This object is Public read/write but still I am not able to see this object on page layoput.

On OWD, Object is Public R/W,
On profile level Object is Read and Write.
On Field level security level, object is visible for the profile.

 
  • September 28, 2015
  • Like
  • 0
Can we change account record type from Business Account to a Person Account?
Hi, A challenging question to all. EasyXDM
http://salesforcehacks.blogspot.com/2014/12/resizing-embedded-vf.html
We have been using easyXDM - and iframing a custom button functionality on a standard Case Object. It was working fine for months. But, lately the automatic rerendering is not happening..It is behaving differently for every browser. It was rendering immediately when the CASE page is open. But now, (Not sure why suddenly, now it broke) Probably because of Winter 16 release? 
In Chrome & firefox, I have to click on the XDM button and it is working fine.
In IE 11, the following happens. See the error..User-added image

When I click 'retry' URL no longer exists. What could be the reason? And how can I fix this? 
  • September 24, 2015
  • Like
  • 0
Attempt to de-reference a null object - Need Help with Trigger

Hi, 
I need help with a trigger. Someone please help me on what I am doing wrong. Thank you.
My scenario is - For a person Account - Address, City & Zip are filled.
When a Case is created for that Customer - Address, City & Zip should automatically be filled. So that Sales reps don't have to fill those 3 fields again.
Here is my CODE
trigger CasesTrigger on Case (after insert){
    Set<Id> accIds = new Set<Id>();
    List<Case> lstCases = new List<Case>();
    for(Case objCase:trigger.new){
        accIds.add(objCase.AccountId);
        system.debug('ACCOUNTIDS'+accIds);
    }
    Map<ID, Account> MapAccIdtoAccount = new Map<ID, Account>([Select Id, Street__c, City__c, State__c, Zip__c from Account where Id IN:accIds]);
system.debug('ACCOUNTSMAP'+MapAccIdtoAccount);
    for(Case objCase:Trigger.new){
        Case oCase = new Case();
       
    if(MapAccIdtoAccount.containsKey(objCase.AccountId))
{
         oCase.Address_Line1__c = MapAccIdtoAccount.get(oCase.AccountId).Street__c ;
            system.debug('ADDRESS---'+oCase.Address_Line1__c); 
           oCase.City__c = MapAccIdtoAccount.get(oCase.AccountId).City__c ;
            oCase.State__c = MapAccIdtoAccount.get(oCase.AccountId).State__c ;
           oCase.Zip__c = MapAccIdtoAccount.get(oCase.AccountId).Zip__c ;
        lstCases.add(oCase);
         system.debug('oCASE'+oCase); 
            }
            }
    if(lstCases.size()>0){
        update lstCases;
    }
}
  • September 23, 2015
  • Like
  • 0

As per release winter 16 release notes: http://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/salesforce_release_notes.htm
 

REQUIRESCRIPT no longer executes JavaScript on Page Load.

We use the REQUIRESCRIPT function in several custom buttons on our lead page.  When the Winter 16 features were released into our sandbox, our buttons started returning an error Reference $ Undefined.

I reached out to salesforce support, and they told me to use the code in the following article which removed the REQUIRESCRIPT function and instead, creates a custom java function.

https://help.salesforce.com/apex/HTViewSolution?urlname=Receiving-error-sforce-apex-is-null-or-not-an-object-1327108329858&language=en_US

I've been messing with the code above to fit it into my button.  I'm stepping through the code through alerts, it stepped all the way through but at the end I get an Object error.  Any help would be appreciated.

function loadScript(url) 

    var request; 
    if (window.XMLHttpRequest) 
    { 
        request = new XMLHttpRequest(); 
    }     
    else if (window.ActiveXObject) 
    { 
        request = new ActiveXObject("Msxml2.XMLHTTP"); 
        if (!request) 
        { 
            request = new ActiveXObject("Microsoft.XMLHTTP"); 
        } 
    
    } 


    var se = document.createElement('script'); 
    se.type = "text/javascript"; 
    //alert("before Request undefined\n");
    request.open("GET", url, false); 
    request.send(null); 
    se.text = request.responseText; 
    document.getElementsByTagName('head')[0].appendChild(se); 
    //alert("end of loadScript\n");


loadScript("/soap/ajax/30.0/connection.js"); 
loadScript("/soap/ajax/30.0/apex.js"); 
loadScript("/resource/jQuery/jquery-1.8.2.min.js"); 
loadScript("/resource/jQuery/ui/jquery-ui-1.9.1.custom.min.js");
loadScript("/resource/jQuery/postmessage/jquery.ba-postmessage.js");
loadScript("/resource/jQuery/bbq/jquery.ba-bbq.min.js");
loadScript("/resource/buttonjs");

try 

    var j$ = jQuery.noConflict(); 
    var newurl= sforce.apex.execute("RegisterMerchant", "getPricingArticleID",{leadID : "{!Lead.Id}"}); 
    newurl1 = String(newurl); 
    alert('Lead ArticleID '+newurl1); 
    if(newurl1.indexOf('error')>-1 ) 

    alert(newurl); 
    document.location.reload(true); 

else 

    alert('Start of Else Statement')
    var strQuery="Select l.of_Pin_Pads__c,l.Id, l.Article_ID__c, l.Processing_Origin__c, l.Company, l.Strategic__c, l.Gift_Only__c, l.Dealer__r.Name, l.Developer__c, l.DLR_Sales__c, l.Name, l.OwnerId from Lead l where Id= '" +'{!Lead.Id}'+"'"; 
    var accFields = sforce.connection.query(strQuery); 
    var records = accFields.getArray("records"); 

    var owner = records[0].OwnerId; 
    var ContactName = records[0].Name; 

    var leadId = records[0].ID; 
    var Dealer = records[0].Dealer__r.Name; 
    var devID = records[0].Developer__c; 
    var Developer = null; 
    var DealerSalesperson = null; 
    if (devID!=null) 
    alert('Developer Record')
    

    var strQuery3 = "SELECT Name from Account where ID='" +devID+"'"; 
    var devField = sforce.connection.query(strQuery3); 
    var devRecord = devField.getArray("records"); 
    Developer = devRecord[0].Name; 
    


var ds = records[0].DLR_Sales__c; 
//if (ds!= null) 
    alert('DLR sales Record1')
//{ 
var strQuery6 = "Select Name from Contact where id = '" +ds+"'"; 
var dlrSalesField = sforce.connection.query(strQuery6); 
var dlrSalesRecord = dlrSalesField.getArray("records"); 
DealerSalesperson = dlrSalesRecord[0].Name; 
//}
alert('Dlr sales Record2') 

var NumberOfPinpads = 0; 
//if(records[0].of_Pin_Pads__c!=null) 
//{ 
NumberOfPinpads = parseInt(records[0].of_Pin_Pads__c); 
//}
alert('Pin Pads') 
var ArticleId = records[0].Article_ID__c; 
var ProcessingOrigin = records[0].Processing_Origin__c; 
var CompanyName = records[0].Company; 
var StrategicAccount= records[0].Strategic__c; 
var GiftOnly = records[0].Gift_Only__c; 
alert('Other stuff') 


// if diff is null, continue, if user clicked cancel, allow them to chg processing origin 
console.log('leadId '+leadId+'--'+Dealer+'--'+Developer+'--'+ArticleId+'--'+DealerSalesperson); 
// next section stolen from Josh, thanks for doing my typing buddy! 
var $articleId = $('<input>', { name: 'ArticleId', type: 'hidden', value: ArticleId }); 
var $processingOrigin = $('<input>', { name: 'ProcessingOrigin', type: 'hidden', value: ProcessingOrigin }); 
var $companyName = $('<input>', { name: 'CompanyName', type: 'hidden', value: CompanyName }); 
var $strategicAccount = $('<input>', { name: 'StrategicAccount', type: 'hidden', value: StrategicAccount }); 
var $giftOnly = $('<input>', { name: 'GiftOnly', type: 'hidden', value: GiftOnly }); 
var $contactName = $('<input>', { name: 'ContactName', type: 'hidden', value: ContactName }); 
var $dealer = $('<input>', { name: 'Dealer', type: 'hidden', value: Dealer }); 
var $developer = $('<input>', { name: 'Developer', type: 'hidden', value: Developer }); 
var $dealerSalesperson = $('<input>', { name: 'DealerSalesperson', type: 'hidden', value: DealerSalesperson }); 
var $numberOfPinpads = $('<input>', { name: 'NumberOfPinpads', type: 'hidden', value: NumberOfPinpads }); 

//alert($articleId.html()); 
var $form = $('<form>', { 
'action': '{!$Label.pricingUI}Invoke', 
'method': 'post', 
'target':'_blank' 
}); 

$form.append($articleId); 
$form.append($processingOrigin); 
$form.append($companyName); 
$form.append($strategicAccount); 
$form.append($giftOnly); 
$form.append($contactName); 
$form.append($dealer); 
$form.append($developer); 
$form.append($dealerSalesperson); 
$form.append($numberOfPinpads); 

$(document.body).append($form); 

$form.submit(); 
// alert('done by me'); 


catch(er) 

alert(er); 
}