• TryCoding
  • NEWBIE
  • 75 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 13
    Replies

hi

 

i have a managed package with an object and before insert trigger on that object in that package

 

now i want to create the object instance from apex code in my org but i can not fulfil trigger criteria.

 

How can i bypaas that trigger and insert an insatance of that object from my apex code

 

please suggest some solution or some cheat. 

 

regards

TryCoding

Hi all

i am having a problem and not able to get the solution even after a lot of serching

 

I have a picklist field with values 'yes' and 'No'

 

I want to show this field as radio buttons on my vf page. i.e. one radio button for yes and one for no. and at a time only one can be selected

 

can anybody help me how to do this...

 

i have tried using method on link below

http://blog.sforce.com/sforce/2008/12/using-the-metadata-api-to-retrieve-picklist-values.html 

 

but this is giving error.. please suggest alternate solution..

thanks in advance..

Hi All

 

i need to do some operation on all custom fields of custom objects

 

I am obtaining this object dynamically. So initially i do not know name of my custom, object.

And since i am getting object on the fly hence i do not know the fields

 

Now say if i get object myobject__c. Then i can retrieve all its fields by following code:

 

map<String, Schema.SObjectField> mapFields =  Schema.getGlobalDescribe().get(myobject__c).getDescribe().fields.getMap();

 

My problem is how do i separate standard and custom fields from this collection sothat i can operate only on custom fields.

 

Thanks in advance. Please Help

Let me know if i am not able to explain myself clearly and you need more details

 

Can we set the value of controller variable in JavaScript using binding {! }; something same as we  retrieve it by writing

alert(‘{!myVariable}’);

 

Hi

i want to create a single method for multiple CustomObjects

 

So i want to pass the id of that object in method and want to run soql for that

 

for e.g.

puvlic static void myMethod(id objectId){

                ----Soql to retrieve record -------

 

}

 

how to retreive whole record for that id within method

 

Please Help

Hi All

I want to extract time for my local time zone which i have set in my personal information

 

like  consider apex code below:

 

DateTime cDT = system.Now();

String localDateTime = cDT.format();

 

now localDateTime will be like 4/1/2011 4:22 PM

 

I want to extract 4:22 PM out of this

 

One method given in salesforce documentation is hour,minute methods. But this method takes datetime as argument. But our format method returnes a string.

 

The solution may be convert the string returned by format method to datetime type.

But could not. i tried parse method. it converted my local time back to GMT Time. Secondly i tried valueOf Method. But it accepts string in a specific format. 

 

Please help me solving this problem. I have tries from my side. searched on net. but got no solution

 

 

Hi all,

I am trying to use apex class webService method in java. But it is giving following error


 

Exception in thread "main" AxisFault


Details are as following

Apex Class

 

 

global class WebServiceAccountPlan {
 
   
   global class Plan {
      webservice String name;
      webservice Integer planNumber;
      webservice Date planningPeriod;
      webservice Id planId;
   }
 
   webservice static Plan createAccountPlan(Plan vPlan) {
       
       Account acct = new Account();
       acct.Name = vPlan.name;
       acct.AccountNumber = String.valueOf(vPlan.planNumber);
       insert acct;
       vPlan.planId=acct.Id;
       return vPlan;
  }
   
}

 

 

 

Java Code:

 

 

public class trySendingEmail {

 

 public static void main(String[] args) throws Exception {

 login();         //general login code in method

 //sendEmail();

 WebServiceAccountPlanBindingStub wbind = new WebServiceAccountPlanBindingStub();

 Plan vPlan = new Plan();

 vPlan.setName( "Namita");

 vPlan.setPlanId("abcdNewPlan");

 vPlan.setPlanningPeriod(null);

 vPlan.setPlanNumber(1234);

 

// This line gives the error

 Plan endresult = wbind.createAccountPlan(vPlan);

 //System.out.println("----------------"+endresult);

 }

 

 

}

 

Can anybody please tell me where am i going wrong

 

Hi all

i am having a problem and not able to get the solution even after a lot of serching

 

I have a picklist field with values 'yes' and 'No'

 

I want to show this field as radio buttons on my vf page. i.e. one radio button for yes and one for no. and at a time only one can be selected

 

can anybody help me how to do this...

 

i have tried using method on link below

http://blog.sforce.com/sforce/2008/12/using-the-metadata-api-to-retrieve-picklist-values.html 

 

but this is giving error.. please suggest alternate solution..

thanks in advance..

Hi,

 

I am begining to explore apex - its a must i guess - i seem to be at the upper limit of what i can do with SF just using the UI.

 

So...as a start I was hoping one of the kind people on here could help me out......

 

What I am trying to acheive, i belive requires Apex. Effectivly, when the criteria is met on one object, a new record is created on the other record.

 

So, I have the standard Opportunity Object and a Custom Object called 'CS', when the 'Stage' of the Opportunity is set to 'Closed Won', I need a record to be created on 'CS' (which i should point out is linked by a lookup relationship - created by this trigger).

 

I gather, that this is real basic functionality, however was hoping someone could guide me in the right direction, perhaps with some sample code based on the above, so i can begin to understand how it all slots together.

 

 

Many thanks in advance for your help.

 

 

Steve

 

hi

 

