• csbaa
  • NEWBIE
  • 105 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 38
    Questions
  • 29
    Replies
hello helpers

i am experiencing a strange error when try to run an soql query within a trigger.

the query try to retrieve a record set from Attachment object and look like

String variable ='something';
list<Attachment> att =[select id, Name from Attachment where Name =:variable ];

the attachment object contain more then150000 records.

the query throw an exception saying that is non selectiv.
but 

when I execute the same query in developer console I there is no attacment having that name.

so my question is how could be non selectiv a query which would return zero records?

thanks in advance
csbaa
  • September 22, 2015
  • Like
  • 0
Hello Helpers

I have a visual force page  with 2  tabs

On tab  1 I  have some components  like  grids  and customr button

I would like  to   switch automatically  from Tab 1  to Tab 2  when I press the custom button BUT ONLY AFTER  the apex controller method  associated to  custom buton Action has  completed

I tried  to use  oncomplete  to achieve this.  My problem is  that the tab  is switched but  it looks  like the operation  in DoSonethingatApexside  is not performed

     <apex:pageBlockButtons >
     <apex:commandButton action="{!DoSonethingatApexside}" value="Preview"            
     oncomplete="RichFaces.switchTab('{!$Component.theTabPanel}','{!$Component.tabPreview}','Preview')">
     </apex:commandButton> 
     </apex:pageBlockButtons> 


If  I remove the oncomplete  and press the custom button and switch tomTab 2  manually  all Are OK
I see in tab 2  the results  of the custom button action

any suggestions?


Thanks in adsvance
csbaa


  • June 26, 2015
  • Like
  • 0
Hello Helpers


by mistake I  started  recursive  batch class  chain

In the batch  finsih()  method  I  inserted a call for the same batch

Now  I  have a  batc running for  half  day  I  can not stop  it

Abor  does  not work If  i try to abort  I  get the be,ow  message
Failed to Abort Job Unable to remove job from Apex Job Queue.

I  need to stop  this  somehow
What  opton I have?

In the specs  I sew  that  "You can submit up to 5,000 batches per rolling 24 hour period."

but  since start my batch run more then 5000 times    


regards
csaba
  • April 20, 2015
  • Like
  • 0
Hello Helper


I  have to  consume a Webservice written in Biztalk  from an apex batch class

I  have the WSDL
I  created the stub  classes
I was able to  build my bussiness logic


I am looking  for some articles or  guidabce how  to setup  Salesforce  to  be able  to call the webservice method

Do I need a Remote Access app?

How  I  manage the login?

Other things  to consider?

Thanks in advance
csbaa

 
  • April 17, 2015
  • Like
  • 0
Hello Helper

I  created a simple webservice which  edits  account records  
I want  to give access tu user  to this webservice in non autentificate mode throught Site

I read some article  and I sew that this is possible.
I created a site
I  added my webservice class  to the site user  profile

Hovewer when i opened the Public access settings  I noticed that is NOT  possible to give EDIT  permission for the account object

Ca anybody  comment on this?
Would itr be possible  to  edit an account  with a webservice exposed in Site?


Thanks in advance
csbaa

 
  • April 12, 2015
  • Like
  • 0
Hello Helper

I  have a question  about the design ans usage  of Apex Webservice  

I  have to write a  webservice in apex  which  will  be called  from a Biztalk application

I know how  to create  the Webervice.

What  is  do not  know  is  who  should  care about  Login to Salesforce org?

The Web service class  has  to contain a method  for Login  ?
OR
the caller  of the Web Service  has to take  care of  logging first to the Salesfoce org then call  my Webservice ?

what  is  the best practice here?

I preffer to  let this task  at  user side  but I am not  sure this  is a reasonable  approach

Thanks  in advance
Csbaa
  
  • April 05, 2015
  • Like
  • 1
Hello Helpers

I  have a question  related to the behaviour  of a visual  force  page  when user  clicks  enter

I  have  a visual force  page  which  capture  some input  from the user  in  apex:inputField   elements
There are several  apex:inputField  elements  each  linked  to a record 

On the top of  the page I have a apex:commandButton

when user  clicks  on the button  I create  several  records  in the background

BUT,  my  problem is that  any  time user  add a value  into one  of the apex:inputField   text  box the press ENTER and  the system  interpret  it  as a button action

