• Tucko
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 21
    Replies
Hello, 

I got this code that I can't get to work and I do not know what I am doing wrong
 
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/21.0/apex.js")}

var test = new sForce.SObject("Test__c");

if(test.Id == "{!Test__c.Id}"){
test.pole1__c = "{!Test__c.pole1__c}";
test.pole2__c = "{!Test__c.pole2__c}";
test.pole3__c = "{!Test__c.pole3__c}";
test.pole4__c = "{!Test__c.pole4__c}";
test.pole6__c = "{!Test__c.pole6__c}";

test.pole1__c = null;
test.pole2__c = null;
test.pole3__c = null;
test.pole4__c = null;
test.pole6__c = null;
}
var result = sforce.connection.update(test);

When I click on the button I get sForce not defined error.
  • June 18, 2015
  • Like
  • 0
Hello guys,
I have these trigger and a helper clas to help stop firing more than once, but seems something doesn't work like it should, can someone point me where I am wrong. Thank you!

Trigger:
trigger AccountTrigger1 on Account (after update,after insert) {
       
    
     if(!HelperClass.hasAlreadyfired()){
    List<Account>listAccounts = new List<Account>();
        
    //Во for-циклусот листаме низ сите профили
        //за кои се проверува условот од if
    for(Account a : Trigger.new){
        
        //Се креираат 5 нови профили, доколку условот:
        // a.CheckPayment__c == True е исполнет
        if(a.CheckPayment__c == True){
            
            //Со секоја итерација на for - циклусот се креира по еден профил
            //for - циклусот завршува со креирање на нови профили кога 
            //итераторот i ќе ја достигне својата максимална вредност
            //во овој случај 5
            for (Integer i=0; i<5; i++){
               
                //Креирање на профил
                Account account = new Account();
                account.Name = 'Akaunt' + i;
                account.First_Name__c = 'Acount1';
                account.Second_Name__c = 'Surname1';            
                account.Status__c = 'Idle';
                listAccounts.add(account);
            }
         }
        //Додавање на профилите
        insert listAccounts;
     }
    }
    HelperClass.setAlreadyfired();
}
Ignore the comments :)

HelperClass:
 
public class HelperClass{
    public static boolean flagvalue = false;


    public static boolean hasAlreadyfired() {
        return flagvalue;
    }
    
    public static void setAlreadyfired() {
        flagvalue = true;
    }



}


 
  • June 05, 2015
  • Like
  • 0

Hello, 

I have a question, I am making a custom button which need to generate data from certain formula and after that put the data in given field, the formula was the easy pars, and as I am new to salesforce, I can't get a way to put the data into the given field, I am having this formula code:

{!PayedSum__c.Payed_Sum__c} = {!Account.Compensation_Sum__c} - {!Account.Payed_Compensation_Sum__c} AND
{!PayedSum__c.Payed_Date__c}  = {!TODAY()}

As you can see from the code I need to put the data in sObject PayedSum__c field Payed_Sum__c, can someone help me how to put the result from this formula into the Payed_Sum__c field ?

Thank you in advance,
Bozidar
  • June 02, 2015
  • Like
  • 0

Hello, 

I am new to this platform. I started to learn about triggers and I stuck with this code, I can't get what is not right about it. Every help will be great. Thank you! 
 

trigger AccountTrigger on Account (after update,after insert, before update, before insert) {
    List<Account>listAccounts = new List<Account>();
    
    for(Account a: Trigger.new){
        if(a.CheckPayment__c == True){
           
            Account account1 = new Account();
            account1.Name = 'Akaunt1';
            account1.First_Name__c = 'Acount1';
            account1.Second_Name__c = 'Surname1';            
            account1.Status__c = 'Idle';
            
            Account account2 = new Account();
            account2.Name = 'Akaunt2';
            account2.First_Name__c = 'Acount2';
            account2.Second_Name__c = 'Surname2';
            account2.Status__c = 'Idle';
            
            Account account3 = new Account();
            account3.Name = 'Akaunt3';
            account3.First_Name__c = 'Acount3';
            account3.Second_Name__c = 'Surname3';
            account3.Status__c = 'Idle';
            
            Account account4 = new Account();
            account4.Name = 'Akaunt4';
            account4.First_Name__c = 'Acount4';
            account4.Second_Name__c = 'Surname4';
            account4.Status__c = 'Idle';
            
            Account account5 = new Account();
            account5.Name = 'Akaunt5';
            account5.First_Name__c = 'Acount5';
            account5.Second_Name__c = 'Surname5';
            account5.Status__c = 'Idle';
            
     	}
    }
    insert listAccounts;
}
  • June 01, 2015
  • Like
  • 0
