• Mohandaas
  • NEWBIE
  • 59 Points
  • Member since 2010

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 33
    Replies

I am trying to do a simple subtraction formula for calculating a duration date using

 

Project_End_Date__c - Project_Start_Date__c

 

I get the following error:

Error: Formula result is data type (Number), incompatible with expected data type (Date).

 

What am I doing wrong?

I am getting this error "INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id" when a customer portal guest user tries to update a User record in salesforce. I guess the customer portal profile does not have the "Manage Users" permission and hence the update fails.Is there a way around this problem?
Have you seen this error while approving a record by email response?

An error occurred and your workflow approval message was not processed.
            Please contact your system administrator.

One of the cause happen to be there was another user with the same email address as the approver who responded to the email.
Below is the code I generated from a wsdl. I would need your advice in calling the AUXTableAdministration method.

I am not quite clear about the final argument AuxTableAdministration.xDoc_element xDoc and its type.

When I looked at the web method definition in the external system the data type is XML. I have a sample of the XML request.

Now how do I invoke this method ?

public class AuxTableAdministration {
    public class AUXTableAdministrationResult_element {
        private String[] apex_schema_type_info = new String[]{'http://webcominc.com/','true','false'};
        private String[] field_order_type_info = new String[]{};
    }
    public class AUXTableAdministrationResponse_element {
        public AuxTableAdministration.AUXTableAdministrationResult_element AUXTableAdministrationResult;
        private String[] AUXTableAdministrationResult_type_info = new String[]{'AUXTableAdministrationResult','http://webcominc.com/',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://webcominc.com/','true','false'};
        private String[] field_order_type_info = new String[]{'AUXTableAdministrationResult'};
    }
    public class AUXTableAdministration_element {
        public String userName;
        public String password;
        public String action;
        public String tableName;
        public AuxTableAdministration.xDoc_element xDoc;
        private String[] userName_type_info = new String[]{'userName','http://webcominc.com/',null,'0','1','false'};
        private String[] password_type_info = new String[]{'password','http://webcominc.com/',null,'0','1','false'};
        private String[] action_type_info = new String[]{'action','http://webcominc.com/',null,'0','1','false'};
        private String[] tableName_type_info = new String[]{'tableName','http://webcominc.com/',null,'0','1','false'};
        private String[] xDoc_type_info = new String[]{'xDoc','http://webcominc.com/',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://webcominc.com/','true','false'};
        private String[] field_order_type_info = new String[]{'userName','password','action','tableName','xDoc'};
    }
    public class xDoc_element {
        private String[] apex_schema_type_info = new String[]{'http://webcominc.com/','true','false'};
        private String[] field_order_type_info = new String[]{};
    }
    public class WsSrvSoap {
        public String endpoint_x = 'https://sandbox.webcomcpq.com/wsAPI/wssrv.asmx';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://webcominc.com/', 'AuxTableAdministration'};
        public AuxTableAdministration.AUXTableAdministrationResult_element AUXTableAdministration(String userName,String password,String action,String tableName,AuxTableAdministration.xDoc_element xDoc) {
            AuxTableAdministration.AUXTableAdministration_element request_x = new AuxTableAdministration.AUXTableAdministration_element();
            request_x.userName = userName;
            request_x.password = password;
            request_x.action = action;
            request_x.tableName = tableName;
            request_x.xDoc = xDoc;
            AuxTableAdministration.AUXTableAdministrationResponse_element response_x;
            Map<String, AuxTableAdministration.AUXTableAdministrationResponse_element> response_map_x = new Map<String, AuxTableAdministration.AUXTableAdministrationResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://webcominc.com/AUXTableAdministration',
              'http://webcominc.com/',
              'AUXTableAdministration',
              'http://webcominc.com/',
              'AUXTableAdministrationResponse',
              'AuxTableAdministration.AUXTableAdministrationResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.AUXTableAdministrationResult;
        }
    }
}


The 'required'  attribute in <apex:selectlist> tag is not functioning. Is there a way around to make it required?

 

<apex:pageBlockSectionItem id="placSecItem">             

<apex:outputLabel for="type">Contact Record Type</apex:outputLabel>             

<apex:selectList value="{!recordTypeId}" required="true" multiselect="false" id="type" size="1" onchange="changeRecordType()">               

<apex:selectOptions value="{!items}"/>             

</apex:selectList>             

</apex:pageBlockSectionItem>

Hi All,

 

My salesforce org is integrated with a third party tool. I need to pass the contact Id to a given URL or external script on create or update of contact.

 

Below is the link. Unavailable currently.

http://www.metricmill.com/tool/inc/employee_integration.php?process=create&sfgdc_employee_id=[INJECTION-PARAMATER-OF-SFDC-CONTACT-ID]

 

Any ideas or solutions to implement this. If I have to write apex script how can i invoke.

 

 

I want to render a section in detail page layout based on a field. How can I accomplish this task?.

 

Appreciate your help.

Here is my requirement. In contract I have an end date field. On the last date of expiry If the other field renewal is set true the contract end date should be extended by an year.

 

My question is using a custom formula field TODAY() will that fire an update trigger or workflow action everyday so I can check whether te contract expires today.

 

I am sorry If I am stupid. 

Hi All,

 

Require your expert advise on this.

 

When I create/edit a lead record and click on save I want to open the lead conversion page in a new window if the  picklist Lead Status = 'Qualified'. The main aim is to open the lead conversion page without having to click convert button.

 

Please share your thoughts on this and the best possible way to implement the same.

 

Thanks.

When I subtract (End Date - Start Date) the result is a number of days. Is there a formula to get the result in terms of months?

 

Appreciate your help.

In my controller I have an action method that returns a new pagereference. Is there a way I can add an apex message on the landing page?

 

I tried something like this which is not supported.

 

public pagereference redirect(){

 

 Apexpages.Message msg = new Apexpages.Message(ApexPages.Severity.ERROR,'Unable to create New Proof of Performance');
 Pagereference detail = new Pagereference('/'+program.Id);
 detail .addMessage(msg); // not supported
  return detail;
 }
Has anyone tried this before?

 

In my apex code, system.now() returns the current Datetime based on a GMT calendar. My aim is to get the date time value in my local time zone.Since we have day light saving, I didn't think  about manipulating the time difference.

 

I would appreciate your suggestions.

 

Under personal information, I have set the time zone as "Time Zone(GMT-05:00) Eastern Daylight Time (America/New_York)".

 

 

 

 

When I executed a batch job that processes 16M records I encountered this error.

 

First error: common.api.cursor.client.HttpCursorStoreReader$ReadFailedException: lib.http.storage.HttpFileStore$FileStoreValidationException: Cursor store returned an unexpected status code of 404. bytes=36016-39015. url=http://cs7-acs2-1-chi.ops.sfdc....

 

Can someone explain the cause of this error. Is this related with the no.of open cursors or has something to do with the number of rows retrieved.

Will QueryMore() help us retrieve more than 50000 records as against the 50000 SOQl rows apex governor limits.

 

Can anyone help me with a sample code to understand the usage. I could not find any useful reference also.

 

Appreciate your help. This is critical.

Has anyone worked with the Criteria Based Sharing Rule.

 

From the below thread, I understand it is one of the pilot program for winter '10. At DreamForce ’10 SFDC announced that this feature is coming out in Spring ’11.

http://blog.jeffdouglas.com/2009/06/29/two-new-pilot-programs-for-winter-09/#comments

 

Please share your valuable inputs on this.

Here I am iterating through a loop and creating several instance of an sObject and adding it to a list.

 

for(AggregateResult sa : salesActualList)

{

ForecastSummary forecastItems = new ForecastSummary();

forecastItems.RSC_Id = (Id) sa.get('RSC_Id');

forecastItems.RSC_Code = (String) sa.get('RSC_Code');

 

forecastItemsList.add(forecastItems);

}

 

Finally the list contains only the last added record inserted 'n' no.of times.

 

When I debug inside the for loop it shows all the records. I am wondering why this is happening.

 

There is no issue with the declaration here as it is declared as a class variable.

 

 

Appreciate your help.

I have a Hierarchy Custom setting with one field IsProcessed.

 

My batch apex will run only when the value of  IsProcessed is true. After processing I need to update the value to false. I doubt whether it is possible.

 

Is there a way I can update a custom setting field value using apex.

 

Appreciate your help.

Hi All,

I am using Continuation for a callout in a VF page. I am getting a blank response body with StatusCode=400 . When i call the same service using normal HttpRequest, i am getting the proper response. Did any one came across a similar situation? Please help me resolve this error.
public object startLandAServiceRequest(){
	Continuation con = new Continuation(60);
	try{
		con.continuationMethod = 'processResponse';
		HttpRequest request = new HttpRequest();
		request.setMethod('GET');
		request.setEndpoint('xxxx');
		request.setClientCertificateName('xxxx');
		request.setHeader('Content-type','text/xml');
		request.setBody('xxxx');
		this.requestLabel = con.addHttpRequest(request);
        }catch(Exception e){
			isError = true;
			errorString = e.getMessage();
            System.debug(e.getStackTraceString());
        }
	return con;
}
public object processResponse(){
	HttpResponse response = Continuation.getResponse(this.requestLabel);
        result = response.getBody();
        return null;
}



Best,
NHK
  • December 04, 2015
  • Like
  • 0
I've started dabling in Lightning Components and worked through a tutorial last year and have done one of the trailheads a few days.  So I know how to code basic Lightning components and apps.  And I see in the metadata that these become AuraDefinitionBundles.  I also so an example of some code where a bit of JS is added to an empty VF page and that always a Lightning Component to be spun up inside a VF page.

What I want to do is take an exist VF page that is exposed to the internet as a SF "Sites" application and port it to Lightning.  What I included in the prior paragaph leads me to believe the page is codable.  Here's what I don't know.  When a Sites application is configured, you have to tell it what it has access to-- VF pages, Apex controllers, objects and fields, etc.  I don't know how you would give it access to the Aura bundle.  (Unless it's totally implicit and you don't have to and it automatically gets acces.)

Can anyone address the question of how to configure and deploy Sites application that includes a VF page that spins up an Lightning Component?
 

Hi All,

 

My salesforce org is integrated with a third party tool. I need to pass the contact Id to a given URL or external script on create or update of contact.

 

Below is the link. Unavailable currently.

http://www.metricmill.com/tool/inc/employee_integration.php?process=create&sfgdc_employee_id=[INJECTION-PARAMATER-OF-SFDC-CONTACT-ID]

 

Any ideas or solutions to implement this. If I have to write apex script how can i invoke.

 

 

Here is my requirement. In contract I have an end date field. On the last date of expiry If the other field renewal is set true the contract end date should be extended by an year.

 

My question is using a custom formula field TODAY() will that fire an update trigger or workflow action everyday so I can check whether te contract expires today.

 

I am sorry If I am stupid. 

Hi All,

 

Require your expert advise on this.

 

When I create/edit a lead record and click on save I want to open the lead conversion page in a new window if the  picklist Lead Status = 'Qualified'. The main aim is to open the lead conversion page without having to click convert button.

 

Please share your thoughts on this and the best possible way to implement the same.

 

Thanks.

I need a region formula based off states and countries, but for New York and New Jersey it is also based of the account name that starts with #-J and K-Z?  Here is what im working with, but i know its not right.The bold area is what needs to be fixed. Any help would be amazing.

 

IF(LEN(BillingState)=0, "None",
IF(CONTAINS("WA:OR:CA:AZ:NM:TX:HI:AK", BillingState), "West",
IF(CONTAINS("ID:NV:UT:MT:WY:CO:ND:SD:NE:KS:OK:MN:IA:MO:AR", BillingState), "Central",
IF(CONTAINS("LA:TN:MS:AL:FL:GA:SC:NC:VA:WV:DC:MD:DE:PA", BillingState), "Southeast",
IF(CONTAINS("PR", BillingCountry), "Great Lakes",
IF(CONTAINS("WI:IL:MI:IN:KY:OH", BillingState), "Great Lakes",
IF(CONTAINS("NY:NJ", BillingState), "East",
IF( BEGINS(Name, "A, B, C, D, E, F, G, H, I, J"), "East 1",
IF( BEGINS(Name, "K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z"), "East 2",
IF(CONTAINS("AD:AL:AT:BA:BE:BG:BY:CH:CZ:DE:DK:EE:ES:FI:FO:FR:FX:GB:GI:GR:HR:HU:IE:IS:IT:LI:LT:LU:LV:MC:MD:MK:MT:NL:NO:PL:PT:RO:SE:SI:SJ:SK:SM:UA:VA:CS:UK", BillingCountry), "East",
IF(CONTAINS("CA:JM", BillingCountry), "Central",
IF(CONTAINS("CT:RI:MA:NH:VT:ME", BillingState), "New England", "Other"))))))))))))

I am trying to do a simple subtraction formula for calculating a duration date using

 

Project_End_Date__c - Project_Start_Date__c

 

I get the following error:

Error: Formula result is data type (Number), incompatible with expected data type (Date).

 

What am I doing wrong?

Hi All,

 

I need help with creating a custom link on user, which would copy over the existing user record's profile and role in a new page, where i would fill the rest of the details and save it to create a new user.

 

I tried using this link : /{!User.Id}/e?clone=1&retURL=%2F{!User.Id}&isdtp=mn

 

But this copies all the fields, whereas i need just the profile and role to copied over.

 

Please let me know.

 

Thanks

Hi Y'all, Is it possible to have a criteria based sharing rule which references the current user id? For example we have an custom object, called events, and we would like the presenters to only see the events they are running. I have had a look at the criteria based sharing, but have not been able to reference the current user id to achieve this. Any ideas? Thanks in advance :)

Hi All,

 

We are having one custom object called 'XXX'. We are creating new XXX object record depending on certain conditions when we update opportunity using trigger.

 

When we create custom object record on updating of Opportunity, we want to redirect the page to the new custom object record not to the Opportunity.

 

Please let me know how we can do this.

 

Thanks,

Sapna

In my controller I have an action method that returns a new pagereference. Is there a way I can add an apex message on the landing page?

 

I tried something like this which is not supported.

 

public pagereference redirect(){

 

 Apexpages.Message msg = new Apexpages.Message(ApexPages.Severity.ERROR,'Unable to create New Proof of Performance');
 Pagereference detail = new Pagereference('/'+program.Id);
 detail .addMessage(msg); // not supported
  return detail;
 }
Has anyone tried this before?

 

java.lang.IllegalArgumentException: Illegal view ID No Action. The ID must begin with / 

 

I am not able to figure out what does this error mean.... can i get some help on it....

Hi,

 

I'm trying to use Roles with Apex Managed Sharing, but I'm running in to a problem.  The documentation and example for Apex Sharing Rules implies that we can use Roles to populate the UserOrGroupId field on a sharing object, but I'm getting an error when I use an Id I derive from the UserRole object:

 

FIELD_INTEGRITY_EXCEPTION, User/Group ID: id value of incorrect type

 

In a nutshell, I've created an Apex class that is used to manage sharing on a custom object we have (Object B).  Object B is related to an Account.  I'm grabbing the account id and then using that to find any Customer Portal Roles (UserRoles object, these are created automatically when you create a portal user) associated to that account.  I then take the Id from the UserRole object and use it to populate the UserOrGroupId field on my ObjectB__Shares record.

 

Can I not use Roles with Apex Managed Sharing or am I doing something wrong?  Here's the relevant code (slightly modified to protect the innocent):

 

 

//Now that you have all the account ids, get the corresponding portal user roles
            Set<ID> allPortalRoleIDs = new Set<ID>();
            for(UserRole ur: [Select Id, Name From UserRole Where PortalAccountId in: allRelatedAcctIDs])
            {
                allPortalRoleIDs.add(ur.Id);
            }
            
