cancel
Showing results for 
Search instead for 
Did you mean: 

Sync Configuration

Preethi
Deputy

Sync Configuration

Jump to solution

Hi , I am trying tgo create Sync Configurations for custom objects but they are not being created . I have tested the scheduled batch jobs status for these sync configs . Thay are in Queued state for long time 

Labels (2)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Preethi
Deputy

Re: Sync Configuration

Jump to solution

You need write an Apex test for the custom trigger . It differs with the org , Here is a sample one 

 

@isTest
public class <classname> {
    static testMethod void mytestmethod(){
        Test.startTest();
        String uniqueUserName = 'systemadmin' + DateTime.now().getTime() + '@testorg.com';
        Profile p = [SELECT Id FROM Profile WHERE Name='System Administrator'];
        User u = new User(Alias = 'sysadmin', Email='sysadmin@testorg.com',
        EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US',
        LocaleSidKey='en_US', ProfileId = p.Id,
        TimeZoneSidKey='America/Los_Angeles',
         UserName=uniqueUserName, Bypass_Validation_Workflow_Rules__c = true);


        System.runAs(u) {
            <objAPIname> app = new <customobjapiname>();
            <custom field> = '<Value>';
            <custom field> = '<value>';
            insert app;
            update app;
        }
        Test.stopTest();
    }
}

View solution in original post

0 Kudos
8 Replies
Retired Employee Sagar
Retired Employee

Re: Sync Configuration

Jump to solution

Hello @Preethi,

Thank you for reaching out. 

I assume that you are able to create sync configuration for another custom objects in Salesforce and you followed proper steps while creating them. Such issues mostly need re-producing on our end and our engineering team might need sandbox access to your OrgID. This can best be handled by contacting our support team. 

However, before you do that you may want to try reinstalling the Egnyte package in your subscriber Org. One thing to note in this process is that when you reinstall the package then the current Egnyte sync configuration will get deleted hence you will need to recreate the Egnyte sync configuration again.

I hope this helps. 

Thanks.

PS. Help others find answers by selecting "Accept as Solution" if a post answers your question."
0 Kudos
Preethi
Deputy

Re: Sync Configuration

Jump to solution

Hi Sagar , 

Thanks for checking in . I am still having issues in creating Sync Configurations . Below is the error, I am getting . I have provided access to Egnyte team but they are having issues accessing my org 

Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, No trigger or trigger test class exists for the selected sync object.: [efs__TriggerName__c]

Error is in expression '{!checkAsyncRequest}' in page efs:egnytesyncobjectnew: (efs)

 

 

Also , I have provided access to Egnyte team but they said they are having issues accessing salesforce org , which is not the case for other integrations team . 

 

An unexpected error has occurred. Your solution provider has been notified. (efs)

0 Kudos
Retired Employee Sagar
Retired Employee

Re: Sync Configuration

Jump to solution

Hi @Preethi,

Sorry this took a back seat once you started to work with support. I see that our engineering team is involved since quite some time now and engineers were also able to take a pass at this. The support technician will provide you with an update if the engineers need any more info.

I suggest you continue to work via the support ticket coz you will be getting the information from the right channel.

Thank you for your patience and co-operation.

PS. Help others find answers by selecting "Accept as Solution" if a post answers your question."
0 Kudos
Steve Désy
Deputy

Re: Sync Configuration

Jump to solution

Hi @Preethi ,

Did you get any solution?

I'm having the same problem and I was wondering if you could share the solution?

Thanks

Steve

0 Kudos
Preethi
Deputy

Re: Sync Configuration

Jump to solution

@Steve Désy Yes I got the solution . As we have few custom validation rules , i need to create a custom trigger . So before creating sync confiurations , create a Apex trigger and Apex class . Then go to create sync configurations tab and  Select No in Auto generate Trigger and give the custom trigger and class names created before. Below is the sample trigger which worked for most of our objects. 

 

1
2
3
4
5
6
trigger <triggername> on <customobjectAPIName> (after update, after insert) {
    if(trigger.isAfter && trigger.isInsert)
        efs.EgnyteSyncQueueTrigger.onAfterInsert();
    else if(trigger.isAfter && trigger.isUpdate)
        efs.EgnyteSyncQueueTrigger.onAfterUpdate();
}
 

 

0 Kudos
Steve Désy
Deputy

Re: Sync Configuration

Jump to solution

Hi @Preethi 

 

Thanks for your answer.

What does your Apex Class looks like? Do you put the same code has the trigger?

Steve

0 Kudos
Highlighted
Preethi
Deputy

Re: Sync Configuration

Jump to solution

You need write an Apex test for the custom trigger . It differs with the org , Here is a sample one 

 

@isTest
public class <classname> {
    static testMethod void mytestmethod(){
        Test.startTest();
        String uniqueUserName = 'systemadmin' + DateTime.now().getTime() + '@testorg.com';
        Profile p = [SELECT Id FROM Profile WHERE Name='System Administrator'];
        User u = new User(Alias = 'sysadmin', Email='sysadmin@testorg.com',
        EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US',
        LocaleSidKey='en_US', ProfileId = p.Id,
        TimeZoneSidKey='America/Los_Angeles',
         UserName=uniqueUserName, Bypass_Validation_Workflow_Rules__c = true);


        System.runAs(u) {
            <objAPIname> app = new <customobjapiname>();
            <custom field> = '<Value>';
            <custom field> = '<value>';
            insert app;
            update app;
        }
        Test.stopTest();
    }
}

View solution in original post

0 Kudos
Steve Désy
Deputy

Re: Sync Configuration

Jump to solution

Thank you for your help it worked.