Giter Club home page Giter Club logo

testdatafactory's Introduction

Apex Test Data Factory

โ€œ The ultimate Apex Test Data Factory โ€ ๐Ÿญ ๐Ÿ‘Œ

Generate & insert an sObject with all the required fields & relationships auto-filled

Contact con = (Contact)TestDataFactory.createSObject('Contact');

Inserted data*:

Contact:{Id='0036E00000R4nG0QAJ', Lastname:'test0'}

Assign values to fields of the main sObject and the related sObjects

Contact con = (Contact)TestDataFactory.createSObject('Contact', new Map<String,Object>{
  'Email' => '[email protected]',
  'Account.Description' => 'Text for the Description field on the Account'
});

Inserted data*:

Contact:{Id='0036E00000R55chQAB', Lastname:'test0', Email:'[email protected]', AccountId='0016E00000Z6bC7QAJ'}
Account:{Id='0016E00000Z6bC7QAJ', Name='test0', Description='Text for the Description field on the Account'}

* in a non-customized org

Install :

Get the TestDataFactory class by installing the TestDataFactory Unlocked Package ๐Ÿ”“๐Ÿ“ฆ in your org using the UI or by running the following sfdx command

sfdx force:package:install --wait 10 --publishwait 10 --package 04t1n000002WsK5AAK -r -u AliasOfYourOrg

More :

Apache 2.0

testdatafactory's People

Contributors

benahm avatar dosmakov avatar renatoliveira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

testdatafactory's Issues

Some SObject types are not supported

Description

There are some SObject types that cannot be instantiated through this factory. Some of those errors are related to required fields missing. I think the only workaround would be to explicitly set those missing attributes to something?

Some Examples

ActiveScratchOrg

  • Code
TestDataFactory.createSObject('ActiveScratchOrg');
  • Error
TestDataFactory.TestDataFactoryException: Unable to insert "ActiveScratchOrg" records: REQUIRED_FIELD_MISSING: Required fields are missing: [ScratchOrg] []

ContentVersion

  • Code
TestDataFactory.createSObject('ContentVersion');
  • Error
TestDataFactory.TestDataFactoryException: Unable to insert "ContentVersion.contentdocument" records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: An unexpected error occurred. []

DuplicateRecordSet

  • Code
TestDataFactory.createSObject('DuplicateRecordSet');
  • Error
TestDataFactory.TestDataFactoryException: Unable to insert "DuplicateRecordSet" records: REQUIRED_FIELD_MISSING: Specify a value for the Duplicate Rule ID field. []

Package not found

Hey,

Im getting the following error installing through UI.

image

Also not working using sfdx

Missing comma in the "Create a list of 5 Account sObjects with different names and a same description" example

On the examples page, the example for "Create a list of 5 Account sObjects with different names and a same description" is missing a comma after the object in the construction of the map.

It should look like:

List<Account> accList = TestDataFactory.createSObjectList('Account', new Map<String,Object>{
  'Name' => new List<String>{'Google','Amazon','Facebook','Apple','Microsoft'},
  'Description' => 'Same description'
},5);

Person account

I have Person account enabled in the org and I'm getting the following errors right after installing the TestDataFactory package.

=== Test Results
TEST NAME OUTCOME MESSAGE RUNTIME (MS)
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
TestDataFactory_Test.addRelationshipNameTest Pass 109
TestDataFactory_Test.convertMapValueTypesTest Pass 117
TestDataFactory_Test.convertSetToLowerCaseTest Pass 22
TestDataFactory_Test.createSObjectListTest1 Pass 606
TestDataFactory_Test.createSObjectListTest2 Fail TestDataFactory.TestDataFactoryException: Unable to insert "Contact" records:
FIELD_CUSTOM_VALIDATION_EXCEPTION: Please make sure the following fields are filled out:

                                                                First Name and Last Name. []                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                                FIELD_CUSTOM_VALIDATION_EXCEPTION: Please make sure the following fields are fill                                                                                                                                                           
                                                                Class.TestDataFactory.SObjectManager: line 391, column 1                                                                                                                                                                                    
                                                                Class.TestDataFactory.SObjectManager.insertAll: line 312, column 1                                                                                                                                                                          
                                                                Class.TestDataFactory.SObjectFactory: line 475, column 1                                                                                                                                                                                    
                                                                Class.TestDataFactory: line 159, column 1                                                                                                                                                                                                   
                                                                Class.TestDataFactory: line 113, column 1                                                                                                                                                                                                   
                                                                Class.TestDataFactory_Test.createSObjectListTest2: line 310, column 1                                                                                                                                                                                   

