• kMans2k
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies
Hello all,
 
I have a s-control that brings-up a new html page when the corresponding button is pressed.
 
The Html page displays some details of a custom Salesforce Object using the onload event. It also contains a delete button that I am attempting to use to delete a custom Salesforce Object. Following is my code with irrelevant parts removed. If I have the code for "deleteForm" in, the page fails to load information about the object. If I don't, it does. This leads me to believe that something is wrong with the "deleteForm" code. Any help please?
 
<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/11.0/connection.js"></script>
<script src="/soap/ajax/11.0/apex.js"></script>
<script type="text/javascript">
 
deleteForm()
{
  if( formId != "" ) {
 String[] ids = new String[] { formId };
 try {
   DeleteResult[] deleteResults = sforce.connection.delete(ids);
 }
 catch( Exception e ) {
 }
  }
}
 
loadForm()
{
  var conn = sforce.connection;
  var qr = conn.query("Select Id....");
  var record = qr.getArray("records");
  formId = record[0].get("Id");
}
 
<body>
.....
<input type="button" name="deleteForm" value="Delete Form" onclick="deleteForm()" />
</body>
hey all,
 
excuse the pun.
 
I have a custom object FormA__c, which has a status field, Status__c.
 
What I would like to do is for the system to throw an error when the user first creates this object and chooses the status as something other thans "Status1".
 
In my trigger (trigger on before insert) I have the following code:
 
FormA__c[] Current = Trigger.new;
if( Trigger.isInsert ) {
 if( Current[0].Status__c != 'Open' ) {
   trigger.new.Status__c.addError('Status error');
 }
  }
 
Apex editor is complaining about the "trigger.new.Status__c.addError('Status error');" line:
Error: Compile Error: Initial term of field expression must be a concrete SObject: LIST:SOBJECT:FormA__c at line 8 column 7
 
if I change it to:
   trigger.new.addError('Status error');
 
It reports the following error:
Error: Compile Error: Method does not exist or incorrect signature: [LIST:SOBJECT:FormA__c].addError(String) at line 8 column 7
 
your help is much appreciated.
Hello all,
 
I have tried the folllowing code to pass some input via the URL to autofill entries. When I click the button, Salesforce complains of a syntax error. The button is placed on the detail page for ObjA.
Being a newbie, I cannot spot anything. I am hoping an experienced eye will do so:
 
<script language="JavaScript">
function redirect() {
parent.frames.location.replace("/006/e?retURL=%2F{!customObjA__c.Id}&opp3={!customObjA__c.Name}" );
}
redirect();
</script>

Hello All,

I hope this is the correct forum.

I relatively new to Apex and needing some help achieving this particular task.

I have two custom objects. Call these ObjA and ObjB. ObjB is related to ObjA, and has a look-up field to reference the related ObjA. It has another picklist, say "country". ObjA also has the "country" picklist.

Now when the user chooses to create the related ObjB from the ObjA details page, salesforce automatically populates the reference to ObjA in the ObjB data entry form. Is it possible for me auto-select the "country" picklist in ObjB data entry form based on the related value in ObjA?

Secondly, there's a third custom object, ObjC. I'd like the users to be taken to the data entry form to create new ObjC, if they select "US" in the picklist in ObjB and save ObjB. It'll have to be in the trigger condition, but I unsure as to how to initiate "create new object" screen.

Hope this is not as confusing as it seems to me :) I look forward to your responses and if I do manage to get it solved, I'll post the solution for future ref.

Thanks

Hi,
I've never created a custom button, and I have created 3 different objects (Listing, offer and closing) I'd like to be able to convert the listing into an offer and then the offer into a closing. Something similar as the standard convert objects in leads and opportunities. Any ideas on how I could do it?
 
Thanks in advance,
 
Adriana.
Hello all,
 
I have tried the folllowing code to pass some input via the URL to autofill entries. When I click the button, Salesforce complains of a syntax error. The button is placed on the detail page for ObjA.
Being a newbie, I cannot spot anything. I am hoping an experienced eye will do so:
 
<script language="JavaScript">
function redirect() {
parent.frames.location.replace("/006/e?retURL=%2F{!customObjA__c.Id}&opp3={!customObjA__c.Name}" );
}
redirect();
</script>

Hello All,

I hope this is the correct forum.

I relatively new to Apex and needing some help achieving this particular task.

I have two custom objects. Call these ObjA and ObjB. ObjB is related to ObjA, and has a look-up field to reference the related ObjA. It has another picklist, say "country". ObjA also has the "country" picklist.

Now when the user chooses to create the related ObjB from the ObjA details page, salesforce automatically populates the reference to ObjA in the ObjB data entry form. Is it possible for me auto-select the "country" picklist in ObjB data entry form based on the related value in ObjA?

Secondly, there's a third custom object, ObjC. I'd like the users to be taken to the data entry form to create new ObjC, if they select "US" in the picklist in ObjB and save ObjB. It'll have to be in the trigger condition, but I unsure as to how to initiate "create new object" screen.

Hope this is not as confusing as it seems to me :) I look forward to your responses and if I do manage to get it solved, I'll post the solution for future ref.

Thanks