I  want to disable  it
I  want to  button action to be fired  only  when user click on it

I  hope  it  is possible


Thanks in advance
csaba
  • February 05, 2015
  • Like
  • 0
Hello Helpers

I  have  a before update trigger  (on account)  where I am accessing some picklist  fields
I would like  to get the translated value  of  the picklist  file  in the trigger.new[i]

I  know  how  to  get it for an existent  record  in a SQOL  (Select toLabel(Field_API_Name)  from Account)  
this gets  me the trigger.old  value
There is anything similar  to  get the transalted version of  the value in the trigger.new[0].Myfield..?

Regards
Csbaa 
  • November 29, 2014
  • Like
  • 0
Hello Helper

I  have a visual force  page rendered  as pdf  and displaying  some fileds  inside several  html  tables
I would  like  to  display  i the top  of the page  an image  (a company  logo  for example)
I have the logo  file and  I need  some guidance how  to do this

I guess I have  to  store the file  as  static  resource 
but what next?

How  can I embed  the sresource in the <td> ... </td>   section of  the HTML table?

Thanks in advance
csbaa


 
  • November 26, 2014
  • Like
  • 0
Hell Helpers

I have a visual force page where i dispay an apex:inputfield component referencing a picklist member of a custom object

At a certain point I want to make this inputfield disabled

looking into the specification the component has no disabled attribute (like the custombutton for ex)

what option I have?

css style maybe?
i am not familiar with this so any example is appreciated


thanks in advance
csbaa
  • June 07, 2014
  • Like
  • 0
Hello Hepler

I  have a VisualForce page with  a tabPanel  and a few tabs

each tab  display  some records  from a custom object  in the pageblocktable

when I  am switching  between the tabs  I want  some data  initialoizasion apex method to run  but I do not  know  how  to call my  Apx  method  automaticaly  when the a tab became active tab

aany ideas?

thanks in advance
csbaa 
  • April 21, 2014
  • Like
  • 0
Hello Helper

I wowuld like  to create  an  attchment  in an apex  code

I have a List<String>   variable  n my apex  and I want  somehow  to save the strings  in a file  and attach it  to a custom object

I  know the attachment  object  and I know  I can  link this  object  with another custom object

what I do not know  is how  to add my  data  to the attachment object

I sew the field  Body  of  the Attachment  object  but I do not know  how  to  pass my  string list data  to the body



any advice is appreciated

Best  Regards
Csaba


  • January 30, 2014
  • Like
  • 0
Hello Helper

I am curious  if is possible  to retrieve the Salesforce ID of a field  of a custom object  throught apex  code (not metadata API)


Regards
csaba
  • December 26, 2013
  • Like
  • 0

Hello Helpers

 

 

I have a VF page  with a command  button (among others)

 

<apex:commandButton action="{!MycontrolerFunction}"  value="{!someValue}"/>

 

when the MyControllerFuntion is finished I want to redirect  to a new page

 

For this I am using:

 

PageReference pageRef = new PageReference('/apex/MySecondPage');
pageRef.setRedirect(true);
return pageRef;

 

 

This open the new VF page  on the same  tab overwriting the initial page

 

What I want to achieve  is to  open the new VF page on a new  tab

 

 

Is it possible

 

Thanks in advance 

csbaa

  • November 22, 2013
  • Like
  • 0

Hello Helpers

 

I would like  to  display a popup  dialog  box  from inside the Visual force  page  After  the action  method  is finished at the controller side. the diualog  Box  should  display a simple message  something like  "operation succesfull"

 

 

 

<apex:commandButton  action="{!FunctionFromapexcontroller}"   "/>

 

I know  how  to  diplay  message boxes  using Javascipt  onclick()  evewnt handler but these messages fire before the 

action  method  starts

 

 

I need a message  after  the method  in controller finish

 

any suggestions are welcommed

 

Thanks in advancs

csaba

 

 

 

  • November 22, 2013
  • Like
  • 0

Hello Helpers

 

It is possible  to add scrollBar  to apex:pageBlockTable?

 

thanks in advance

csbaa

  • November 16, 2013
  • Like
  • 0

Hello Helper

 

I want to embedd a visual force page into a section  of a custom object page layout

 

