• Deepa.B.Ankali
  • NEWBIE
  • 190 Points
  • Member since 2013


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

Hi Friends,

 

what 's wrong?

 

Error:

 

Error: Compile Error: Invalid initial expression type for field Contract.AccountId, expecting: Id at line 9 column 42

 

Trigger

 

trigger QuoteTrigger on Quote(after update){
private string tagoppid {get;set;}
    for(Quote quo : trigger.new){
        if(trigger.isUpdate){
            if(quo.Status== 'Accepted' && quo.Status!= trigger.oldMap.get(quo.Id).Status){
                tagoppid = quo.OpportunityId;
                //create a contract
                contract[] newcontract = new List<contract>{
                new contract(AccountID = [select AccountID from Opportunity where Id = :tagoppid ],
                             //AccountID = quo.OpportunityId,
                             CustomerSigned = quo.Contact,
                             Name = 'Test 1',   
                             CustomerSignedTitle = quo.Name,
                             StartDate = System.today(),
                             ContractTerm = 6)};
                
                //SaveResult[] results = binding.create(new sObject[] {newcontract });
                Database.SaveResult[] srList = Database.insert(newcontract, false);
                
                // Iterate through each returned result
                for (Database.SaveResult sr : srList) {
                    if (sr.isSuccess()) {
                        // Operation was successful, so get the ID of the record that was processed
                        System.debug('Successfully inserted account. Account ID: ' + sr.getId());
                    }
                    else {
                        // Operation failed, so get all errors                
                        for(Database.Error err : sr.getErrors()) {
                            System.debug('The following error has occurred.');                    
                            System.debug(err.getStatusCode() + ': ' + err.getMessage());
                            System.debug('Account fields that affected this error: ' + err.getFields());
                        }
                    }
                }
        }
    }
}
}

Hi,

 

when click command link or anchor link input text box value changed using javascriipt?

 

Thanks

Hi,

 

we use Salesforce-to-salesforce feature successfully.

A new trigger must be implemented on Account.

This trigger has

* to start when an Account is transferred by S-to-S (Button "External sharing" was clicked)

* and to update all related objects, like Opportunity and some Custom Objects .

 

Why Account trigger? -> because where is no possibility to place a trigger for "PartnerNetworkRecordConnection" Object.

I did some tests and found out, that the "LastModifiedDate" field on Account is updated when "External Sharing" was clicked. No other Data is changed. 

 

QUESTIONS:

-------------------------

1) Do we realy have no other fields which are being updated by the system ? Or do we have possibly a flag on Account that set to e.g. "true" when Account is transferred by S-t-S?

2) Will the "AFTER UPDATE" trigger execute, when just "LastModifidDate" is changed?

 

Thanks!

 

 

Error: Compile Error: Entity 'Product' not accessible in version 29.0 at line 1 column 1  please help me thanks in advance

 

 

trigger updateNewvalues on product2 (before update) {


   for (Product2 prod: Trigger.new) {
               if(prod.Ampics_PL__c !=null &&  Product.Ampics_PL__c == 'Utilix') {
                
             String str = 'Utilix';
             String[] sstr = str.split('/');
              system.debug(sstr[0]);
              system.debug(sstr[1]);
           
              System.debug('--*Product Value is changed*--');
              
              System.debug('**Ampics_PL__c  :'+prod.sstr[0]);
              
       }
       
       else{
              prod.Pieces_in_Pack__c = '1';  
       }
   }
}

Can anyone explain me why this error arises. Tried all other replies for the similar post. Doesnt work. This error occurs on click of save button in a custom visualforce page.

 

error:

  • j_id0:apexForm:Pb:j_id179:j_id180:0:j_id181: An error occurred when processing your submitted information.

Even though i am using "Transient" Key word VF page shows an Error "Maximum view state size limit (135KB) exceeded". Then what do i have to do.? How can i rectify this error.? 

AND(ISCHANGED( Provider_City__c ) || 
ISCHANGED( Provider_Country__c ) || 
ISCHANGED( Provider_State__c ) || 
ISCHANGED( Provider_Street__c ) || 
ISCHANGED( Provider_zip_postal_code__c ), $User.Id <> '005i0000001jkrK')

 
I need this validation to fire after first update is done. That means if anyone wants to change these for the second time these fields must be locked.
 
CAn you please check the possibility created date or last modified also not working because they will change other fields on the same record.
  • December 12, 2013
  • Like
  • 0

Can anyone explain me why this error arises. Tried all other replies for the similar post. Doesnt work. This error occurs on click of save button in a custom visualforce page.

 

error:

  • j_id0:apexForm:Pb:j_id179:j_id180:0:j_id181: An error occurred when processing your submitted information.

Hi ,

I'm trying to write a batch apex on User. I have to capture the system generated lastlogindate into the custom field called LastLoginDate__c For this i wrote a code which is as below.

