• visual force.ax1886
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 2
    Replies

Can we create a User object using REST API?

The following is situation for Customer Community:
i should be able to create an External user a customer user and provide data related to him. (I have done this and its working fine)
And now this particular user should be able to add his Subordiantes as external users and access his data. We do not have to go and give access to each of his his/her sub-ordinates.

I do not know if this is possible in communities through API calling.
Let me know your comments.

 Hi,
I have to create an opportunity from Account. 
I have an Account lookup field on opportunity and also a custom field "Test" on opportunity which is also an lookup to Account.

I wrote a trigger to update the value to "Test" custom field value to default to Account look up field value on opportunity. Both show same account names. This is after i save.

But is there a way if i can show the Account value/name of lookup field  on "Test" field on EDIT Page.?? (as a default value) 

I do not know if its possible, let me know your comments and solutions.
THanks in Advance.

Hi Everyone,

 

I have Quest and charge custom objects and Have look up relationship with Quest as parent. There are multiple charges on a single quest.

 

Requirement: Update the max value of discount on charge to percentage field in Quest.

 

i have the following trigger and i got Error: "Too many SOQL's: 101 error , line16 column 1" during Apex test Execution: 

 

trigger ptd on charge__c (after insert,after update, after delete) {

list<quest> quests = new list<quest__c>();
map<ID,Decimal> m = new map<ID,Decimal>();
list<aggregateResult> s = new list<aggregateResult>();
list<Charge__c> charge = new list<Charge__c>();
list<quest__c> listtobeadded=new list<quest__c>();
List<Id> Ids = new List<Id>();


for(Charge__c q:trigger.isDelete ? trigger.Old : trigger.new)
Ids.add(q.quest__c);

quests=[SELECT Percentage__c,Id,Name,(select Id,Name,Discount__c from Charge__r order by Discount__c desc limit 1) FROM quest__c where Id IN :Ids];

s=[SELECT Count(Id) total,quest__c from Charge__c Group by quest__c]; //This is line 16

for(Aggregateresult s1:s){
id i=(Id)s1.get('quest__c');
Decimal inn=(Decimal)s1.get('total');
m.put(i,inn);
}

for(quest__c qq:quotes){
if(m.get(qq.id)>0){
qq.Percentage__c=qq.Charge__r[0].Discount__c;
listtobeadded.add(qq);
}
else{
qq.Percentage__c=0;
listtobeadded.add(qq);
}
}
update listtobeadded;

}

 

 

Can you help me fix this error.

 

Thanks.

I have seen the list of countries in salesforce help and there is no list for states.
But my requirement is different.

I would like to see all the countries and states that are available in Standardisation picklist. And if i am going to
add few countries or states in future, to existing picklist values, i would like to see all of them.

I am guessing that i need to write a Apex class or Visualforce page for it and refresh the values (if additional
countries are added to list).
But i do not know the sobject name or API names. I do not know how to proceed.

 Hi,
I have to create an opportunity from Account. 
I have an Account lookup field on opportunity and also a custom field "Test" on opportunity which is also an lookup to Account.

I wrote a trigger to update the value to "Test" custom field value to default to Account look up field value on opportunity. Both show same account names. This is after i save.

But is there a way if i can show the Account value/name of lookup field  on "Test" field on EDIT Page.?? (as a default value) 

I do not know if its possible, let me know your comments and solutions.
THanks in Advance.

Hello, I am trying to create a New Contact button to go along with my new visualforce page.  Can you someone please help me better understand how to create buttons, specifically the New Contact button, and how the action urlfor works?  Thanks!