TestDataFactory_Test.createSObjectListTest3 Pass 1028
TestDataFactory_Test.createSObjectListTest4 Fail TestDataFactory.TestDataFactoryException: Unable to insert "Contact" records:
FIELD_CUSTOM_VALIDATION_EXCEPTION: Please make sure the following fields are filled out:

                                                                First Name and Last Name. []                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                Class.TestDataFactory.SObjectManager: line 391, column 1                                                                                                                                                                                    
                                                                Class.TestDataFactory.SObjectManager.insertAll: line 312, column 1                                                                                                                                                                          
                                                                Class.TestDataFactory.SObjectFactory: line 475, column 1                                                                                                                                                                                    
                                                                Class.TestDataFactory: line 159, column 1                                                                                                                                                                                                   
                                                                Class.TestDataFactory: line 141, column 1                                                                                                                                                                                                   
                                                                Class.TestDataFactory_Test.createSObjectListTest4: line 332, column 1                                                                                                                                                                                   

TestDataFactory_Test.createSObjectListTest5 Pass 66
TestDataFactory_Test.createSObjectListTest6 Fail TestDataFactory.TestDataFactoryException: Unable to insert "Account" records:
INVALID_FIELD_FOR_INSERT_UPDATE: Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set. [Name=test, RecordTypeId=0122o000000NvF9AAK]
INVALID_FIELD_FOR_INSERT_UPDATE: Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set. [Name=test, RecordTypeId=0122o000000NvF9AAK]
Class.TestDataFactory.SObjectManager: line 391, column 1
Class.TestDataFactory.SObjectManager.insertAll: line 312, column 1
Class.TestDataFactory.SObjectFactory: line 475, column 1
Class.TestDataFactory: line 159, column 1
Class.TestDataFactory: line 141, column 1
Class.TestDataFactory_Test.createSObjectListTest6: line 372, column 1
TestDataFactory_Test.createSObjectListTest7 Pass 7999
TestDataFactory_Test.createSObjectTest1 Pass 126
TestDataFactory_Test.createSObjectTest10 Pass 110
TestDataFactory_Test.createSObjectTest11 Pass 1500
TestDataFactory_Test.createSObjectTest12 Pass 654
TestDataFactory_Test.createSObjectTest13 Pass 55
TestDataFactory_Test.createSObjectTest14 Pass 49
TestDataFactory_Test.createSObjectTest15 Pass 121
TestDataFactory_Test.createSObjectTest16 Pass 126
TestDataFactory_Test.createSObjectTest17 Pass 48
TestDataFactory_Test.createSObjectTest2 Pass 114
TestDataFactory_Test.createSObjectTest3 Pass 555
TestDataFactory_Test.createSObjectTest4 Fail TestDataFactory.TestDataFactoryException: Unable to insert "Case.asset.parent.contact" records:
INVALID_CROSS_REFERENCE_KEY: Can not select a person account [AccountId=001AP000002PqaFYAS]
Class.TestDataFactory.SObjectManager: line 391, column 1
Class.TestDataFactory.SObjectManager.insertAll: line 291, column 1
Class.TestDataFactory.SObjectFactory: line 475, column 1
Class.TestDataFactory: line 159, column 1
Class.TestDataFactory: line 101, column 1
Class.TestDataFactory_Test.createSObjectTest4: line 65, column 1
TestDataFactory_Test.createSObjectTest5 Pass 135
TestDataFactory_Test.createSObjectTest6 Fail TestDataFactory.TestDataFactoryException: Unable to insert "Account" records:
INVALID_FIELD_FOR_INSERT_UPDATE: Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set. [Name=test, RecordTypeId=0122o000000NvF9AAK]
Class.TestDataFactory.SObjectManager: line 391, column 1
Class.TestDataFactory.SObjectManager.insertAll: line 312, column 1
Class.TestDataFactory.SObjectFactory: line 475, column 1
Class.TestDataFactory: line 159, column 1
Class.TestDataFactory: line 101, column 1
Class.TestDataFactory_Test.createSObjectTest6: line 108, column 1
TestDataFactory_Test.createSObjectTest7 Fail TestDataFactory.TestDataFactoryException: Unable to insert "Account" records:
INVALID_FIELD_FOR_INSERT_UPDATE: Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set. [Name=test, RecordTypeId=0122o000000NvF9AAK]
Class.TestDataFactory.SObjectManager: line 391, column 1
Class.TestDataFactory.SObjectManager.insertAll: line 312, column 1
Class.TestDataFactory.SObjectFactory: line 475, column 1
Class.TestDataFactory: line 159, column 1
Class.TestDataFactory: line 101, column 1
Class.TestDataFactory: line 86, column 1
Class.TestDataFactory_Test.createSObjectTest7: line 128, column 1
TestDataFactory_Test.createSObjectTest8 Pass 167
TestDataFactory_Test.createSObjectTest9 Pass 38
TestDataFactory_Test.formatErrorMessageTest Pass 19
TestDataFactory_Test.generateDefaultMapOfValuesTest1 Pass 252
TestDataFactory_Test.generateDefaultMapOfValuesTest10 Pass 30
TestDataFactory_Test.generateDefaultMapOfValuesTest2 Pass 39
TestDataFactory_Test.generateDefaultMapOfValuesTest3 Pass 38
TestDataFactory_Test.generateDefaultMapOfValuesTest4 Pass 29
TestDataFactory_Test.generateDefaultMapOfValuesTest5 Pass 28
TestDataFactory_Test.generateDefaultMapOfValuesTest6 Pass 36
TestDataFactory_Test.generateDefaultMapOfValuesTest7 Pass 42
TestDataFactory_Test.generateDefaultMapOfValuesTest8 Pass 51
TestDataFactory_Test.generateDefaultMapOfValuesTest9 Pass 31
TestDataFactory_Test.getDefaultMapOfValuesTest1 Pass 561
TestDataFactory_Test.getDefaultMapOfValuesTest2 Pass 101
TestDataFactory_Test.getDefaultMapOfValuesTest3 Pass 31
TestDataFactory_Test.getDefaultMapOfValuesTest4 Pass 109
TestDataFactory_Test.getDefaultMapOfValuesTest5 Pass 28
TestDataFactory_Test.getDefaultValueTest Pass 70
TestDataFactory_Test.getDefinedSObjectOptionalFieldsTest Pass 18
TestDataFactory_Test.getDefinedSObjectRequiredFieldsTest Pass 19
TestDataFactory_Test.getFieldNameFromRelationshipNameTest Pass 17
TestDataFactory_Test.getFieldTokensMapTest Pass 22
TestDataFactory_Test.getFieldValueFromMapOfValuesTest Pass 19
TestDataFactory_Test.getListSObjectInstanceTest Pass 110
TestDataFactory_Test.getMainSObjectListTest Pass 18
TestDataFactory_Test.getRelatedSObjectInstanceTest Pass 20
TestDataFactory_Test.getRelationshipInstanceTest Pass 21
TestDataFactory_Test.getRelationshipKeySetTest Pass 21
TestDataFactory_Test.getRelationshipTest Pass 18
TestDataFactory_Test.getSFDefaultPicklistValueTest Pass 32
TestDataFactory_Test.getSObjectFactoryTest Pass 18
TestDataFactory_Test.getSObjectInstanceTest Pass 28
TestDataFactory_Test.getSObjectTest Pass 17
TestDataFactory_Test.getTypeDefaultValueTest Pass 20
TestDataFactory_Test.getValueTest1 Pass 17
TestDataFactory_Test.getValueTest2 Pass 21
TestDataFactory_Test.getValueTest3 Pass 18
TestDataFactory_Test.initSObjectInstanceTest Pass 22
TestDataFactory_Test.insertAllTest Fail TestDataFactory.TestDataFactoryException: Unable to insert "Case.account" records:
FIELD_CUSTOM_VALIDATION_EXCEPTION: This account is missing some required Postal Address data. Please make sure that you have added a Postal Street, Postal Code, Postal City and/or Postal Country before saving this account. [Name=test]
FIELD_CUSTOM_VALIDATION_EXCEPTION: This account is missing a Company Email. Please make sure that you enter in the Company Email before you save this account. [Name=test]
FIELD_CUSTOM_VALIDATION_EXCEPTION: This account is missing a Sales Market. Please make sure that you have selected a Sales Market for this account before saving. [Name=test]
Class.TestDataFactory.SObjectManager: line 391, column 1
Class.TestDataFactory.SObjectManager.insertAll: line 291, column 1
Class.TestDataFactory_Test.insertAllTest: line 513, column 1
TestDataFactory_Test.insertListTest Fail TestDataFactory.TestDataFactoryException: Unable to insert "Case" records:
FIELD_CUSTOM_VALIDATION_EXCEPTION: This account is missing some required Postal Address data. Please make sure that you have added a Postal Street, Postal Code, Postal City and/or Postal Country before saving this account. [Name=test]
FIELD_CUSTOM_VALIDATION_EXCEPTION: This account is missing a Company Email. Please make sure that you enter in the Company Email before you save this account. [Name=test]
FIELD_CUSTOM_VALIDATION_EXCEPTION: This account is missing a Sales Market. Please make sure that you have selected a Sales Market for this account before saving. [Name=test]
Class.TestDataFactory.SObjectManager: line 391, column 1
Class.TestDataFactory_Test.insertListTest: line 565, column 1
TestDataFactory_Test.isDefaultValueRequiredTest Pass 19
TestDataFactory_Test.managePersonAccountOrgEnabledTest1 Pass 93
TestDataFactory_Test.managePersonAccountOrgEnabledTest2 Pass 54
TestDataFactory_Test.managePersonAccountOrgEnabledTest3 Pass 30
TestDataFactory_Test.managePersonAccountOrgEnabledTest4 Pass 45
TestDataFactory_Test.managePersonAccountOrgEnabledTest5 Pass 18
TestDataFactory_Test.mergeValueTest Pass 18
TestDataFactory_Test.putFieldTest Pass 18
TestDataFactory_Test.putRelationshipFieldTest1 Pass 31
TestDataFactory_Test.putRelationshipFieldTest2 Pass 28
TestDataFactory_Test.putSObjectTest Pass 21
TestDataFactory_Test.setChildParentRelationshipTest Pass 57
TestDataFactory_Test.setDefaultValueProviderTest Pass 17
TestDataFactory_Test.setRelationshipTest Pass 19
TestDataFactory_Test.setSObjectTest Pass 18

