• gyorkoz
  • NEWBIE
  • 50 Points
  • Member since 2010

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

I am using an inputTextarea for a custom outgoing email but my vf page cannot maintain line breaks or spaces. It seperates every word with one char long space regardless of how you indented your text.

 

e.g: I type:

'

 a     b

     c

 d    

    e    f  '

 

I'll get:

'a b c d e f'

 

thanks

 

I'm newbie and I would like to enrich my working lead-creator API with using assigment rules.

I found that I should precede the creating code with

 

$useDefaultRule = new soapval('useDefaultRule', null, 'true');
    $crmHandle->setHeader('AssignmentRuleHeader', array($useDefaultRule));

 

 

$useDefaultRule = new soapval('useDefaultRule', null, 'true');

$crmHandle->setHeader('AssignmentRuleHeader', array($useDefaultRule));

 

but it gives that setHeader() is an undefined method.

 

how could I fix the problem?

thanks for the answers

I'd like to find out, if a product, related to an opportunity is a kind of support-type product. The unique information is in the product code and I'd like to pick a checkbox on the opportunity if there's any of them. (and of course pick it false if all of the support products have been removed).

I've created a trigger but I get the "Too many SOQL queries: 21" error. I know what should I do but as a newbie I have no idea how.

 

thanks for the ideas!

 

Here's my code:

 

trigger subscriptionSupport on Opportunity (before insert, before update, after insert, after update)
{
    Boolean subAndSup=false;
    
    List<Id> opportunityId=new List<Id>();
    List<Id> priceBookEntryIds=new List<Id>();
    for(Opportunity t:trigger.new){
        if (t.HasOpportunityLineItem == true) {
            opportunityId.add(t.Id);
            for(OpportunityLineItem pbe: [SELECT PriceBookEntryId FROM OpportunityLineItem WHERE OpportunityId IN :opportunityId] ) {
                priceBookEntryIds.add(pbe.PriceBookEntryId);
            }
            for(PriceBookEntry pc:
                          [SELECT ProductCode FROM PriceBookEntry WHERE Id IN : priceBookEntryIds ] ) {
                if(pc.ProductCode.endsWith('bsu')==TRUE  ||

                         ..........................) 

                 { subAndSup = true; }

           }               
        }
    }
    List<Opportunity> opportunityToUpdate=
            [SELECT Id,Subscription_Support__c FROM Opportunity WHERE Id IN :opportunityId];
    For (Opportunity u:opportunityToUpdate){
        u.Subscription_Support__c = subAndSup;
    }
    
    try{
        update opportunityToUpdate;
    }catch(DMLException e){
        system.debug('Opportunity was not properly updated.  Error: '+e);
    }

}

 

 

hi,

I'd like to enforce my users not to leave the lead in default status after they could reach the customer. Depending on the call the new status can be divers, so I need to open a picklist-values-choosing page.
It would be great to get it directly from the trigger or I could set a checkbox field and create a workflow rule on it, so the next time the users open the lead they have to set the new status.

Is there any way to open a visualforce page from a trigger?

I'm newbie and I would like to enrich my working lead-creator API with using assigment rules.

I found that I should precede the creating code with

 

$useDefaultRule = new soapval('useDefaultRule', null, 'true');
    $crmHandle->setHeader('AssignmentRuleHeader', array($useDefaultRule));

 

 

$useDefaultRule = new soapval('useDefaultRule', null, 'true');

$crmHandle->setHeader('AssignmentRuleHeader', array($useDefaultRule));

 

but it gives that setHeader() is an undefined method.

 

how could I fix the problem?

thanks for the answers

I'd like to find out, if a product, related to an opportunity is a kind of support-type product. The unique information is in the product code and I'd like to pick a checkbox on the opportunity if there's any of them. (and of course pick it false if all of the support products have been removed).

I've created a trigger but I get the "Too many SOQL queries: 21" error. I know what should I do but as a newbie I have no idea how.

 

thanks for the ideas!

 

Here's my code:

 

trigger subscriptionSupport on Opportunity (before insert, before update, after insert, after update)
{
    Boolean subAndSup=false;
    
    List<Id> opportunityId=new List<Id>();
    List<Id> priceBookEntryIds=new List<Id>();
    for(Opportunity t:trigger.new){
        if (t.HasOpportunityLineItem == true) {
            opportunityId.add(t.Id);
            for(OpportunityLineItem pbe: [SELECT PriceBookEntryId FROM OpportunityLineItem WHERE OpportunityId IN :opportunityId] ) {
                priceBookEntryIds.add(pbe.PriceBookEntryId);
            }
            for(PriceBookEntry pc:
                          [SELECT ProductCode FROM PriceBookEntry WHERE Id IN : priceBookEntryIds ] ) {
                if(pc.ProductCode.endsWith('bsu')==TRUE  ||

                         ..........................) 

                 { subAndSup = true; }

           }               
        }
    }
    List<Opportunity> opportunityToUpdate=
            [SELECT Id,Subscription_Support__c FROM Opportunity WHERE Id IN :opportunityId];
    For (Opportunity u:opportunityToUpdate){
        u.Subscription_Support__c = subAndSup;
    }
    
    try{
        update opportunityToUpdate;
    }catch(DMLException e){
        system.debug('Opportunity was not properly updated.  Error: '+e);
    }

}

 

 

hi,

I'd like to enforce my users not to leave the lead in default status after they could reach the customer. Depending on the call the new status can be divers, so I need to open a picklist-values-choosing page.
It would be great to get it directly from the trigger or I could set a checkbox field and create a workflow rule on it, so the next time the users open the lead they have to set the new status.

Is there any way to open a visualforce page from a trigger?

I've been doing some reading and I think I'm *almost* there.  I'm doing the following to attempt to use the lead assignment rules, but it isn't working -- I get NULL results. 

$leadassign = new soapval('autoAssign', 'boolean', 'TRUE');

    $contact = new sObject('Lead',
                           null,
                           array(
                               'salutation' => $_POST['salutation'],
                               'FirstName' => $_POST['first_name'],
                               'LastName' => $_POST['last_name'],
                                 'Company' => $_POST['company'],
                                 'email' => $_POST['email'],
                                'LeadSource' => $_POST['lead_source'],
                                'Street' => $_POST['street'],
                                'City' => $_POST['city'],
                                'State' => $_POST['state'],
                                'Phone' => $_POST['phone'],
                                'PostalCode' => $_POST['zip'],
                                'Country' => $_POST['country'],
                               'MobilePhone' => $_POST['mobile'],
                               $leadassign                           )                          
                          );
    $createResult = $sfdc->create($contact);
  print_r("\ncreate one: \n\n");
print_r($createResult);


Thanks for any help!!

Chuck