Hi Everyone,

I Need your help on this.we have a edit page where we have a picklist Such that when user selects a Particular Value from the picklist then automatically a text field on the Edit page should populate with Default value.

Can you help me with the best solution for this.

Thanks.
Hello, 

I got this code that I can't get to work and I do not know what I am doing wrong
 
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/21.0/apex.js")}

var test = new sForce.SObject("Test__c");

if(test.Id == "{!Test__c.Id}"){
test.pole1__c = "{!Test__c.pole1__c}";
test.pole2__c = "{!Test__c.pole2__c}";
test.pole3__c = "{!Test__c.pole3__c}";
test.pole4__c = "{!Test__c.pole4__c}";
test.pole6__c = "{!Test__c.pole6__c}";

test.pole1__c = null;
test.pole2__c = null;
test.pole3__c = null;
test.pole4__c = null;
test.pole6__c = null;
}
var result = sforce.connection.update(test);

When I click on the button I get sForce not defined error.
  • June 18, 2015
  • Like
  • 0
Hello guys,
I have these trigger and a helper clas to help stop firing more than once, but seems something doesn't work like it should, can someone point me where I am wrong. Thank you!

Trigger:
trigger AccountTrigger1 on Account (after update,after insert) {
       
    
     if(!HelperClass.hasAlreadyfired()){
    List<Account>listAccounts = new List<Account>();
        
    //Во for-циклусот листаме низ сите профили
        //за кои се проверува условот од if
    for(Account a : Trigger.new){
        
        //Се креираат 5 нови профили, доколку условот:
        // a.CheckPayment__c == True е исполнет
        if(a.CheckPayment__c == True){
            
            //Со секоја итерација на for - циклусот се креира по еден профил
            //for - циклусот завршува со креирање на нови профили кога 
            //итераторот i ќе ја достигне својата максимална вредност
            //во овој случај 5
            for (Integer i=0; i<5; i++){
               
                //Креирање на профил
                Account account = new Account();
                account.Name = 'Akaunt' + i;
                account.First_Name__c = 'Acount1';
                account.Second_Name__c = 'Surname1';            
                account.Status__c = 'Idle';
                listAccounts.add(account);
            }
         }
        //Додавање на профилите
        insert listAccounts;
     }
    }
    HelperClass.setAlreadyfired();
}
Ignore the comments :)

HelperClass:
 
public class HelperClass{
    public static boolean flagvalue = false;


    public static boolean hasAlreadyfired() {
        return flagvalue;
    }
    
    public static void setAlreadyfired() {
        flagvalue = true;
    }



}


 
  • June 05, 2015
  • Like
  • 0

Hello, 

I have a question, I am making a custom button which need to generate data from certain formula and after that put the data in given field, the formula was the easy pars, and as I am new to salesforce, I can't get a way to put the data into the given field, I am having this formula code:

{!PayedSum__c.Payed_Sum__c} = {!Account.Compensation_Sum__c} - {!Account.Payed_Compensation_Sum__c} AND
{!PayedSum__c.Payed_Date__c}  = {!TODAY()}

As you can see from the code I need to put the data in sObject PayedSum__c field Payed_Sum__c, can someone help me how to put the result from this formula into the Payed_Sum__c field ?

Thank you in advance,
Bozidar
  • June 02, 2015
  • Like
  • 0
Hi friends,

I wanna make the checkbox 'Send email notification ' on Lead object to be checked on change of Lead Owner.
Has anyone come across this scenario?
If so plz guide me to achieve the same.