Debu log size

Hey,

really happy with this library. Just one thing: The debug log size is really high. Is there anyway to not have debug statements from this package appear?

Enhancement Request: Allow looping through List value providers

When creating records in bulk it would be helpful to provide a smaller list of values and have them reused in the output.

For example:

List<Book__c> myBooks = TestDataFactory.createSObjectList('Books__c', new Map<String, Object>{
    'Author__c' => new List<String>{'Vonnegut', 'Bukowski', 'Herbert', 'Murakami'},
    'Title__c'  => 'Book-{!index}'
}, 100);

/*
* Ideal output would look like:
*
* Book__c{author__c='Vonnegut', title__c=Book-1}
* Book__c{author__c='Bukowski', title__c=Book-2}
* Book__c{author__c='Herbert', title__c=Book-3}
* Book__c{author__c='Murakami', title__c=Book-4}
* Book__c{author__c='Vonnegut', title__c=Book-5}
* etc.
*/

Currently, if you were to write code like the above you end up with an out of bounds error:
TestDataFactoryException: Unable to get the value for the field "author__c"

Using a modulus operation (or something similar) to loop through a list would reduce the amount of code to initialize records while also giving variety to a large group of created records.

Enhancement Request: Syntax for more "random data" fields beyond required fields

This is a very helpful, easy-to-use helper class.

