• ThomasTT
  • SMARTIE
  • 780 Points
  • Member since 2009

  • Chatter
    Feed
  • 29
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 241
    Replies
For example if you are using a visual flow to do some data maintenance task - e.g. updating contact details.


You want to ask the user to update fields like the Department, but you want to default the choice to display the existing value from the contact record.

At the moment you can only default it to a static choice.  I would like to be able to default it to the value of a lookup variable, so that the user can see the department is currently 'Sales' or whatever.

(The workaround I have found so far is to have n versions of the screen - with each one having the department defaulting to one of the n possible values - i.e. one for 'Sales', one for 'Finance', etc.  and a decision step to decide which screen to show. This is 'ok' for a small number of choices, but un-manageable for picklists with more than a few options)

 

(NB - this is a copy of an Idea that I created earlier https://sites.secure.force.com/success/ideaView?id=08730000000ihzjAAA)

Hello

          I am trying to create a date time picker in visualforce page but i unable to create it. As i try it in simple html it is quite easy .

Any suggestion regarding this will be helpful for me and if possible give me some basic code to create it.

 

Thanks...

I need your help. I've a subquery and Im' trying to display it in a visualforce page without any results:

 

My Class:

 

 

	public List<SObject> getOpen()
		{
	
		SObject[] Cuenta = [SELECT Name, 
		         (Select Subject, WhoId, WhatId, Id, IsTask, ActivityDate, Status, Priority, OwnerId FROM OpenActivities  
		          WHERE OwnerID =:USER_ID ORDER BY ActivityDate ) 
		          From Account WHERE id=:RECORD_ID];
		Actividades = Cuenta.get(0).getSObjects('OpenActivities'); 
                //This is just to verify the Actividades list
		for(Integer i=0; i<Actividades.size(); i++)
			{
			System.debug('********Sobject'+Actividades[i]);
			}
		return Actividades;
		}		

 

In my page I want to display the Subject, WhoId, WhatId, etc.

 

If I put:

 

 

	<apex:pageBlock title="Actividades Abiertas" >    
		<apex:dataTable value="{!Open}" var="each" cellpadding="10" border="0" styleClass="list">
			<apex:column headerValue="Acción">{!each}</apex:column>
	</apex:pageBlock>

 

 

I have my 5 id's open activities without a problem.  But if I put:

 

 

	<apex:pageBlock title="Actividades Abiertas" >    
		<apex:dataTable value="{!Open}" var="each" cellpadding="10" border="0" styleClass="list">
			<apex:column headerValue="Acción">{!each.Subject}</apex:column>
	</apex:pageBlock>

 

 

I've got an error ' SObject.Subject Property Unknown'

 

In my debug log I have my list with all the data

 

 

11:10:0.928|USER_DEBUG|[44,4]|DEBUG|********SobjectOpenActivity:{Status=No iniciada, AccountId=001R000000QAo87IAD, WhatId=001R000000QAo87IAD, Subject=Llamada, WhoId=003R000000MurqIIAR, OwnerId=005400000010CwqAAE, IsTask=true, Id=00TR0000008DY1OMAW, ActivityDate=2010-04-09 00:00:00, Priority=Normal}

11:10:0.931|USER_DEBUG|[44,4]|DEBUG|********SobjectOpenActivity:{Status=No iniciada, AccountId=001R000000QAo87IAD, WhatId=a0BR0000002ppkaMAA, Subject=Enviar Encuesta, WhoId=003R000000MurqIIAR, OwnerId=005400000010CwqAAE, IsTask=true, Id=00TR0000008DiZNMA0, ActivityDate=2010-04-26 00:00:00, Priority=Normal}

11:10:0.933|USER_DEBUG|[44,4]|DEBUG|********SobjectOpenActivity:{Status=No iniciada, AccountId=001R000000QAo87IAD, WhatId=001R000000QAo87IAD, Subject=Generar Reporte, WhoId=003R000000MurqIIAR, OwnerId=005400000010CwqAAE, IsTask=true, Id=00TR0000008DY2nMAG, ActivityDate=2010-04-28 00:00:00, Priority=Normal}

11:10:0.936|USER_DEBUG|[44,4]|DEBUG|********SobjectOpenActivity:{AccountId=001R000000QAo87IAD, WhatId=a0BR0000002ppkaMAA, Subject=Reunión, WhoId=003R000000MurqIIAR, OwnerId=005400000010CwqAAE, IsTask=false, Id=00UR0000004Y5fYMAS, ActivityDate=2010-07-20 00:00:00}

11:10:0.939|USER_DEBUG|[44,4]|DEBUG|********SobjectOpenActivity:{AccountId=001R000000QAo87IAD, WhatId=001R000000QAo87IAD, Subject=Reunion, WhoId=003R000000MurqIIAR, OwnerId=005400000010CwqAAE, IsTask=false, Id=00UR0000004Y5cFMAS, ActivityDate=2010-10-19 00:00:00}

 

 

 

 

Hi,

 

I am spending alot of time to figure out how to construct the query to get the result I want in SafesForce, but no luck. 

What I have it

1. From Account, I created an Opportunity.

2. From Opportunity, I created a Case.

3. From Case, I create mutilep Tasks associated with the case.

 

The result I try to escomblish is listing these fields:

Account, Opportunity, Case, and Tasks.

Account#1, Opt# 1, Case# 1, Task#1

Account#1, Opt# 1, Case# 1, Task#2

Account#1, Opt# 1, Case# 1, Task#3

Account#2, Opt# 2, Case# 2, Task#4

Account#2, Opt# 2, Case# 2, Task#5

 

I have put together this query, but it only show Account.Name, Opportunity, and Case,  Tasks are not show up since they are not tied to Case (if I created Task from Account, then it will show up in this query, but I need to create it from Case).

 

select account.Name, (select Opportunity.Name from Account.Opportunities),  (Select CaseNumber from Cases), (select Task.Subject from Tasks)  from Account

 Any advice would be appreciated.

 

Thanks,

I need to determine whether a user has write access to a given SObject record. There are a couple ways I know to do this, both with distinct downsides. First, I can simply do a try/catch update on the record, but that changes the last-modified date, and has some other issues with security in a managed package.

 

Second, I can crawl the SObject__Share object, and figure things out from there. The problem there, I discovered, is that once you reference an xxx__Share object in Apex, you can no longer change the sharing rules for that xxx object. It complains "Unable to change sharing model because sharing objects are referenced by the following components: Apex.cls"

 

I saw in a thread from over a year ago that SF recognized a need for this. Has it been included in the platform yet?

 

Thanks. 

Hi everyone i have a list in my Apex class which has soql query result..

        

String query = 'SELECT  City,Latitude__c FROM Lead WHERE City LIKE \''+city+'%\'';
       
        leadrecords = Database.query(query);   

 

Eg :in the above line leadrecords is alist of lead type

 

    private List<Lead> leadrecords;

 

So now iam trying to pass this list to ajavascript variable so dat javascript variable should have query  output...but when i have done like this iam able to pass the list but when iam tryong to display that it is displaying the  ids  but i want to display the field city and latitude which are storesd in that list how to do it please someone help me with the solution... to javascript variable so how to pass this list to javascript variable

  

I want to add the Loading animation to all of my buttons while salesforce is thinking but hasn't processed and loaded the next page:

 

Just like when you Click save on a case, Upload an attachment, etc.

I know I know, another dumb question.

 

From another system, I get a string that represents a date, ex 03211988, which means March 21, 1988. How to I convert that string into a salesforce date object? I tried the .parse function, but that needs the / to be included in the string, which are not. I suppose I could do a bunch of string manipulation to insert the / but that seems fairly hackish. Any other more elegant ideas?

I'm new to visualforce and I've got a custom object, Property__c with a multi-select picklist of classifications (Classification__c). How can I put those picklist values onto a visualforce page with a custom controller? And how do I retrieve the value(s) for use in a query?
Message Edited by ethanone on 03-26-2010 10:22 AM

Hi

 

I have a method in the controller to delete a record when i click on a apex:outputLink   ,but before i delete a record i have to ask for a confirmation using javascript ,How can i call a apex method from a javascript using the user in put if the user says yes it should execute otherwise it should not execute at all .

 

Regards

Vinayak sharma

I have created a custom object that operates similiar to the Account Contact role object.

 

What is want the code below to do is to make sure that only one record can be marked as Primary at time.

I a user updates a record and marks it as Primary the trigger code will in turn find other records where Primary is equal to true and will change it to false.

 

I get the following error implement the trigger code as shown below

Developer script exception from 'test' : AccountContactRole_SetPrimary : AccountContactRole_SetPrimary: execution of BeforeUpdate caused by: System.SObjectException: DML statment cannot operate on trigger.new or trigger.old Trigger. AccountContactRole_SetPrimary: line 17, column

 

trigger AccountContactRole_SetPrimary on Account_Contact_Role__c (after update) { // Validate if the Primary and the combination of the contact and the role is not duplicated for the relevant account List <Account_Contact_Role__c> acrList = new List<Account_Contact_Role__c>(); for (Account_Contact_Role__c acr: Trigger.New){ Id CurrentId = acr.Id; if (acr.Primary__c == true){ for (Account_Contact_Role__c acrP : [SELECT Id FROM Account_Contact_Role__c WHERE Id !=: acr.Id and Primary__c = true]){ acrP.Primary__c = false; acrList.add(acr); } } } if (!acrList.isEmpty()){ update acrList; } }

 

 

 

I'm a bit stumped on this. I've created a managed package which includes a hierarchical custom setting at the org level. This is then used in custom formula fields. All works well if you view the pages as a system administrator, but if you login as a standard user all you see is #Error!

I've checked and the fields are set as visible and read only, and the the standard user is set to view the correct page layout. The formula fields display fine if I replace the custom settings part with a string, and of course work fine for sys admins. Where else should I look to make sure standard users have access to this data?

Many thanks!

I have the code below in an Apex test prior to Test.startTest().  I would have thought that this would bump the query rows by at most one row but it doesn't; it bumps the query rows by 201.  That statement gets executing a few times and I exceed the 500 query row limit.   In and RDBS, that query would return exactly 1 row.  What's going on?  Does it count every row scanned even though one value gets returned?  That would mean you could never execut select count() from account if you have more than 10,000 accounts.

 

 

                               Select count()
                              From AccountShare 
                              where Account.Office_Front_or_Back__c = 'Front Office'
                              and UserOrGroupId in :groupList
                              and Account.enrollment__c >= 5
                              and Account.enrollment__c <= 650 limit 201]

I am creating a visualforce page that will live in a section on the contact page.  I am trying to get the page to redirect to an external site, but the entire contact page ends up getting redirected.  I used to be able to do this easily with S-controls, but I'm running into issues using visualforce.  My code is as follows:

 

 

<apex:page StandardController="Contact" extensions="pamExt" action="{!getRedir}" > </apex:page>

 

 where as you may have been able to guess getRedir returns a url.  Can anyone explain to me why this redirects the entire Contact page and maybe give a way that I can fix this so only this vforce page gets redirected?

Thanks

 


first of all, can any body explain/show the steps on how to post a screenshot as part of the message on this community. i can see people doing this but i am unable to do so.

 

anyway i try to explain in words:

 

i am trying to display an error message

 

 

 

<apex:inputText value="{!subject}" id="Subject" maxlength="80" required="true" id="Subject_Validation"/>

<apex:message for="Subject_Validation" styleClass="locationError" />

 

 it works fine but i am getting it in Awkward format  - why j_id0:j_id2:j_id11:

 

j_id0:j_id2:j_id11:Subject_Validation: Validation Error: Value is required.

 

its same for IE/Mozilla.

 

any suggestion where i am wrong.

 

 

 

We have overidden our new and edit buttons for Cases to go to a custom visualforce page.  This was fine until now we want to utilize Record Types.  Now, regardless of the record type chosen, new cases go to the custom visualforce page instead of the page layout for the record type.  I am thinking that I need another VF page to act as a proxy to route the user to the correct page.  I have read a couple of forum posts but am unsure if they are applicable to my problem.

 

http://forums.sforce.com/sforce/board/message?board.id=Visualforce&thread.id=4875