i have a managed package with an object and before insert trigger on that object in that package

 

now i want to create the object instance from apex code in my org but i can not fulfil trigger criteria.

 

How can i bypaas that trigger and insert an insatance of that object from my apex code

 

please suggest some solution or some cheat. 

 

regards

TryCoding

Hi all

i am having a problem and not able to get the solution even after a lot of serching

 

I have a picklist field with values 'yes' and 'No'

 

I want to show this field as radio buttons on my vf page. i.e. one radio button for yes and one for no. and at a time only one can be selected

 

can anybody help me how to do this...

 

i have tried using method on link below

http://blog.sforce.com/sforce/2008/12/using-the-metadata-api-to-retrieve-picklist-values.html 

 

but this is giving error.. please suggest alternate solution..

thanks in advance..

Hi All

 

i need to do some operation on all custom fields of custom objects

 

I am obtaining this object dynamically. So initially i do not know name of my custom, object.

And since i am getting object on the fly hence i do not know the fields

 

Now say if i get object myobject__c. Then i can retrieve all its fields by following code:

 

map<String, Schema.SObjectField> mapFields =  Schema.getGlobalDescribe().get(myobject__c).getDescribe().fields.getMap();

 

My problem is how do i separate standard and custom fields from this collection sothat i can operate only on custom fields.

 

Thanks in advance. Please Help

Let me know if i am not able to explain myself clearly and you need more details

 

Can we set the value of controller variable in JavaScript using binding {! }; something same as we  retrieve it by writing

alert(‘{!myVariable}’);

 

Hi

i want to create a single method for multiple CustomObjects

 

So i want to pass the id of that object in method and want to run soql for that

 

for e.g.

puvlic static void myMethod(id objectId){

                ----Soql to retrieve record -------

 

}

 

how to retreive whole record for that id within method

 

Please Help

Hi All

I want to extract time for my local time zone which i have set in my personal information

 

like  consider apex code below:

 

DateTime cDT = system.Now();

String localDateTime = cDT.format();

 

now localDateTime will be like 4/1/2011 4:22 PM

 

I want to extract 4:22 PM out of this

 

One method given in salesforce documentation is hour,minute methods. But this method takes datetime as argument. But our format method returnes a string.

 

The solution may be convert the string returned by format method to datetime type.

But could not. i tried parse method. it converted my local time back to GMT Time. Secondly i tried valueOf Method. But it accepts string in a specific format. 

 

Please help me solving this problem. I have tries from my side. searched on net. but got no solution

 

 

Hi all,

I am trying to use apex class webService method in java. But it is giving following error


 

Exception in thread "main" AxisFault


Details are as following

Apex Class

 

 

global class WebServiceAccountPlan {
 
   
   global class Plan {
      webservice String name;
      webservice Integer planNumber;
      webservice Date planningPeriod;
      webservice Id planId;
   }
 
   webservice static Plan createAccountPlan(Plan vPlan) {
       
       Account acct = new Account();
       acct.Name = vPlan.name;
       acct.AccountNumber = String.valueOf(vPlan.planNumber);
       insert acct;
       vPlan.planId=acct.Id;
       return vPlan;
  }
   
}

 

 

 

Java Code:

 

 

public class trySendingEmail {

 

 public static void main(String[] args) throws Exception {

 login();         //general login code in method

 //sendEmail();

 WebServiceAccountPlanBindingStub wbind = new WebServiceAccountPlanBindingStub();

 Plan vPlan = new Plan();

 vPlan.setName( "Namita");

 vPlan.setPlanId("abcdNewPlan");

 vPlan.setPlanningPeriod(null);

 vPlan.setPlanNumber(1234);

 

// This line gives the error

 Plan endresult = wbind.createAccountPlan(vPlan);

 //System.out.println("----------------"+endresult);

 }

 

 

}

 

Can anybody please tell me where am i going wrong

 

In the following code sample...

 

<apex:selectRadio value="{!CustomObject__c.CustomField__c}" >

  <apex:selectOption itemValue="true" itemLabel="Yes" />

  <apex:selectOption itemValue="false" itemLabel="No" />

</apex:selectRadio>

 

The second item "No" is selected by default. I want the first item "Yes" to be the one that is, by default, the selected item.

 

Steve

I am receiving a message "No Access allowed to this class" when trying to call a web service for a Custom Button Javascript onClick.
This only occurs when the user is NOT an administrator. Is there a permission that needs to be set to allow this functionality?
Hi,
 
Yesterday I had deployed aan apex trigger from sandbox to production env. The trigger is an "before insert, before update" to check for duplicate account names. The trigger works fine in prodiuction for preventing duplicate Account names.
 
But today when I tried to mass update Accounts for some other field using Apex Data Loader, I get the following error:
 

Apex script unhandled trigger exception by user/organization: 00530000000nHi3/00D300000006QZD

Trg_Account_Name_Dedup: execution of BeforeUpdate

caused by: System.Exception: Too many SOQL queries: 21

Trigger.Trg_Account_Name_Dedup: line 1, column 143

Can anyone please advise on how to disable triggers in production env so that I can carry out other mass updates in Account using Apex Data loader tool.

Thanks and regards,
Ambili

  • February 12, 2008
  • Like
  • 0