One thing that could make it more useful is an ability to specify fields you'd like the helper class to invent data for.

The helper class is already inventing data for any "required" fields it comes across.

If there were a syntax to specify other fields for which it'd be desirable for it to make up completely random data, it would be even more useful.

Potential Example Issue?

Bear with me, as I am just breaking into development...

But, in the example "Create 10 Cases related to 10 Accounts" it errors our when you use AccountId in the Case list. You have to use Account or else you get the error:

The field "accountidid" does not exist on "Case" or the value type provided is incorrect Original error message : Invalid field accountidid for Case.

I also attached a screen grab:

dev-console-log-20190920

Also - FWIW - This was in a brand new vanilla dev org.

Just wanted to let you know so you can update the examples in the docs.

Thanks! Love it so far!

Performance results

Thank you for examining the performance impact of using this library.

I'm having a hard time understanding what the results imply. Are test results for test cases 5 and 6 good? How much time would a test case take which does the same without your library, e.g. manually composes those objects and inserts them into the database in bulks?

DUPLICATE_VALUE: duplicate value found

Hello, getting this error while running tests.

TestDataFactory.TestDataFactoryException: Unable to insert &quot;QuoteLineItem.product2&quot; records: 
DUPLICATE_VALUE: duplicate value found: &lt;unknown&gt; duplicates value on record with id: &lt;unknown&gt; [Name=test0].