I  did it  but  I was surprised  to see that my  page  is not visible  in Edit mode  only after I save  the record

 

The visual force page  does not use any data of the cusotm object  it displays  soem record form another   

 

In order  to make the page available   in the page layout designer   I defined  the page as   below  (where "MyCustomObject"  is the object  where I have to display the VF page  but  as I mentioend the page does not use the record being edited/created )

 

<apex:page standardController="Coaching_Report_vod__c" extensions="VEEVA_CR_helper">

 

any suggestions are welcommed

 

 

Thanks  in advance

Csbaa

 

 

 

 
  • November 04, 2013
  • Like
  • 0

Hello Helper

 

 

I am having a problem with controller.getSelected();    apex code

 

I have a simple visual  force  page  and an extension class

 

I have a custom button  on a related list  of an object

 

I want to select a few items  on the related list  and perform a mass update on the selected  child  records

 

in the constructor  of the extension class  I call:

 

public MyExtensionClass(ApexPages.StandardSetController controller)

{

 

...

MyChildCustomObject[] EAs = controller.getSelected();

 

if(EAs.size() == 0)
{
SerrMsg = 'Select at least 1 event attendee to update.';
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,SerrMsg));
errorMsg = true;
return;
}

 

 

..

 

 

}

 

the size  of the EAs  array is always  0

 

 

I am missing something?

 

Regards

Csaba

 

 

 

 

 

 

 

 

 

  • October 30, 2013
  • Like
  • 0

Hello Helpers

 

 

I would  like  to update  a record  using jscript  called from a custom button on a related list

 

I am building a dynamic SOQL statement,  call  sforce.connection.query(SQL),  iterate through  the result set,  then try  to update 1 field  on each record  in the result set

 

 

 

var SQLu = "Select Id,Status_vod__c from Event_Attendee_vod__c where id in (some ID values here); 

alert(SQLu); 

result = sforce.connection.query(SQLu); 

alert(result); 

records = result.getArray("records"); 


for(i=0; i < result.getArray("records").length; i++) 


alert(result.getArray("records")[i].Status_vod__c);               //I a just displaying  to old value for test
result.getArray("records")[i].Status_vod__c = "Attended";   //this will be the new value
alert(result.getArray("records")[i].Status_vod__c);               //I just check if the new value was set

 


sforce.connection.update(result.getArray("records")[i]);      //THIS IS WRONG
}

 

 

what is the right syntax  for  sforce.connection.update(...)   ?

 

can I update  the records outside the for loop?

 

the  record  I want to update  belongs  to a custom object

 

 

Any  suggestion is more then welcommed

 

 

Thanks in advance

csbaa

  • October 30, 2013
  • Like
  • 0

Hello Helper

 

I want to export   from an org a package  containing  custom objects,  Custom fields , classes,  custom buttons......

 

I created a package.xml  file where I included  the Metadata  types  I want to export

 

I can not  specify  Custom button Metadata  type

Looking into the salesforce docs it seems to me that is is  considered as weblink

 

I tried  something like  below

 

.....

<types>
<members>Account.CustomButton_1</members>
<members>Account.CustomButton_1</members>
<name>webLinks</name>
</types>

 

 

 

but it does not work

 

any suggestion?

 

 

Thanks in advance

Csaba

 

 

 

 

  • September 22, 2013
  • Like
  • 1
Hello Helper

I  have a question  about the design ans usage  of Apex Webservice  

I  have to write a  webservice in apex  which  will  be called  from a Biztalk application

I know how  to create  the Webervice.

What  is  do not  know  is  who  should  care about  Login to Salesforce org?

The Web service class  has  to contain a method  for Login  ?
OR
the caller  of the Web Service  has to take  care of  logging first to the Salesfoce org then call  my Webservice ?

what  is  the best practice here?

I preffer to  let this task  at  user side  but I am not  sure this  is a reasonable  approach

Thanks  in advance
Csbaa
  
  • April 05, 2015
  • Like
  • 1

Hello Helper

 

I want to export   from an org a package  containing  custom objects,  Custom fields , classes,  custom buttons......

 

I created a package.xml  file where I included  the Metadata  types  I want to export

 

I can not  specify  Custom button Metadata  type

Looking into the salesforce docs it seems to me that is is  considered as weblink

 

