• Ashutosh Gurjar
  • NEWBIE
  • 15 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 8
    Replies
i want to update the object permission. for that i want to fetch only those object whose permission we can update.
because in object describe call only we can check object is creatable,updatable etc. there is no option for permissionable check. 
Hi ,
I am making a test class for bank management like project,,,,where on the home page i have to give username and password if they are correct the user is logged in with its complete information like his total balance ,account number,,,,so when i am putting correct username,password and calling login() method which i used for login purpose in controller,,,,the succesfull message is in assert but its not redirecting in next page
i want to update the object permission. for that i want to fetch only those object whose permission we can update.
because in object describe call only we can check object is creatable,updatable etc. there is no option for permissionable check. 
Hi All,

I have 3 objects A(grandparent), B(parent), C(grandchild). whenever grand child with type XXX is inserted or updated i want to update a field on grandparent. Pls help me with coding.

Thanks for your help.
  • October 09, 2017
  • Like
  • 0
Hi,
i am creating a new formula field with date data type.
Planned_Start_Date__c  -  Start_Date__c
Both are date fields. 
Still getting an error!!

 
I'm making my first trigger, and I think I must be missing something basic.  This is a trigger that detects whether the owner of a closed case is an omni-channel queue, and if it is it reassigns it to the last person who modified the case instead.  The ownership change happens successfully in the trigger, but isn't being applied as part of the update itself.

Simplified code:
Trigger ReassignOCClosedCases on Case (before insert, before update) {
   for (Case c : Trigger.new) {
    	//Check if the case is closed and owned by an omni-channel queue.
    	system.debug('ReassignOCCC triggered for: ' + c.Subject);  
    	if (c.Status == 'Closed') {
    		set<ID> sOCQueues = new set<ID>();
    		List<Group> gOCQueues = [SELECT ID, Name FROM Group WHERE QueueRoutingConfigID != '' ];
    		for(Group g : gOCQueues) {
			    	sOCQueues.add(g.ID);    
		}
    		//Check if the current queue is OC-controlled
    		if(sOCQueues.contains(c.OwnerID)) {
	    		// if it is, reassign to the person who last modified the case
	    		c.OwnerID = c.LastModifiedByID;
	    		system.debug('ROCCC: OwnerID is now ' + c.OwnerID);
    		}
    	}
    }
}
And a much abbreviated version of the test class:
@isTest
private class TestReassignOCClosedCases {

    static testMethod void myUnitTest() {

//Creates a queue group called gOCTestQueue, with a routing configuration and queue attached [removed for length]

        case cTestA = new case(Status ='New', Priority = 'Medium', Origin = 'Email', Subject = 'Test1 starts open then is closed', OwnerId = gOCTestQueue.ID);
        insert cTestA;

        cTestA.status = 'Closed';
        system.debug('About to update after closing.  OwnerID = ' + cTestA.OwnerID);
        update cTestA;
        system.debug('Updated after closing.  OwnerID = ' + cTestA.OwnerID);
        system.assertNotEquals(cTestA.OwnerID, gOCTestQueue.ID);
}
The debug log will then show:
|DEBUG|About to update after closing.  OwnerID = QUEUEIDSTRING and testQueueID = QUEUEIDSTRING
|DEBUG|ROCCC: OwnerID is now USERIDSTRING
|DEBUG|Updated after closing.  OwnerID = QUEUEIDSTRING
and the AssertNotEquals fails.

What am I missing here, is there a reason the record change isn't being applied as part of the update?  Thanks for your help!
 
I want to display an alert message at the instant when the checkbox is ticked. I had a VF code but the problem was- alert message display only after clicking standard save button. Plz, help me on this issue.

    <apex:page standardController="Opportunity" rendered="{!(Opportunity.Forecast_Indicator__c)}">
        <script type="text/javascript">
            window.alert("Text");
        </script>
    </apex:page>

 
Hi All 

I am trying to redirect to a different page when clicked on a button in VF page, but it is actually showing a completely BLANK page. Can anyone please HELP ..!

Thanks