• sasham
  • NEWBIE
  • 30 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 32
    Questions
  • 39
    Replies
I have a map called memberUpdatmap which has some membe'srecord from member object . key is the id 
Map <Id, member__c> memberUpdatmap = new Map <Id, member__c>();
I have an other map  memberUpdatmap2 which has some member records and some record has same id from memberUpdatmap.
but i do not have all the fields for those records from memberUpdatmap .
I need to update all members at one time (one dml statement) .from both map. how do i get all the records from memberUpdatmap  to memberUpdatmap2.

Example: Pls answer this 
Map <Id, member__c> memberMap = new Map <Id, member__c>();
member__c p1 = new member__c();
p1.Id = id;
p1.put('FirstName__c', 'testaug1');
p1.put('coacher__c', '34561');
p1.put('LastName__c', 'check');
memberMap.put(p1.Id ,p1);
Map <Id, member__c> memberUpdateMap2 = new Map <Id, member__c>();
p2.Id = id;
p2.put('FirstName__c', 'testaug1');
p2.put('Employee__c', 'xyZ');
p2.put('LastName__c', 'check');
memberMap2.put(p2.Id ,p2);
p3.Id = id;
p3.put('FirstName__c', 'testaug2');
p3.put('Employee__c', 'xyZ');
p3.put('LastName__c', 'check1');
memberMap2.put(p3.Id ,p3);

but p2.id and p1.id are the same member object(id's are same) and  i need to get p1 with all the fields Employee__c, coacher__c in to memberMap2
  • August 10, 2018
  • Like
  • 0
I have to create a list view for user object with some custom fields.which will be assgind for some users based on one Role called TeamMember(Edit and read for only custom filed in the list view) In user object we have role called TeamMember.. Can i create with record type or creating a group for the team mebers and assing to the view and giving access those custome fileds in field accsebility 
  • August 01, 2018
  • Like
  • 0
Hi , 
We have  Member__c obj and MemberState__C objects..MemberState__C  has look up field for Member__c obj. I need to create formula field in Member__c obj. In  MemberState__C obj , we having field state__c and date__c  When the member is active very first time(since we many active state) ,
i need to popolate the formula field called startdate__c  in Member__c using  date__c  in  MemberState__C when state__c is active.. But we can have many active states in  MemberState__C obj per member 
which site is best to create random key (api key and token )
  • April 18, 2018
  • Like
  • 0
If we have field to an SF table and an MC Data Extension, Is it possible to create apex or any script (from salesforce) that catches updates to the field in the SF table and propagates that update to the same field in the MC Data Extension? 
  • April 12, 2018
  • Like
  • 0
Hi . 
I need to update the owner field in a custom object  when a custom field(which has look up to user) changes . I need to check when inserting and updating if the field has value and it is changed , then i need to update owner filed with the value. 

Object : Registration 
custome field : Adviser - look up to user 

need to chnage the owner field in the Registration obj with adviser field.

1)Having a  problem if that before update or after update trigger. 
If  I write after update trigger . I am  wondering if the trigger will run again and again. It will be a recursion. Pls help on this 
  • March 23, 2018
  • Like
  • 0
I need to make a REST callout. I have more than 400 records at time( after bulk insert (more than 400 records ) and  then  need to make callout for sending each record to external sytem)  .
Please guide whcih approach is better to follow
Create a batch and make callouts from the batch (scope is 1)
Or 
Create trigger and then excecute the queueable apex to make callout 
  • February 27, 2018
  • Like
  • 0
I have to  make callout from salesforce to external sysytem. need to send a file as xml (request body to POSt method) 
And i have object for this and all the fields i am querying from this object called  Clientdetails. not sute how to convert as xml fil for Rest service 
<message>
<data>
<result>
<order_code>8798</order_code>
<result_code>pp</result_code>
<units>pp</units>
<value>3</value>
<reference>2-4</reference>
<date>2017-12-14</date>
<normalcy>N</normalcy>
<facility>OO\^Example Labs MMD\^26901 Rod Hills Road\^Calabasas Hills\^CA\^91301\^Dr. Test, MD</facility>
</result>
<result>
<order_code>8798</order_code>
<result_code>pp</result_code>
<units>pp</units>
<value>3</value>
<reference>2-4</reference>
<date>2017-12-14</date>
<normalcy>N</normalcy>
<facility>99\^Example Service MMD\^26901 Rod Hills Road\^Calabasas Hills\^CA\^91301\^Dr. Test, MD</facility>
</result>

</data>
</message>
 
  • February 05, 2018
  • Like
  • 0
It is in Curl for makign Api calout for post method 

curl -H 'Accept: application/xml' -H 'Content-Type:application/xml' \
-u api_key:api_token -d '<message><data><result>
<id>123</id>
<address>cc</address>
<value>5</value>
</result></data></hl7message>'\
'https://example.com/customers/2342/messages

