• puru
  • NEWBIE
  • 0 Points
  • Member since 2012


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 12
    Replies

Can any one tell me what is Max length of dynamic SOSL/SOQL query?

 

I am building dynamic query where I am adding fields dynamically. I don't know that when my query will fail due the long query.

 

Is there any limit on length of query?

 

Thanks

Purushottam

  • October 31, 2012
  • Like
  • 0

Hi,

 

How to clear the field value onclick event using a apex:commandLink without refreshing the page.

 

Thanks & Regards

Hi i am getting error while executing the trigger so can any one help me out

 

ERROR MSG :· Compile Error: unexpected token: 'list' at line 8 column 47

 

Here is my trigger code

 

trigger GettingPrice on Bookings__c (before insert , before update)
{
set<string> BookingModelSet = new set<string>();
for(integer i=0;i<trigger.size;i++)
{
BookingModelSet.add(trigger.new[i].Model__c);
}
list<Vehicle_Rental_Price__c> PriceOfVehicles = list<Vehicle_Rental_Price__c>(); error in this line

                                 Vehicle_Rental_Price__c is not an custom object its an Custom setting which has a static values       
PriceOfVehicles = [select name , Rental_Price__c from Vehicle_Rental_Price__c where name in BookingModelSet];
Map<string , string> MappingPriceToModel = new Map<string , string>();
for(integer i=0;i<PriceOfVehicles.size();i++)
{
MappingPriceToModel.put(Vehicle_Rental_Price__c[i].name , Vehicle_Rental_Price__c[i].Rental_Price__c);
}
for(integer i=0 ; i<trigger.size ; i++)
{
if(MappingPriceToModel.containskey(trigger.new[i].Model__c))
trigger.new[i].price_per_day__C = MappingPriceToModel.get(trigger.new[i].model__c);
}

}

 

  • August 31, 2013
  • Like
  • 0

BELOW IS MY CODE ON THE BUTTON:

 

{!REQUIRESCRIPT("/soap/ajax/9.0/connection.js")}
var smid = '{!Sales_Memo__c.Id}';
var result = sforce.connection.query("select Id, No_of_Prints__c From Sales_Memo__c where Id = '{!Sales_Memo__c.Id}' limit 1");
var records = result.getArray("records");
if (records.length > 0) {
var record = records[0];
var i = record.No_of_Prints__c;
record.No_of_Prints__c = ++i;
var result = sforce.connection.update([record]);
if(result[0].getBoolean("success")) {
window.open("https://ap1.salesforce.com/apex/SMPDF_re?id="+smid);
document.location.reload();
}
else {
window.alert ("failed to update Sales Memo " + result[0]);
}
}
else {
window.alert ("No record found for Sales Memo Id : {!Sales_Memo__c.Id}" );
}

 

  • January 04, 2013
  • Like
  • 0

Hi -

We are doing an implementation with M-Files which has a connector with SFDC. However, we were
trying to figure out how to pull picklist values out of a field of an object?

For example, we have a custom field called "region" in our user object, and we are trying to access the pick list values. If we just do it at the field level, it pulls the region for every user...but what we really want is to pull the picklist which has about 10 values or so.

Does anyone have any idea how to do this using a SoQL call?

Many thanks!

Ted

  • January 03, 2013
  • Like
  • 0

Hi Community,

 

I am  passing string as a query 

 

String query = 'SELECT ID,Principal_Owner__c, StageName, Last_Campaign_Before_Close__c from opportunity  where Id =\'006E00000056kIw\'';

The above part is working fine .

The problem is when i add the below part it is working .

//and StageName LIKE \'+Closed%\'';

 

Colud any suggest me where iam doing wrong

HI! 

 

What I'd like to do is rather simple, I imagine, but I do not know how to do it. 

 

In our sales process we have "sell-ups" or opportunities that are a direct result of a previous opportunity.  I've created a related relationship so-to-speak for sell-ups to its original opportunity. 

 

For a user to create a "sell-up" they go

1. Go to the original opportunity

2. in the related list section, they hover over "Sell-up" and click Create New Sell-up Button

 

I need this button, when clicked, to open a record that will have some information already populated from the original opportunity such as Account Name, and Opportunity Type.  Once I know how to do one or two fields, I can probably figure out the rest.  

 

 

Thanks a Million! 

Hi,

 

I am looking for a way like when a user gets deactivated all the Opportunites owned by the user should be assigned to their manager .

 

How can i acheive this and any ideas. I know workflows cannot be used for this any thoughts?

 

Thanks

Akhil

  • December 19, 2012
  • Like
  • 0

Hi folks,

 

Today I come to you looking for some help understanding how to bulkify a trigger.  I currently have this code.

 

if(Trigger.isUpdate)
{
Projection_Multi_Year__c testObj = Trigger.new[0];
List<Projection_Multi_Year__c> checkForDups = new List <Projection_Multi_Year__c>([select id from Projection_Multi_Year__c where
account__c = :testObj.account__c and ownerID = :testObj.ownerID]);
if(checkForDups.size() != 0)
{
trigger.new[0].addError('Update dupe error');
}
else
{
String profileID = UserInfo.getProfileID();
String profileName = [Select name from Profile where ID = :profileID].name;
for(Projection_Multi_Year__c obj : Trigger.New)
{

String accountName = [select name from Account where ID = :obj.Account__c].name;
User ownerObj = [select ID,name,LHH_Zone__c,Region__c,ManagerID from User where ID = :obj.ownerID];
String ownerName = [select name from User where ID = :obj.ownerID].name;
String managerName = [select name from USER where ID = :ownerObj.ManagerID].name;
System.debug('obj.CreatedBy.name = ' + old.CreatedBy.Name);
System.debug('obj.CreatedBy = ' + old.CreatedByID);
obj.Projection_Name__c = accountName + ' - ' + divisionName + ' - ' + ownerObj.name;
//this ^ field has 32,000 some chars. Need to also make a var for a 80 char field
if(accountName.length() > 80)
{
accountName = accountName.substring(0,79);
}

if(ownerName.length() > 80)
{
ownerName = ownerName.substring(0,79);
}
String truncatedName = ownerName + ' - ' + accountName + ' - ' + divisionName;
if(truncatedName.length() > 80)
{
truncatedName = truncatedName.substring(0,79);
}
obj.Name = truncatedName;
obj.Manager__c = managerName;
obj.LHH_Zone__c = ownerObj.LHH_Zone__c;
obj.Country_Region__c = ownerObj.Region__c;

}//end of For

 

So while I understand the basics of my problem I am not sure how to write the solution.  I am going to be sending a bulk upload of thousnads of records at this trigger, so I cant have queries inside of a for loop that will itereate through all the records.

 

Help would be much appriciated on the specifics.

Can any one tell me what is Max length of dynamic SOSL/SOQL query?

 

I am building dynamic query where I am adding fields dynamically. I don't know that when my query will fail due the long query.

 

Is there any limit on length of query?

 

Thanks

Purushottam

  • October 31, 2012
  • Like
  • 0

I want to create a javascript button. Like  setup-->contact-->Buttons and links --->Execute javascript   ----- Right...

Next when we click on a  button in contact record one popup window should be came.

 

But the popup outside window should be Fade Effect (Dark color)..

 

Please help me guys