• Ivana Miserda
  • NEWBIE
  • 40 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 6
    Replies
Hi all, I wanted to get your suggestion on how to avoid JS in buttons. There are few scenarios where JS is used:
1) to invoke WebService
2) to update the current record 
3) to redirect to visualforce page

All this is done with some conditions prior to execution. For example 
if (account.status =='Ready')

Any suggestion/help much appreciated! 
I have a record that currently has Status__c='Draft'
When I click the Start button, i want status to change to 'In Progress'
I have used following JS code to achieve this
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 

var p = new sforce.SObject('Product_Order__c'); 
p.id = "{!Product_Order__c.Id}"; 
p.Status__c = "In Progress"; 
result = sforce.connection.update([p]); 
location.reload(true);

But, in Apex Trigger, I want to do some complex stuff when status changes from Draft to In Progress.
In my afterUpdate event, I am hooking on 

        Product_Order__c newPO = (Product_Order__c)o;
        Product_Order__c oldPO = (Product_Order__c)o;
        system.debug(newPO.Status__c);
        system.debug(oldPO.Status__c);
        if (newPO.Status__c.equals('In Progress') && newPO.Status__c != oldPO.Status__c)
            newInProgressPO.put (newPO.Id, newPO.RecordType.Name);

However, these two User Debugs show that both old and new statuses are 'In Progress' so my Map is always empty.

Does anybody have any ideas?
Hi all,
I would like to get your opinion on this object and its purpose. More precise, my client is looking at way for user to be able to enter comments for certain record (for example Order - if a field changed, user would enter details like 'Client doesn't like new image', or 'Client happy with images but not with colour'), to be able to categorise those comments (category- Client happy, Client furious,...), and to trigger tasks of these comments.

We are looking at using standard Salesforce and only logical would be Event object but that's not actually its purpose. I am more leaning to an idea to create new custom object for this purpose.

Happy to hear any input. Thank you
I am getting this error on the following line

CaseShare sharingForCase = new CaseShare();
sharingForCase.UserOrGroupID = sm.User__c;
sharingForCase.CaseId = singleCase.Id;
sharingForCase.CaseAccessLevel = 'Read';

where sm is a record of a custom object, and User__c is a lookup field to User.
Since I know you can actually create new CaseShare records and define for which user, does anybody have an ides/experience why this would cause an error?
Thank you in advance!
Hi,

Under Data.com Administration i don't see new beat feature Duplicate Managment, what could be the problem?
I have a record that currently has Status__c='Draft'
When I click the Start button, i want status to change to 'In Progress'
I have used following JS code to achieve this
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 

var p = new sforce.SObject('Product_Order__c'); 
p.id = "{!Product_Order__c.Id}"; 
p.Status__c = "In Progress"; 
result = sforce.connection.update([p]); 
location.reload(true);

But, in Apex Trigger, I want to do some complex stuff when status changes from Draft to In Progress.
In my afterUpdate event, I am hooking on 

        Product_Order__c newPO = (Product_Order__c)o;
        Product_Order__c oldPO = (Product_Order__c)o;
        system.debug(newPO.Status__c);
        system.debug(oldPO.Status__c);
        if (newPO.Status__c.equals('In Progress') && newPO.Status__c != oldPO.Status__c)
            newInProgressPO.put (newPO.Id, newPO.RecordType.Name);

However, these two User Debugs show that both old and new statuses are 'In Progress' so my Map is always empty.

Does anybody have any ideas?
I have a record that currently has Status__c='Draft'
When I click the Start button, i want status to change to 'In Progress'
I have used following JS code to achieve this
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 

var p = new sforce.SObject('Product_Order__c'); 
p.id = "{!Product_Order__c.Id}"; 
p.Status__c = "In Progress"; 
result = sforce.connection.update([p]); 
location.reload(true);

But, in Apex Trigger, I want to do some complex stuff when status changes from Draft to In Progress.
In my afterUpdate event, I am hooking on 

        Product_Order__c newPO = (Product_Order__c)o;
        Product_Order__c oldPO = (Product_Order__c)o;
        system.debug(newPO.Status__c);
        system.debug(oldPO.Status__c);
        if (newPO.Status__c.equals('In Progress') && newPO.Status__c != oldPO.Status__c)
            newInProgressPO.put (newPO.Id, newPO.RecordType.Name);

However, these two User Debugs show that both old and new statuses are 'In Progress' so my Map is always empty.

Does anybody have any ideas?
Hi all,
I would like to get your opinion on this object and its purpose. More precise, my client is looking at way for user to be able to enter comments for certain record (for example Order - if a field changed, user would enter details like 'Client doesn't like new image', or 'Client happy with images but not with colour'), to be able to categorise those comments (category- Client happy, Client furious,...), and to trigger tasks of these comments.

We are looking at using standard Salesforce and only logical would be Event object but that's not actually its purpose. I am more leaning to an idea to create new custom object for this purpose.

Happy to hear any input. Thank you