I tried  something like  below

 

.....

<types>
<members>Account.CustomButton_1</members>
<members>Account.CustomButton_1</members>
<name>webLinks</name>
</types>

 

 

 

but it does not work

 

any suggestion?

 

 

Thanks in advance

Csaba

 

 

 

 

  • September 22, 2013
  • Like
  • 1
hello helpers

i am experiencing a strange error when try to run an soql query within a trigger.

the query try to retrieve a record set from Attachment object and look like

String variable ='something';
list<Attachment> att =[select id, Name from Attachment where Name =:variable ];

the attachment object contain more then150000 records.

the query throw an exception saying that is non selectiv.
but 

when I execute the same query in developer console I there is no attacment having that name.

so my question is how could be non selectiv a query which would return zero records?

thanks in advance
csbaa
  • September 22, 2015
  • Like
  • 0
Hello Helper


I  have to  consume a Webservice written in Biztalk  from an apex batch class

I  have the WSDL
I  created the stub  classes
I was able to  build my bussiness logic


I am looking  for some articles or  guidabce how  to setup  Salesforce  to  be able  to call the webservice method

Do I need a Remote Access app?

How  I  manage the login?

Other things  to consider?

Thanks in advance
csbaa

 
  • April 17, 2015
  • Like
  • 0
Hello Helper

I  have a question  about the design ans usage  of Apex Webservice  

I  have to write a  webservice in apex  which  will  be called  from a Biztalk application

I know how  to create  the Webervice.

What  is  do not  know  is  who  should  care about  Login to Salesforce org?

The Web service class  has  to contain a method  for Login  ?
OR
the caller  of the Web Service  has to take  care of  logging first to the Salesfoce org then call  my Webservice ?

what  is  the best practice here?

I preffer to  let this task  at  user side  but I am not  sure this  is a reasonable  approach

Thanks  in advance
Csbaa
  
  • April 05, 2015
  • Like
  • 1
Hello Helpers

I  have a question  related to the behaviour  of a visual  force  page  when user  clicks  enter

I  have  a visual force  page  which  capture  some input  from the user  in  apex:inputField   elements
There are several  apex:inputField  elements  each  linked  to a record 

On the top of  the page I have a apex:commandButton

when user  clicks  on the button  I create  several  records  in the background

BUT,  my  problem is that  any  time user  add a value  into one  of the apex:inputField   text  box the press ENTER and  the system  interpret  it  as a button action

I  want to disable  it
I  want to  button action to be fired  only  when user click on it

I  hope  it  is possible


Thanks in advance
csaba
  • February 05, 2015
  • Like
  • 0
Hell Helpers

I have a visual force page where i dispay an apex:inputfield component referencing a picklist member of a custom object

At a certain point I want to make this inputfield disabled

looking into the specification the component has no disabled attribute (like the custombutton for ex)

what option I have?

css style maybe?
i am not familiar with this so any example is appreciated


thanks in advance
csbaa
  • June 07, 2014
  • Like
  • 0
Hello Helper

I am curious  if is possible  to retrieve the Salesforce ID of a field  of a custom object  throught apex  code (not metadata API)


Regards
csaba
  • December 26, 2013
  • Like
  • 0

Hello Helpers

 

 

I have a VF page  with a command  button (among others)

 

<apex:commandButton action="{!MycontrolerFunction}"  value="{!someValue}"/>

 

when the MyControllerFuntion is finished I want to redirect  to a new page

 

For this I am using:

 

PageReference pageRef = new PageReference('/apex/MySecondPage');
pageRef.setRedirect(true);
return pageRef;

 

 

This open the new VF page  on the same  tab overwriting the initial page

 

What I want to achieve  is to  open the new VF page on a new  tab

 

 

Is it possible

 

Thanks in advance 

csbaa

  • November 22, 2013
  • Like
  • 0

Hello Helpers

 

I would like  to  display a popup  dialog  box  from inside the Visual force  page  After  the action  method  is finished at the controller side. the diualog  Box  should  display a simple message  something like  "operation succesfull"

 

 

 

<apex:commandButton  action="{!FunctionFromapexcontroller}"   "/>

 

I know  how  to  diplay  message boxes  using Javascipt  onclick()  evewnt handler but these messages fire before the 

action  method  starts

 

 

