• RST
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Hi,

 

Is it possible to upload the data when we are refreshing one sandbox to other

i.e when i'm refreshing my one sandbox to other then all the data from should move from one sandbox to another sandbox.

 

If possible then what are different ways to acheive this like through data loader or any Apex code for loading test data into sandboxes as a part of the refresh process

  • June 19, 2013
  • Like
  • 0

Hi,

 

Is it possible to upload the data when we are refreshing one sandbox to other

i.e when i'm refreshing my one sandbox to other then all the data from should move from one sandbox to another sandbox.

 

If possible then what are different ways to acheive this like through data loader or any Apex code for loading test data into sandboxes as a part of the refresh process

 

 

  • June 19, 2013
  • Like
  • 0

Hi,

 

I have a "New Account" button on Account object.

this new Account button redirects to another visualforce page.

 

Now, i want When a user clicks the "New Account" button on the Account Page Layout and they do not have the "Create" permission on their user profile or granted through permission sets, the following error message is displayed: "You have insufficient privileges to create Accounts".

  • May 21, 2013
  • Like
  • 0

Hi,

 

I have a "New Account" button on Account object.

this new Account button redirects to another visualforce page.

 

Now, i want When a user clicks the "New Account" button on the Account Page Layout and they do not have the "Create" permission on their user profile or granted through permission sets, the following error message is displayed: "You have insufficient privileges to create Accounts".

  • May 20, 2013
  • Like
  • 0

Hi,

 

I have a "New Account" button on Account object.

this new Account button redirects to another visualforce page.

 

Now, i want When a user clicks the "New Account" button on the Account Page Layout and they do not have the "Create" permission on their user profile or granted through permission sets, the following error message is displayed: "You have insufficient privileges to create Accounts".

  • May 20, 2013
  • Like
  • 0
CLASS :-


public class UserDML { public static void sendEmailtoUser(List <User> newUsersTrigList) { list<EmailTemplate> Temp = new list<EmailTemplate >([SELECT id FROM EmailTemplate WHERE DeveloperName = 'User_Welcome_Email_Template_1' LIMIT 1]); //Collects all Users Ids to be used on query Set <Id> newUserIds = new Set <Id>(); for (User u : newUsersTrigList){ if ( u.Send_Welcome_Email_to_User__c ) { newUserIds.add(u.Id); } } //Retrieve list of users created/updated from Trigger list <User> newUsersList = [Select Id, ProfileID, Send_Welcome_Email_to_User__c From User Where Id in : newUserIds]; SystemEventLogDML sLogDML = new SystemEventLogDML(); list<System_Event_Log__c> SysEventLogsList = new list<System_Event_Log__c>(); try { if (newUsersList.size() > 0){ Send_Email_to_Users_Settings__c EmailUserSettings = new Send_Email_to_Users_Settings__c(); list <Messaging.Singleemailmessage> msglist = new list <Messaging.Singleemailmessage>(); list <User> upUsersList = new list <User>(); for(User u :newUsersList){ //Send Email to Users based on its Profile EmailUserSettings = Send_Email_to_Users_Settings__c.getValues(u.ProfileId); Messaging.Singleemailmessage msg = new Messaging.Singleemailmessage(); If(EmailUserSettings != null){ msg.setTemplateId(EmailUserSettings.Email_Template_ID__c); } else { msg.setTemplateId(Temp[0].id); } msg.setTargetObjectId(u.Id); msg.setSaveAsActivity(false); msglist.add(msg); //Sets flag back to unchecked after sending the message to the user's email u.Send_Welcome_Email_to_User__c = false; upUserslist.add(u); } //Sends email to Users if (EmailUserSettings.Email_Template_ID__c != null){ Messaging.sendEmail(msglist); } //Updates all users' Send Email checkbox update upUserslist; } } catch (Exception e ){ SysEventLogsList.add(sLogDML.generateSysLog('UserDML.sendEmailtoUser', e.getMessage(), '', slogdml.EvtType[0], UserInfo.getUserId())); } }

 Hi,

 

Getting this error while creating user. i have a checkbox field on user object send_mail_c . if its true then it sends a welcome mail template to user. i have created a profiles market and sales in custom settings and attached a template ID to it. but my requirement is to send a default mail when the profile doesnt exists in custom setting.

 

Trigger below :-

 

 

trigger UserMasterTrigger on User(Before insert, Before update, After Update, After insert)
{
    if(trigger.isBefore)
    {
        if(trigger.isInsert)
        {
            //call the handler for the before insert trigger event
            //population of Federation Id with SSO value
            //population of Manager lookup based on Manager SSO value
            UserTriggerHandler handler = New UserTriggerHandler();
            handler.onBeforeInsert(trigger.New);
        }
        
        if(trigger.isUpdate)
        {
            //call the handler for the before update trigger event
            //population of Federation Id with SSO value
            UserTriggerHandler handler = New UserTriggerHandler();
            handler.onBeforeUpdate(trigger.newMap, trigger.oldMap);
        }
    }
    if(trigger.isAfter){
        if(trigger.isInsert)
        {
            //call the handler for the after update trigger event
            //sending of Email to newly created Users
            UserTriggerHandler handler = New UserTriggerHandler();
            handler.onAfterInsert(trigger.newMap, trigger.oldMap);
        }
        if(trigger.isUpdate)
        {
            //call the handler for the after update trigger event
            //population of Manager lookup based on Manager SSO value of records outside of the trigger batch
            //sending of Email to updated users
            UserTriggerHandler handler = New UserTriggerHandler();
            handler.onAfterUpdate(trigger.newMap, trigger.oldMap);
        }
    }
}
  • May 13, 2013
  • Like
  • 0

Hi,

 

I have a "New Account" button on Account object.

this new Account button redirects to another visualforce page.

 

Now, i want When a user clicks the "New Account" button on the Account Page Layout and they do not have the "Create" permission on their user profile or granted through permission sets, the following error message is displayed: "You have insufficient privileges to create Accounts".