global class SearchAndReplace implements Database.Batchable<sobject>{

global final String Query;
global final String Entity;
global final String Field;
global final String Value;

global SearchAndReplace(String q, String e, String f, String v){

Query=q; Entity=e; Field=f;Value=v;
}

global Database.QueryLocator start(Database.BatchableContext BC){
return Database.getQueryLocator(query);
}

global void execute(Database.BatchableContext BC, List<User> scope){
for(User u:Use)
{
u=[select LastLoginDate from User where Id=:UserInfo.getUserId()];
u.LastLoginDate__c=u.LastLoginDate;

u.put(Value);
}
update use;
}

global void finish(Database.BatchableContext BC){
}
}

The error what i get is Error: Compile Error: Argument type of global method must also be global: LIST<User> at line 17 column 16.

could any one guide me.Thank you in advance

Hi Everyone,

 

I wanted to create "Unresolved Items"(Tasks or Emails) from Email Service apex class if the cc email is not associated with any contact record.

 

Is this be possible? or there will be some other workaround for achieving this with the email services?

 

Any Help will be appreciated

 

Thanks in advance

 

Hi Friends,

 

what 's wrong?

 

Error:

 

Error: Compile Error: Invalid initial expression type for field Contract.AccountId, expecting: Id at line 9 column 42

 

Trigger

 

trigger QuoteTrigger on Quote(after update){
private string tagoppid {get;set;}
    for(Quote quo : trigger.new){
        if(trigger.isUpdate){
            if(quo.Status== 'Accepted' && quo.Status!= trigger.oldMap.get(quo.Id).Status){
                tagoppid = quo.OpportunityId;
                //create a contract
                contract[] newcontract = new List<contract>{
                new contract(AccountID = [select AccountID from Opportunity where Id = :tagoppid ],
                             //AccountID = quo.OpportunityId,
                             CustomerSigned = quo.Contact,
                             Name = 'Test 1',   
                             CustomerSignedTitle = quo.Name,
                             StartDate = System.today(),
                             ContractTerm = 6)};
                
                //SaveResult[] results = binding.create(new sObject[] {newcontract });
                Database.SaveResult[] srList = Database.insert(newcontract, false);
                
                // Iterate through each returned result
                for (Database.SaveResult sr : srList) {
                    if (sr.isSuccess()) {
                        // Operation was successful, so get the ID of the record that was processed
                        System.debug('Successfully inserted account. Account ID: ' + sr.getId());
                    }
                    else {
                        // Operation failed, so get all errors                
                        for(Database.Error err : sr.getErrors()) {
                            System.debug('The following error has occurred.');                    
                            System.debug(err.getStatusCode() + ': ' + err.getMessage());
                            System.debug('Account fields that affected this error: ' + err.getFields());
                        }
                    }
                }
        }
    }
}
}

Hey Guys,

 

I am trying to create a custom button executing javascript. This button is same like DELETE button . it will also delete records only when certain checkbox is  NOT checked off. If that checkbox is checked off , it should not delete records rather it should give an alert message. Below is the javascript. But Everytime , I click the button on record , I get this error: Please help me in fixing the code.

 

A problem with the OnClick JavaScript for this button or link was encountered:

Unexpected token '{'

 


Javascript&colon;

 

{!REQUIRESCRIPT('/soap/ajax/28.0/connection.js')} 

var oppty = new sforce.SObject('OpportunityLineItem'); 
oppty.Id = '{!OpportunityLineItem.Id}'; 

If ( oppty.Trafficked__c = 'False'){ 
var resultoppty = sforce.connection.delete([oppty]); 

else 

alert('cannot delete.please retry again'); 
location.reload(); 
}

Hi,

 We have around 1000's of uploads done over the course of years and reaching our limit on storage. I can download the file but one file at a time is not a solution production wise. Please could you recommend on how to achieve downloading/exporting the pdf's to computer in a bulk method. 

 

Thanks.

In My pageblock table 5 rows.. 1st field is a commandlinks[1,2,3,4 and 5 values]..

 

If i click 1 means , 1 will be highlighted red color, other numbers 2,3,4,5 are asusual color,

click 2 means , 2 will be change red color , other numbers are 1,3,4,5 are asusual color,

cick 3 , means ,......

click 4 means .........

click 5 means ......

 

  • December 10, 2013
  • Like
  • 0

Hi,

I would like to access field values via Javascript Button.When i'm trying to access the field values the values are not refreshing dynamically.Only the values that are there at the time of load are getting dispalyed.

 

This is my problem statement:

 

1) I have an inline VF Page with 2 radio buttons in the detail record.

2) I  have a custom Java Script Button in which i need to access the field values.

3) When I select one Radio button and click on that Button I need to access the selected value.

It's something like when I select 1 radio button and click on the button it should redirect to one URL

and when I select the other it should redirect to someother URL.

 

The problem lies in how to  link my Inline VF page values with Custom Javascript Button.

 

My Approach:


I created 2 check box fields and whenever I select one radiobutton, in the backend i'm updating the checkbox fields accordingly.

If I select Radiobutton1  it updates checkbox1 to true and If I select Radiobutton2 it updates checkbox2.

so now when I click on custom Javascript button and try to access those checkbox fields i'm getting their values as they are when the page loads.

 

The changed values of the checkbox fields cannot be accessed in the Custom button.The values that are there when the page loads are getting accessed.

