• NOTSOFAST
  • NEWBIE
  • 25 Points
  • Member since 2007

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

We have a situation where we are requiring to call a function from custom button OnClick Javascript.  The function is located in utility class we created.

 

 

Whenever the button is pressed, we get a message stating that 'SysUtil is not defined'. SysUtil is the class we created.

 

I am assuming either I am just not using the proper sytax (very likely as I am very new to this langauge, and to Java as well) or its just not possible.  Any help is greatly appreciated.

 

 

 

{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")}

var recordsId = {!GETRECORDIDS( $ObjectType.Address__c )};
var GetUserInfoResult=sforce.connection.getUserInfo();


if(recordsId[0] == null)
{
    if (GetUserInfoResult.userLanguage == 'fr') {
        alert('SVP faites une sélection');
    }
    else
    {
        alert("Please select at least one address record to create a new pickup request.")
    }
}

else if(recordsId.length > 1){
    if (GetUserInfoResult.userLanguage == 'fr')
    {
        alert('Pour cloner une adresse, SVP faites seulement une sélection.');
    }
    else
    {
        alert("Please select only one address record to create a new pickup request.")
    }
}


else if(SysUtil.isAddressScheduledForDeletion(recordsId[0]))
{
alert('This address cannot be used to create a pickup request as it is marked for deletion. Please choose another.');
}


else
{
parent.window.location.href = '/apex/vf_pickupRequest?addressid='+recordsId;
}

I have an approval process set up for a custom object with that has two record types. The approval process only applies to one of the record types so I have set up the entry criteria to key on $RecordType.DeveloperName. Unfortunately the approval process engine appears to only see nulls in this field (according to the debug log). Works fine when I use $RecordType.Name but since the application is intended to be used in a multi-language environment I would prefer using DeveloperName.

 

Anyone have any insight into this problem?

 

 

 

 

We have a situation where we are requiring to call a function from custom button OnClick Javascript.  The function is located in utility class we created.

 

 

Whenever the button is pressed, we get a message stating that 'SysUtil is not defined'. SysUtil is the class we created.

 

I am assuming either I am just not using the proper sytax (very likely as I am very new to this langauge, and to Java as well) or its just not possible.  Any help is greatly appreciated.

 

 

 

{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")}

var recordsId = {!GETRECORDIDS( $ObjectType.Address__c )};
var GetUserInfoResult=sforce.connection.getUserInfo();


if(recordsId[0] == null)
{
    if (GetUserInfoResult.userLanguage == 'fr') {
        alert('SVP faites une sélection');
    }
    else
    {
        alert("Please select at least one address record to create a new pickup request.")
    }
}

else if(recordsId.length > 1){
    if (GetUserInfoResult.userLanguage == 'fr')
    {
        alert('Pour cloner une adresse, SVP faites seulement une sélection.');
    }
    else
    {
        alert("Please select only one address record to create a new pickup request.")
    }
}


else if(SysUtil.isAddressScheduledForDeletion(recordsId[0]))
{
alert('This address cannot be used to create a pickup request as it is marked for deletion. Please choose another.');
}


else
{
parent.window.location.href = '/apex/vf_pickupRequest?addressid='+recordsId;
}

i am a salesforce admin brand new to development, and i want to programatically share accounts using apex.  What i am trying to accomplish is automatically share parent accounts with the child account owner, as my org has a private sharing model and right now i have to share each one manually as needed.  if anyone can help me out with some sample code to get started, i will be very greatful.

Hi,

 

Is there a way to put method X in a separate class and have multiple triggers call it? This is as opposed to hardcoding X in each trigger that requires it. If this is possible please let me know how I should go about it.

 

Thanks.

Message Edited by asadim on 09-08-2009 01:48 PM
  • September 08, 2009
  • Like
  • 0

What I am trying to do is determine if a Lead or Contact exist and they don't then add them as a new Lead.

 

Here is the Apex Class

 

global class getcontactinfo {

 Webservice static Contact getcontactemail(string Contact) {
 contact c = [Select Phone,Email from Contact where Email = :Contact];
 
    return c;
}
}

 

 

So what I am doing to calling this global class from within ASP.net VB.

 

If the users e-mail does not exist it is giving me this error : System.QueryException: List has no rows for assignment to SObject.

 

If the users e-mail does exist then I am getting this error : System.QueryException: List has more than 1 row for assignment to SObject

 

I need to get a value passed back to my ASP.net page so that I can either add them using the Web2Lead or not add them as a lead cause there e-mail exist already.

 

 

 

  • September 08, 2009
  • Like
  • 0
Does salesforce Apex support iterating over a map using a for loop?

Hi there everyone.

 

Does anyone know of a way of detecting if the user is a system administrator?

I tried by comparing the user's profile name but I think this changes with the language and need multilanguage support.

 

Any ideas?

Thanks!