Seems 'TestDataFactory' doesn't count sames object number, and if creating record which depends on object 'X' and object 'Y' which depends also on 'X', two objects of 'X' will be created, but with same 'Name', that is causing my error.

It simply solved by specifying the name for one of 'X' objects, so another 'X' is default 'test0'.
It would be great to make the counter, to prevent this error.

Variable does not exist on Campaign object when deploying to a Trial org

I'm using this amazing library in one of my project, and when trying to deploy through SFDX the content of the project, it fails on the TestDataFactory_Test file with the following error:

*** Deploying v52.0 metadata with SOAP API v53.0 connection ***
Deploy ID: 0AfB000000dUwvJKAS
DEPLOY PROGRESS | โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ | 572/572 Components

=== Component Failures [6]
Type   Name                  Problem
Error  TestDataFactory_Test  Variable does not exist: Campaign.fields.IsActive (1078:165)
Error  TestDataFactory_Test  Variable does not exist: Campaign.SObjectType (1078:130)
Error  TestDataFactory_Test  Variable does not exist: Campaign.fields.IsActive (1020:91)
Error  TestDataFactory_Test  Variable does not exist: Campaign.SObjectType (1020:56)
Error  B2C_CRM_JWT           In field: apexClass - no ApexClass named TestDataFactory_Test found
Error  B2C_CRM_SYNC          In field: apexClass - no ApexClass named TestDataFactory_Test found

ERROR running force:source:deploy:  Deploy failed.

It seems that the Campaign object is not available on the instance, which prevents the test data class to be deployed.
How would you solve this? Is there a way to modify the TestDataFactory_Test file to only execute this code if the related object exists in the target org?

Thanks

Account Name isNillable = true when person account enabled

When person account enabled

Schema.DescribeFieldResult fieldDesc = Schema.getGlobalDescribe().get('Account').getDescribe().fields.getMap().get('name').getDescribe();

=> fieldDesc.isNillable() = true

when creating account:

(Account)TDF.createSObject('Account');
TDF.TestDataFactoryException: Unable to insert "Account" records: REQUIRED_FIELD_MISSING: Required fields are missing: [Name] []

In the TDF, this method return false on account name:

private Boolean isDefaultValueRequired(Schema.DescribeFieldResult fieldDesc){
    return 
    !fieldDesc.isDefaultedOnCreate() // does not have a defaut value on creation
    && !fieldDesc.isAutoNumber() // is not an auto number
    && !fieldDesc.isNillable() // is required
    && fieldDesc.isCreateable(); // value can be set on creation 
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.