So I'm unable to proceed further.

 

Is there anyway by which I can link my VF Page values to Custom Javascript button.

 

I need to use radio buttons only and there is no datatype as radio button so that is the reason I went for an Inline VF Page.

So if there anyother ways of getting a radio buttons pl suggest.

 

Any Help is highly appeciated :)

Many Thanks :)

Hi,

I would like to access field values via Javascript Button.When i'm trying to access the field values the values are not refreshing dynamically.Only the values that are there at the time of load are getting dispalyed.

 

This is my problem statement:

 

1) I have an inline VF Page with 2 radio buttons in the detail record.

2) I  have a custom Java Script Button in which i need to access the field values.

3) When I select one Radio button and click on that Button I need to access the selected value.

It's something like when I select 1 radio button and click on the button it should redirect to one URL

and when I select the other it should redirect to someother URL.

 

The problem lies in how to  link my Inline VF page values with Custom Javascript Button.

 

My Approach:


I created 2 check box fields and whenever I select one radiobutton, in the backend i'm updating the checkbox fields accordingly.

If I select Radiobutton1  it updates checkbox1 to true and If I select Radiobutton2 it updates checkbox2.

so now when I click on custom Javascript button and try to access those checkbox fields i'm getting their values as they are when the page loads.

 

The changed values of the checkbox fields cannot be accessed in the Custom button.The values that are there when the page loads are getting accessed.

So I'm unable to proceed further.

 

Is there anyway by which I can link my VF Page values to Custom Javascript button.

 

I need to use radio buttons only and there is no datatype as radio button so that is the reason I went for an Inline VF Page.

So if there anyother ways of getting a radio buttons pl suggest.

 

Any Help is highly appeciated :)

Many Thanks :)

We currently have a workflow that creates a "dummy" email address when an email address is not provided in a lead or contact record. The business requirement is for the email address to be FirstName.LastName@Company.nomail. The problem we're running into is that the email fields do not like any spaces in the email address, which is a problem for company's with multiple words in their name.. i.e. Some Burger Corp. Contact names also cause the same issue.

 

The workflow uses a simple formula to set the value: FirstName +"."+ LastName +"@"+ Company +"."+ "nomail"


Is there a way to remove all white spaces in a concatenation formula?

 

Thanks for you help.

Hello,

I want to display selected records in vf page ..

i tried but it s not working..

how can resolve this issue..

 

 

 

 

<apex:page standardController="Account" recordSetVar="Thenumber">
    <apex:form >
        <apex:pageblock >
            <apex:pageBlockSection >
                 <apex:pageBlockTable value="{!Thenumber}" var="num" cellpadding="10" cellspacing="15" >
                    <apex:column headerValue="name" >
                        {!num.Name}
                        
                   <!-- <apex:actionSupport event="onclick" reRender="out" status="mystatus">
                                 <apex:param name="numId" value="{!num.Id}"/>  
                                  </apex:actionSupport> -->                    
                    </apex:column>
                    <apex:column headerValue="Account Number">
                    

                    <apex:outputText value="{!IF((num.accountnumber == null),'N/A',num.accountnumber)}"/>                    
                    </apex:column>
                    <apex:column headerValue="Action">
                        <apex:inputCheckbox >
                           <apex:actionSupport event="onclick" reRender="out" status="mystatus">
                                     <apex:param id="numId" value="{!num.Id}"/>
                                </apex:actionSupport>
                        </apex:inputCheckbox>
                    </apex:column>
                      
                </apex:pageBlockTable>       
            </apex:pageBlockSection>
        </apex:pageblock>
        <apex:actionStatus id="mystatus" startText="Buffering...........">
            <apex:facet name="stop">
                <apex:outputPanel id="out">
                    <apex:detail subject="{!$CurrentPage.parameters.numId}" relatedList="false"/>
                </apex:outputPanel>
            </apex:facet>        
        </apex:actionStatus>
    </apex:form>
</apex:page>

 

  • December 04, 2013
  • Like
  • 0

Hi All i have a query ...

 

SELECT Name, Id, Total_Contract_Gross_Profit__c, Total_Contract_Revenue__c, Total_Contract_Sales_Margin__c, Total_Start_Up_Gross_Profit__c,
Total_Start_Up_Revenue__c, (SELECT Description__c,Name,Quantity__c,Unit_Cost__c,Unit_Price__c,Unit_Sell__c
FROM MCS_Contract_Invoice_Startup_Line_Items__r) FROM MCS_Contract_Recurring_Service_Invoice__c where id = :invoiceId

 

which brings back a list of invoices and related startup items.

 

Does anyone know how i would or what is the best practice to display the invoice followed by startup items on a visualforce page?

 

I tried using datatables like this

 

<apex:dataTable value="{!Invoices}" var="invoice">

    <apex:dataTable value="{!invoices.MCS_Contract_Invoice_Startup_Line_Items__r}" var="i">

          <apex:outputfield value={!Name}

 

 

but nothing ...

 

Any help would be great.

 

Thanks.

 

Hi,

 

when click command link or anchor link input text box value changed using javascriipt?

 

Thanks