I need a message  after  the method  in controller finish

 

any suggestions are welcommed

 

Thanks in advancs

csaba

 

 

 

  • November 22, 2013
  • Like
  • 0

Hello Helper

 

 

I am having a problem with controller.getSelected();    apex code

 

I have a simple visual  force  page  and an extension class

 

I have a custom button  on a related list  of an object

 

I want to select a few items  on the related list  and perform a mass update on the selected  child  records

 

in the constructor  of the extension class  I call:

 

public MyExtensionClass(ApexPages.StandardSetController controller)

{

 

...

MyChildCustomObject[] EAs = controller.getSelected();

 

if(EAs.size() == 0)
{
SerrMsg = 'Select at least 1 event attendee to update.';
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,SerrMsg));
errorMsg = true;
return;
}

 

 

..

 

 

}

 

the size  of the EAs  array is always  0

 

 

I am missing something?

 

Regards

Csaba

 

 

 

 

 

 

 

 

 

  • October 30, 2013
  • Like
  • 0

Hello Helper

 

I want to export   from an org a package  containing  custom objects,  Custom fields , classes,  custom buttons......

 

I created a package.xml  file where I included  the Metadata  types  I want to export

 

I can not  specify  Custom button Metadata  type

Looking into the salesforce docs it seems to me that is is  considered as weblink

 

I tried  something like  below

 

.....

<types>
<members>Account.CustomButton_1</members>
<members>Account.CustomButton_1</members>
<name>webLinks</name>
</types>

 

 

 

but it does not work

 

any suggestion?

 

 

Thanks in advance

Csaba

 

 

 

 

  • September 22, 2013
  • Like
  • 1

Hello Helpers

 

I have a requirement to inactivate an User right after creation  and send a notification  to the new User

This is not  aregular user bu t achatter free user who is invited to join a Group

 

The bussiness logic  is to deny  logging into the org  for Chatter free User  till they  perform some actions

 

I created a class contaning  a @future method  which  inactivates  an User  and send an email to that user

 

I call this future method  from within an after insert trigger on User object

 

The inactivation work always OK  but the mail is not always delivered.

I have no idea why  and I can not even debug

 

 

I can not  chech the debug  log  because the  user is not created manually by an admin but  by salesforce when chatter free user fill in the invitation form. 

 

any suggestion or a workaround?

 

thanks in advance

Csaba

 

 

 

 

  • June 28, 2013
  • Like
  • 0

Hello Helpers

 

I would like to know  how  can I send email with attachment  from an apex class

 

I know  how  to send mails.

I sew articles about how  to attach a VFpage  rendered as pdf

 

but what I need is to attach a file  to my email

 

I am thinking to a static resource  

 

any suggestions?

 

regards

csbaa

 

  • April 21, 2013
  • Like
  • 0

Hello Helpers

 

I havea generic question about how  the package and deploy  code

 

I am working on an integration project  and I have a few  batch classe/triggers  and custom object

 

The classes/triggers  are referencing  some fields  on other custom objects wwhich are not part of my  application

those object are part of our core CRM  

My code rely on the existence  of  some fields in the other objects  otherwise when I import the classes with eclipse  I get compile  errors.

 

before deploying my code I use to manyally create the new  fields in the related objects  then  import the class / triggers  in Eclipse from the file system.

 

It is OK when I am doing  the deployment  but  I plan to handover   this to non-technical persons

 

The question is  it is possible  to  create a package which  creates the fieds itself?

 

I use Eclipse  to deploy  entire object  from a file  but how  to procede if the object exists  and I just want  to add a few fileds  or other metadata  components  like  custom butons for example?

 

There is  a solution for my problem?  I guess yes.

 

any ideas  or,  small examples or  link to article  in the knowledge base would be very usefull

 

thanks in advance

Csaba

 

  • April 10, 2013
  • Like
  • 0

Hello Helper

 

I want to force a logged user to do something  before start working .  for this I see 2 options:  

 

A. automatically redirect the user to a visual force page right after login

 

Or 

 

B. display a modal dialog box  on the home tab  like the salesforce "Getting started with Chatter"

 

It would be possible?

any other options/suggestion are welcomed

 

 

Thanks in advance

csbaa

  • April 06, 2013
  • Like
  • 0