  • May 21, 2013
  • Like
  • 0

Hi,

 

I have a "New Account" button on Account object.

this new Account button redirects to another visualforce page.

 

Now, i want When a user clicks the "New Account" button on the Account Page Layout and they do not have the "Create" permission on their user profile or granted through permission sets, the following error message is displayed: "You have insufficient privileges to create Accounts".

  • May 20, 2013
  • Like
  • 0
CLASS :-


public class UserDML { public static void sendEmailtoUser(List <User> newUsersTrigList) { list<EmailTemplate> Temp = new list<EmailTemplate >([SELECT id FROM EmailTemplate WHERE DeveloperName = 'User_Welcome_Email_Template_1' LIMIT 1]); //Collects all Users Ids to be used on query Set <Id> newUserIds = new Set <Id>(); for (User u : newUsersTrigList){ if ( u.Send_Welcome_Email_to_User__c ) { newUserIds.add(u.Id); } } //Retrieve list of users created/updated from Trigger list <User> newUsersList = [Select Id, ProfileID, Send_Welcome_Email_to_User__c From User Where Id in : newUserIds]; SystemEventLogDML sLogDML = new SystemEventLogDML(); list<System_Event_Log__c> SysEventLogsList = new list<System_Event_Log__c>(); try { if (newUsersList.size() > 0){ Send_Email_to_Users_Settings__c EmailUserSettings = new Send_Email_to_Users_Settings__c(); list <Messaging.Singleemailmessage> msglist = new list <Messaging.Singleemailmessage>(); list <User> upUsersList = new list <User>(); for(User u :newUsersList){ //Send Email to Users based on its Profile EmailUserSettings = Send_Email_to_Users_Settings__c.getValues(u.ProfileId); Messaging.Singleemailmessage msg = new Messaging.Singleemailmessage(); If(EmailUserSettings != null){ msg.setTemplateId(EmailUserSettings.Email_Template_ID__c); } else { msg.setTemplateId(Temp[0].id); } msg.setTargetObjectId(u.Id); msg.setSaveAsActivity(false); msglist.add(msg); //Sets flag back to unchecked after sending the message to the user's email u.Send_Welcome_Email_to_User__c = false; upUserslist.add(u); } //Sends email to Users if (EmailUserSettings.Email_Template_ID__c != null){ Messaging.sendEmail(msglist); } //Updates all users' Send Email checkbox update upUserslist; } } catch (Exception e ){ SysEventLogsList.add(sLogDML.generateSysLog('UserDML.sendEmailtoUser', e.getMessage(), '', slogdml.EvtType[0], UserInfo.getUserId())); } }

 Hi,

 

Getting this error while creating user. i have a checkbox field on user object send_mail_c . if its true then it sends a welcome mail template to user. i have created a profiles market and sales in custom settings and attached a template ID to it. but my requirement is to send a default mail when the profile doesnt exists in custom setting.

 

Trigger below :-

 

 

trigger UserMasterTrigger on User(Before insert, Before update, After Update, After insert)
{
    if(trigger.isBefore)
    {
        if(trigger.isInsert)
        {
            //call the handler for the before insert trigger event
            //population of Federation Id with SSO value
            //population of Manager lookup based on Manager SSO value
            UserTriggerHandler handler = New UserTriggerHandler();
            handler.onBeforeInsert(trigger.New);
        }
        
        if(trigger.isUpdate)
        {
            //call the handler for the before update trigger event
            //population of Federation Id with SSO value
            UserTriggerHandler handler = New UserTriggerHandler();
            handler.onBeforeUpdate(trigger.newMap, trigger.oldMap);
        }
    }
    if(trigger.isAfter){
        if(trigger.isInsert)
        {
            //call the handler for the after update trigger event
            //sending of Email to newly created Users
            UserTriggerHandler handler = New UserTriggerHandler();
            handler.onAfterInsert(trigger.newMap, trigger.oldMap);
        }
        if(trigger.isUpdate)
        {
            //call the handler for the after update trigger event
            //population of Manager lookup based on Manager SSO value of records outside of the trigger batch
            //sending of Email to updated users
            UserTriggerHandler handler = New UserTriggerHandler();
            handler.onAfterUpdate(trigger.newMap, trigger.oldMap);
        }
    }
}
  • May 13, 2013
  • Like
  • 0