But How do make callout in Apex calss forthe above 
Specially for authentication  -u api_key:api_token
I have api key and token 
  • January 17, 2018
  • Like
  • 0
our client is supposed to send us notification after the resuts has been reviewd. 
1) approval notification 
2)Results  are  availble
these are the urls they asked me to  set up in our end 
http://example.com/notif?id={id}&status=approved
http://example.com/notif?id={id}&status=resulted[&result_type={result}]

For that . I need to setup up an apex class as a REST endpoint for an HTTP GET request that an external system is sending notification.
Please le me know is the right way do or please guide me 
@RestResource(urlMapping='/sample/approvalnotifications')
global without sharing class  Rest_Approval_Notification {

    
    @HttpGet
    global static void doGet() {
        
        System.debug(RestContext.request.requestBody);
        restresponse res=restcontext.response;
        String notification_id = RestContext.request.params.get('id');
        String notification_status = RestContext.request.params.get('status');
        System.debug(notification_id);
        System.debug(notification_status);
		
		//hadling error code and logic for processing 
        
        
        
    }
        
}

 


 
  • January 12, 2018
  • Like
  • 0
I have set up 2  apex class as a REST endpoint for an HTTP GET request that an external system is sending for 2 notification 
such as approved  and result available
http://example.com/notif?id={id}&status=approved
 http://example.com/notif?id={id}&status=resulted[&result_type={result}]
for authentication , we have 3 options 
IP Based Authentication
Token Based Authentication
HTTP Basic Authentication.
Could please  anyone answer , is Token Based Authentication is OAuth  authetication  and how to setup the Token Based Authentication
  • January 11, 2018
  • Like
  • 0
Could you pls some let me know the futue method can be used inside scheduer for long running process 
  • December 18, 2017
  • Like
  • 0
i need to  select  two dates from visualforce page (calender )  after cliciking on the button , in apex controller i need to use those two dates for createddate in the quer
for example if i select 1/20/2017 and 2/20/207  as dates in my page , the query need to retrive data between those two dates in apex controller 
  • December 12, 2017
  • Like
  • 0
how batch apex will handle this situation. we have more than 2000 paticipants in participant objects and steps and weight object
we need a job to handle everyday to find the highst step amonght participant for ranking and to find most hightest step for participant for specific period of time.
if i set chuck to 1 . how all all the particpant steps can be compared.
 
  • December 07, 2017
  • Like
  • 0
Hi 
I have scheduled scheduler class everyday at 1pm(through UI). It seems to be woeking in my staging sanbox. but when i see in the apex job . it is status as queued  and  it should have one staus at 1pm as completed if it was woring at 1 pm.  but as queued.
but i production i can see the status as failed and  staus detail as Scheduler: failed to execute scheduled job: jobId:456778999X class: common.apex.async.AsyncApexJobObject, reason: Apex CPU time limit exceeded.
My question  is It failed in production because cpu time exceeded but in staging why there isno staus as completed or failed but looks like it is working.

 
  • December 03, 2017
  • Like
  • 0
Hi 

We have custom Participant object and custom timezone field(pick list - cetral , eastern arizona and pacific ). for each particiipat , particiipant address (state and zip code) is stored in child object called participantdetail. 
when new participnat is created , how do i populate the time zone  field with thier timezone ( i have  the zip code in address  and is it possible to populate the timezone field using the zip code  ) or any other way.  . 
  • November 14, 2017
  • Like
  • 0
It works in prodction but not in sanbox (acsess token is not required)
  • November 08, 2017
  • Like
  • 0
How do i access Api (public rest api , no need acsess token ) form postmen or runscope. but i woks in workbench 
It showing an error  invalid session id . It works in production not in sanbox 
  • November 07, 2017
  • Like
  • 1
I have craeted custom Rest Api (post method and get ) . Pls let me know if that Api can be called from marketting cloud and how (using java script)
  • November 01, 2017
  • Like
  • 0
  • October 31, 2017
  • Like
  • 0
How do i access Api (public rest api , no need acsess token ) form postmen or runscope. but i woks in workbench 
It showing an error  invalid session id . It works in production not in sanbox 
  • November 07, 2017
  • Like
  • 1
I have a map called memberUpdatmap which has some membe'srecord from member object . key is the id 
Map <Id, member__c> memberUpdatmap = new Map <Id, member__c>();
I have an other map  memberUpdatmap2 which has some member records and some record has same id from memberUpdatmap.
but i do not have all the fields for those records from memberUpdatmap .
I need to update all members at one time (one dml statement) .from both map. how do i get all the records from memberUpdatmap  to memberUpdatmap2.