            //Now that you have all the relevant Portal User Roles, populate the shares
            if(allPortalRoleIDs != null && allPortalRoleIDs.size() > 0)
            {
                for(ObjectB__c b: ForClientOnly)
                {
                    for(ID roleId : allPortalRoleIDs)
                    {
                        
                        ObjectB__Share bs = new ObjectB__Share();
                        bs.ParentID = b.id;
                        bs.UserOrGroupID = roleId;
                        bs.AccessLevel = 'read';
                        bs.RowCause = Schema.ObjectB__Share.RowCause.portal_access__c;
                        
                        allShares.add(bs);
                    }
                }
            }

            //Once you have all the Shares, insert them
            insert allShares;

 

Any thoughts?
Thanks in advance!

 

 

Hello,

 

          I have a custom button on a object which open a visual force page pop-up.

Can some body please help me or let me know. Is there any way I can close the window thorough the controller itself.

 

As I Do have validation in which if the data inserted is correct. The windows will close and save the data. And if the data is incorrect the class return a error message. If I write a Ajax close whenever the the call come back with message it close the window without showing the message.

 

Please help me and let me know if we can close the window in apex class (Controller) ???

Hi,

Does any1 have any idea about limitations of the things that can be done from an action method in an apex:page tag

I have an action method in apex:page tag which redirects user to another VF page but its not working.

What I observed that the VF page redirected to other VF page only when the controller of the other VF page was different than its own but when I redirected to a VF page having the same controller its just dint do it!!

 

I also tried it by switching off the development mode but it dint work. Has nay1 faced any such kind of issue & if so how can some1 resolve it!!

 

Please check code here.

Hi,

I want to do salesforce certification Dev 401 and DEV 501. We are partners of Salesforce, so can anybody tell me the exact price of the certification ?

Any pointers on these is highly appreciated.

Thank You,
Yash
Hi everyone.  

   Is there a Apex class method to get current Salesforce.com instance or URL at runtime?

I want to generate hyperlinks like https://na4.salesforce.com/{accountId} in code.  But I don't want to hard code 'na4'.

Every time I deploy the same code back to Sandbox, I must fix the instance manually.

Thanks in advance.


  • August 04, 2008
  • Like
  • 0