Example: Pls answer this 
Map <Id, member__c> memberMap = new Map <Id, member__c>();
member__c p1 = new member__c();
p1.Id = id;
p1.put('FirstName__c', 'testaug1');
p1.put('coacher__c', '34561');
p1.put('LastName__c', 'check');
memberMap.put(p1.Id ,p1);
Map <Id, member__c> memberUpdateMap2 = new Map <Id, member__c>();
p2.Id = id;
p2.put('FirstName__c', 'testaug1');
p2.put('Employee__c', 'xyZ');
p2.put('LastName__c', 'check');
memberMap2.put(p2.Id ,p2);
p3.Id = id;
p3.put('FirstName__c', 'testaug2');
p3.put('Employee__c', 'xyZ');
p3.put('LastName__c', 'check1');
memberMap2.put(p3.Id ,p3);

but p2.id and p1.id are the same member object(id's are same) and  i need to get p1 with all the fields Employee__c, coacher__c in to memberMap2
  • August 10, 2018
  • Like
  • 0
I have to create a list view for user object with some custom fields.which will be assgind for some users based on one Role called TeamMember(Edit and read for only custom filed in the list view) In user object we have role called TeamMember.. Can i create with record type or creating a group for the team mebers and assing to the view and giving access those custome fileds in field accsebility 
  • August 01, 2018
  • Like
  • 0
Hi , 
We have  Member__c obj and MemberState__C objects..MemberState__C  has look up field for Member__c obj. I need to create formula field in Member__c obj. In  MemberState__C obj , we having field state__c and date__c  When the member is active very first time(since we many active state) ,
i need to popolate the formula field called startdate__c  in Member__c using  date__c  in  MemberState__C when state__c is active.. But we can have many active states in  MemberState__C obj per member 
I need to make a REST callout. I have more than 400 records at time( after bulk insert (more than 400 records ) and  then  need to make callout for sending each record to external sytem)  .
Please guide whcih approach is better to follow
Create a batch and make callouts from the batch (scope is 1)
Or 
Create trigger and then excecute the queueable apex to make callout 
  • February 27, 2018
  • Like
  • 0
It is in Curl for makign Api calout for post method 

curl -H 'Accept: application/xml' -H 'Content-Type:application/xml' \
-u api_key:api_token -d '<message><data><result>
<id>123</id>
<address>cc</address>
<value>5</value>
</result></data></hl7message>'\
'https://example.com/customers/2342/messages

But How do make callout in Apex calss forthe above 
Specially for authentication  -u api_key:api_token
I have api key and token 
  • January 17, 2018
  • Like
  • 0
our client is supposed to send us notification after the resuts has been reviewd. 
1) approval notification 
2)Results  are  availble
these are the urls they asked me to  set up in our end 
http://example.com/notif?id={id}&status=approved
http://example.com/notif?id={id}&status=resulted[&result_type={result}]

For that . I need to setup up an apex class as a REST endpoint for an HTTP GET request that an external system is sending notification.
Please le me know is the right way do or please guide me 
@RestResource(urlMapping='/sample/approvalnotifications')
global without sharing class  Rest_Approval_Notification {

    
    @HttpGet
    global static void doGet() {
        
        System.debug(RestContext.request.requestBody);
        restresponse res=restcontext.response;
        String notification_id = RestContext.request.params.get('id');
        String notification_status = RestContext.request.params.get('status');
        System.debug(notification_id);
        System.debug(notification_status);
		
		//hadling error code and logic for processing 
        
        
        
    }
        
}

 


 
  • January 12, 2018
  • Like
  • 0
how batch apex will handle this situation. we have more than 2000 paticipants in participant objects and steps and weight object
we need a job to handle everyday to find the highst step amonght participant for ranking and to find most hightest step for participant for specific period of time.
if i set chuck to 1 . how all all the particpant steps can be compared.
 
  • December 07, 2017
  • Like
  • 0
Hi 

We have custom Participant object and custom timezone field(pick list - cetral , eastern arizona and pacific ). for each particiipat , particiipant address (state and zip code) is stored in child object called participantdetail. 
when new participnat is created , how do i populate the time zone  field with thier timezone ( i have  the zip code in address  and is it possible to populate the timezone field using the zip code  ) or any other way.  . 
  • November 14, 2017
  • Like
  • 0
It works in prodction but not in sanbox (acsess token is not required)
  • November 08, 2017
  • Like
  • 0
How do i access Api (public rest api , no need acsess token ) form postmen or runscope. but i woks in workbench 
It showing an error  invalid session id . It works in production not in sanbox 
  • November 07, 2017
  • Like
  • 1
I have all participant and states object (two records registered and assessed ). for some participant is not assesed inthe table evethough it is actually assessed. need to insert those records to states as assesesd 

i have list of patticipant ids and list of  states as assessed 

 if(recs.size()>0 && participantsatates.size()>0) 
         {
              for(participant__c p:recs)
                 {
             
                     for(States__c pstate :participantsatates)
                         
                         {
                            IF (P.Id = pstate.Participant__c)
                            {
                                
                                
                            }
                             
                 
                         }
                 }
  • October 23, 2017
  • Like
  • 0